appmap 0.78.0 → 0.80.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +4 -16
  3. data/CHANGELOG.md +30 -0
  4. data/{spec/fixtures/rails5_users_app/Dockerfile.pg → Dockerfile.pg} +0 -0
  5. data/README.md +14 -44
  6. data/README_CI.md +0 -7
  7. data/Rakefile +12 -150
  8. data/appmap.gemspec +3 -2
  9. data/docker-compose.yml +10 -0
  10. data/lib/appmap/agent.rb +8 -0
  11. data/lib/appmap/event.rb +26 -12
  12. data/lib/appmap/gem_hooks/actionpack.yml +6 -0
  13. data/lib/appmap/handler/rails/render_handler.rb +29 -0
  14. data/lib/appmap/handler/rails/request_handler.rb +13 -11
  15. data/lib/appmap/handler/rails/sql_handler.rb +43 -1
  16. data/lib/appmap/handler.rb +3 -0
  17. data/lib/appmap/hook/method.rb +0 -1
  18. data/lib/appmap/version.rb +1 -1
  19. data/spec/config_spec.rb +1 -1
  20. data/spec/depends/api_spec.rb +13 -5
  21. data/spec/depends/spec_helper.rb +0 -9
  22. data/spec/fixtures/database.yml +11 -0
  23. data/spec/fixtures/rails5_users_app/config/database.yml +1 -0
  24. data/spec/fixtures/rails6_users_app/Gemfile +1 -25
  25. data/spec/fixtures/rails6_users_app/config/database.yml +1 -0
  26. data/spec/fixtures/rails7_users_app/Gemfile +1 -25
  27. data/spec/fixtures/rails7_users_app/config/database.yml +1 -0
  28. data/spec/handler/eval_spec.rb +1 -1
  29. data/spec/hook_spec.rb +6 -1
  30. data/spec/rails_recording_spec.rb +7 -21
  31. data/spec/rails_spec_helper.rb +76 -63
  32. data/spec/rails_test_spec.rb +7 -17
  33. data/spec/railtie_spec.rb +4 -18
  34. data/spec/record_sql_rails_pg_spec.rb +44 -75
  35. data/spec/remote_recording_spec.rb +18 -30
  36. data/spec/spec_helper.rb +1 -0
  37. data/spec/swagger/swagger_spec.rb +1 -16
  38. data/spec/util_spec.rb +1 -1
  39. data/test/expectations/openssl_test_key_sign2-3.1.json +2 -1
  40. metadata +22 -21
  41. data/Dockerfile.appmap +0 -5
  42. data/spec/fixtures/rack_users_app/Dockerfile +0 -32
  43. data/spec/fixtures/rack_users_app/docker-compose.yml +0 -9
  44. data/spec/fixtures/rails5_users_app/Dockerfile +0 -29
  45. data/spec/fixtures/rails5_users_app/config/database.yml +0 -18
  46. data/spec/fixtures/rails5_users_app/create_app +0 -33
  47. data/spec/fixtures/rails5_users_app/docker-compose.yml +0 -31
  48. data/spec/fixtures/rails6_users_app/.ruby-version +0 -1
  49. data/spec/fixtures/rails6_users_app/Dockerfile +0 -44
  50. data/spec/fixtures/rails6_users_app/Dockerfile.pg +0 -3
  51. data/spec/fixtures/rails6_users_app/config/database.yml +0 -18
  52. data/spec/fixtures/rails6_users_app/create_app +0 -33
  53. data/spec/fixtures/rails6_users_app/docker-compose.yml +0 -31
  54. data/spec/fixtures/rails7_users_app/.ruby-version +0 -1
  55. data/spec/fixtures/rails7_users_app/Dockerfile +0 -30
  56. data/spec/fixtures/rails7_users_app/Dockerfile.pg +0 -3
  57. data/spec/fixtures/rails7_users_app/config/database.yml +0 -86
  58. data/spec/fixtures/rails7_users_app/create_app +0 -31
  59. data/spec/fixtures/rails7_users_app/docker-compose.yml +0 -31
@@ -1,33 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -ex
3
-
4
- # Just checking for a healthy container isn't enough, apparently. If
5
- # we don't wait here, sometimes the database is inaccessible.
6
- for i in {1..10}; do
7
- psql -h pg -U postgres postgres -c 'select 1' >/dev/null 2>&1 && break
8
- printf ' .'
9
- sleep 1
10
- done
11
- echo
12
- out="$(psql -h pg -U postgres postgres -c 'select 1' 2>&1)"
13
- if [[ $? != 0 ]]; then
14
- echo "Postgres didn't start in time:"
15
- echo "$out"
16
- exit 1
17
- fi
18
-
19
- # Required for migrations
20
- export ORM_MODULE=sequel
21
-
22
- set +e
23
- psql -h pg -U postgres -c "drop database if exists app_development"
24
- psql -h pg -U postgres -c "drop database if exists app_test"
25
- set -e
26
-
27
- psql -h pg -U postgres -c "create database app_development"
28
- psql -h pg -U postgres -c "create database app_test"
29
-
30
- env RAILS_ENV=development bundle exec rake -t db:migrate
31
- env RAILS_ENV=test bundle exec rake -t db:migrate
32
-
33
- echo "INSERT INTO users ( login ) VALUES ( 'admin' ) " | psql -h pg -U postgres app_development
@@ -1,31 +0,0 @@
1
- version: "3"
2
- services:
3
- pg:
4
- build:
5
- context: .
6
- dockerfile: Dockerfile.pg
7
- ports:
8
- - "5432"
9
- environment:
10
- POSTGRES_HOST_AUTH_METHOD: trust
11
-
12
- app:
13
- build:
14
- context: .
15
- dockerfile: Dockerfile
16
- image: rails6-app:${RUBY_VERSION}
17
- command:
18
- [ "./bin/rails", "server", "-b", "0.0.0.0", "-u", "webrick" ]
19
- environment:
20
- RAILS_ENV:
21
- ORM_MODULE:
22
- PGHOST: pg
23
- PGPORT: '5432'
24
- DATABASE_URL: postgres://postgres@pg
25
- APPMAP:
26
- volumes:
27
- - .:/src/app
28
- ports:
29
- - "3000"
30
- links:
31
- - pg:pg
@@ -1 +0,0 @@
1
- ruby-3.1.0
@@ -1,30 +0,0 @@
1
- ARG GEM_VERSION
2
- ARG RUBY_VERSION
3
-
4
- FROM appmap:${GEM_VERSION} as appmap
5
- FROM ruby:${RUBY_VERSION}
6
-
7
- SHELL ["/bin/bash", "-c"]
8
-
9
- RUN apt-get update && apt-get install -y vim less
10
- RUN apt-get install -y postgresql-client
11
-
12
- RUN mkdir /app
13
- WORKDIR /app
14
-
15
- RUN gem install -N bundler
16
-
17
- COPY Gemfile .
18
-
19
- RUN bundle
20
-
21
- COPY . .
22
-
23
- COPY --from=appmap /pkg/appmap.gem /tmp/
24
- RUN gem install /tmp/appmap.gem && \
25
- bundle update --local appmap && \
26
- bundle binstubs appmap --force
27
-
28
- EXPOSE 3000
29
-
30
- HEALTHCHECK --interval=1s --retries=10 CMD curl --fail http://localhost:3000/health || exit 1
@@ -1,3 +0,0 @@
1
- FROM postgres:10
2
-
3
- HEALTHCHECK --interval=1s --retries=10 CMD psql -U postgres -c "select 1" || exit 1
@@ -1,86 +0,0 @@
1
- # PostgreSQL. Versions 9.3 and up are supported.
2
- #
3
- # Install the pg driver:
4
- # gem install pg
5
- # On macOS with Homebrew:
6
- # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
- # On macOS with MacPorts:
8
- # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9
- # On Windows:
10
- # gem install pg
11
- # Choose the win32 build.
12
- # Install PostgreSQL and put its /bin directory on your path.
13
- #
14
- # Configure Using Gemfile
15
- # gem "pg"
16
- #
17
- default: &default
18
- adapter: postgresql
19
- encoding: unicode
20
- # For details on connection pooling, see Rails configuration guide
21
- # https://guides.rubyonrails.org/configuring.html#database-pooling
22
- pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
23
-
24
- development:
25
- <<: *default
26
- database: app_development
27
-
28
- # The specified database role being used to connect to postgres.
29
- # To create additional roles in postgres see `$ createuser --help`.
30
- # When left blank, postgres will use the default role. This is
31
- # the same name as the operating system user running Rails.
32
- #username: app
33
-
34
- # The password associated with the postgres role (username).
35
- #password:
36
-
37
- # Connect on a TCP socket. Omitted by default since the client uses a
38
- # domain socket that doesn't need configuration. Windows does not have
39
- # domain sockets, so uncomment these lines.
40
- #host: localhost
41
-
42
- # The TCP port the server listens on. Defaults to 5432.
43
- # If your server runs on a different port number, change accordingly.
44
- #port: 5432
45
-
46
- # Schema search path. The server defaults to $user,public
47
- #schema_search_path: myapp,sharedapp,public
48
-
49
- # Minimum log levels, in increasing order:
50
- # debug5, debug4, debug3, debug2, debug1,
51
- # log, notice, warning, error, fatal, and panic
52
- # Defaults to warning.
53
- #min_messages: notice
54
-
55
- # Warning: The database defined as "test" will be erased and
56
- # re-generated from your development database when you run "rake".
57
- # Do not set this db to the same as development or production.
58
- test:
59
- <<: *default
60
- database: app_test
61
-
62
- # As with config/credentials.yml, you never want to store sensitive information,
63
- # like your database password, in your source code. If your source code is
64
- # ever seen by anyone, they now have access to your database.
65
- #
66
- # Instead, provide the password or a full connection URL as an environment
67
- # variable when you boot the app. For example:
68
- #
69
- # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
70
- #
71
- # If the connection URL is provided in the special DATABASE_URL environment
72
- # variable, Rails will automatically merge its configuration values on top of
73
- # the values provided in this file. Alternatively, you can specify a connection
74
- # URL environment variable explicitly:
75
- #
76
- # production:
77
- # url: <%= ENV["MY_APP_DATABASE_URL"] %>
78
- #
79
- # Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
80
- # for a full overview on how database connection configuration can be specified.
81
- #
82
- production:
83
- <<: *default
84
- database: app_production
85
- username: app
86
- password: <%= ENV["APP_DATABASE_PASSWORD"] %>
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -ex
3
-
4
- # Just checking for a healthy container isn't enough, apparently. If
5
- # we don't wait here, sometimes the database is inaccessible.
6
- for i in {1..10}; do
7
- psql -h pg -U postgres postgres -c 'select 1' >/dev/null 2>&1 && break
8
- printf ' .'
9
- sleep 1
10
- done
11
- echo
12
- out="$(psql -h pg -U postgres postgres -c 'select 1' 2>&1)"
13
- if [[ $? != 0 ]]; then
14
- echo "Postgres didn't start in time:"
15
- echo "$out"
16
- exit 1
17
- fi
18
-
19
- # Required for migrations
20
- export ORM_MODULE=sequel
21
-
22
- set +e
23
- psql -h pg -U postgres -c "drop database if exists app_development"
24
- psql -h pg -U postgres -c "drop database if exists app_test"
25
- set -e
26
-
27
- psql -h pg -U postgres -c "create database app_development"
28
- psql -h pg -U postgres -c "create database app_test"
29
-
30
- env RAILS_ENV=development bundle exec rake -t db:migrate
31
- env RAILS_ENV=test bundle exec rake -t db:migrate
@@ -1,31 +0,0 @@
1
- version: "3"
2
- services:
3
- pg:
4
- build:
5
- context: .
6
- dockerfile: Dockerfile.pg
7
- ports:
8
- - "5432"
9
- environment:
10
- POSTGRES_HOST_AUTH_METHOD: trust
11
-
12
- app:
13
- build:
14
- context: .
15
- dockerfile: Dockerfile
16
- image: rails7-app:${RUBY_VERSION}
17
- command:
18
- [ "./bin/rails", "server", "-b", "0.0.0.0", "-u", "webrick" ]
19
- environment:
20
- RAILS_ENV:
21
- ORM_MODULE:
22
- PGHOST: pg
23
- PGPORT: '5432'
24
- DATABASE_URL: postgres://postgres@pg
25
- APPMAP:
26
- volumes:
27
- - .:/src/app
28
- ports:
29
- - "3000"
30
- links:
31
- - pg:pg