Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Set up AppMap #33

Merged
merged 8 commits into from
Dec 22, 2023
Merged

ci: Set up AppMap #33

merged 8 commits into from
Dec 22, 2023

Conversation

petecheslock
Copy link
Contributor

This pull request was created by the AppMap CI setup assistant.

To continue, return to https://getappmap.com/setup/github_auto/progress.

Steps to merge:

  • Review the automated commit which adds the AppMap language agent and appmap.yml.
  • Review the "AppMap configuration report" generated by the workflow run.

Copy link

AppMap configuration report

Success! Your project has been successfully configured to record AppMaps when
you run your tests.

Continue with AppMap Setup >>


The following sections contain detailed information about the AppMap integration with your project.

AppMap data sources

In GitHub Actions and other CI systems, AppMaps are created by recording
test cases. Here's how the AppMaps in this project were created:

Number of AppMaps Type of recording
85 minitest

Code recording settings

Your appmap.yml configuration file specifies all the code that you want AppMap to instrument and record.
By default, sub-modules of any requested code are recorded as well. In this project, the packages specified
in appmap.yml are:

- path: app
- path: lib

By applying this configuration to your ruby project, AppMap has recorded the
following packages and modules:

app app/helpers app/models

Web service API profile

When you record AppMaps that include HTTP server requests, AppMap automatically generates OpenAPI definitions
based on the observed data.

69% of the AppMaps in this project contain at least one HTTP server request.

36% of the AppMaps in this project contain more than one HTTP server request.

Here's a summary of the web service routes that are provided by this project:

/ /about /account_activations/{id} /contact /help /login /logout /microposts /microposts/{id} /password_resets /password_resets/new /password_resets/{id} /relationships /relationships/{id} /signup /users /users/{id}

And here are the different content types served by the API:

Response Content Type Number of Routes
text/html 39
text/vnd.turbo-stream.html 2

As you change your code and tests, AppMap will automatically update the OpenAPI definitions.
You'll see a summary of the REST API changes in each pull request.

SQL profile

When your code makes a SQL query, AppMap records the SQL query in detail. It even parses the queries
to figure out which tables your app is using, and how it's using them.

78% of the AppMaps in this project contain at least one SQL query.

75% of the AppMaps in this project contain more than one SQL query.

Here are the SQL tables that are present in the observed queries:

active_storage_attachments microposts relationships sqlite_master sqlite_temp_master users

Large AppMaps

Some tests can produce large AppMaps, because they exercise longer or highly repeated code paths.
AppMap runtime code review is optimized for AppMaps that
are less than 10 MB in size. You may want to consider disabling AppMap for tests that produce
large AppMaps, since they can slow down your CI job and they are hard to analyze. Also, note that
AppMaps greater than 50 MB in size will not be analyzed at all.

You can disable recording of a test case by adding a code comment or annotation to the test case file.
Learn how by visiting the
reference documentation for appmap-ruby.

Here are the largest AppMaps that are greater than 1 MB:

Size Location Test name AppMap path
1.62 MB test/integration/microposts_interface_test.rb:9 Microposts_interface micropost interface tmp/appmap/minitest/Microposts_interface_micropost_interface.appmap.json
1.25 MB test/integration/users_login_test.rb:17 Invalid_password login with valid email/invalid password tmp/appmap/minitest/Invalid_password_login_with_valid_email_invalid_password.appmap.json
1.13 MB test/integration/users_login_test.rb:12 Invalid_password login path tmp/appmap/minitest/Invalid_password_login_path.appmap.json

Frequently recorded functions

The AppMap configuration file appmap.yml specifies which functions to record.
Some functions may be called very frequently, adding little to the understandability of the code
while adding a lot of overhead to the AppMap recording process.

Note that some functions are automatically added to the recording by
the AppMap agent. For example, the AppMap agent automatically records functions that are
relevant to detecting security flaws and performance problems. If you disable recording of these
functions, then some problems may become undetectable.

You can disable recording of a class or function by updating the appmap.yml configuration file.
Learn how by visiting the
reference documentation for appmap-ruby.

Here are some of the most frequently recorded functions in this project:

Number of occurrences Function name Source location
1232 Logger::LogDevice#write /opt/hostedtoolcache/Ruby/3.1.2/x64/lib/ruby/3.1.0/logger/log_device.rb:31
1149 Array#pack <internal:pack>:143

Learn more

To learn more about AppMap, visit
appmap.io/docs.

Copy link

github-actions bot commented Dec 14, 2023

AppMap project summary

AppMap runtime code review scans the AppMaps for security flaws, performance
problems, and code anti-patterns. When you use AppMap runtime code review on a pull request,
only the new problems and resolved problems are shown in the report.

Overview of problems and flaws

AppMap detected 2 types of problems and flaws in the runtime code review of your project.
Here's a list of the types of problems that have been found:

Rule Impact Domain
n-plus-one-query Performance
update-in-get-request Maintainability

Recently introduced code flaws and problems

A sample of all the problems that were found in the AppMaps. Problems are listed in order of
when they were most likely introduced, with most recent first.

🚨 Data update performed in GET or HEAD request at app/models/user.rb:60

4 days old

View details
Description

Data update performed in HTTP request GET /account_activations/{id}/edit: UPDATE "users" SET "updated_at" = ?, "activated" = ? WHERE "users"."id" = ?

Field Value
Rule update-in-get-request
Impact domain Maintainability
Stack trace

🚨 Data update performed in GET or HEAD request at app/models/user.rb:60

4 days old

View details
Description

Data update performed in HTTP request GET /account_activations/{id}/edit: UPDATE "users" SET "updated_at" = ?, "activated_at" = ? WHERE "users"."id" = ?

Field Value
Rule update-in-get-request
Impact domain Maintainability
Stack trace

🚨 Data update performed in GET or HEAD request at app/models/user.rb:35

4 days old

View details
Description

Data update performed in HTTP request GET /account_activations/{id}/edit: UPDATE "users" SET "updated_at" = ?, "remember_digest" = ? WHERE "users"."id" = ?

Field Value
Rule update-in-get-request
Impact domain Maintainability
Stack trace

🐌 N plus 1 SQL query at app/helpers/sessions_helper.rb:19

4 days old

View details
Description

app_views_shared__feed_html_erb.render[418] contains 30 occurrences of SQL: SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?

Field Value
Rule n-plus-one-query
Impact domain Performance
Stack trace

🐌 N plus 1 SQL query at app/helpers/sessions_helper.rb:19

4 days old

View details
Description

app_views_users_show_html_erb.render[3129] contains 6 occurrences of SQL: SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?

Field Value
Rule n-plus-one-query
Impact domain Performance
Stack trace

🐌 N plus 1 SQL query at app/helpers/sessions_helper.rb:19

4 days old

View details
Description

app_views_users_index_html_erb.render[257] contains 30 occurrences of SQL: SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?

Field Value
Rule n-plus-one-query
Impact domain Performance
Stack trace

🐌 N plus 1 SQL query at app/helpers/sessions_helper.rb:19

4 days old

View details
Description

app_views_users_index_html_erb.render[257] contains 32 occurrences of SQL: SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ?

Field Value
Rule n-plus-one-query
Impact domain Performance
Stack trace

🐌 N plus 1 SQL query at app/views/users/show.html.erb

4 days old

View details
Description

app_views_users_show_html_erb.render[51] contains 30 occurrences of SQL: SELECT "active_storage_attachments".* FROM "active_storage_attachments" WHERE "active_storage_attachments"."record_id" = ? AND "active_storage_attachments"."record_type" = ? AND "active_storage_attachments"."name" = ? LIMIT ?

Field Value
Rule n-plus-one-query
Impact domain Performance
Stack trace

Copy link

AppMap runtime code review

Summary Status
Failed tests ✅ All tests passed
API changes 0️⃣ No API changes
Security flaws ✅ None detected
Performance problems ✅ None detected
Code anti-patterns ✅ None detected
New AppMaps 0️⃣ No new AppMaps

@petecheslock petecheslock marked this pull request as ready for review December 22, 2023 15:53
@petecheslock petecheslock merged commit c7081d1 into main Dec 22, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant