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

Add hanami app to integration CI configurations #3639

Merged
merged 13 commits into from
Jun 6, 2024

Conversation

p-datadog
Copy link
Contributor

@p-datadog p-datadog commented May 10, 2024

l

What does this PR do?

Adds hanami to CI configurations, as requested in #2546.

Several things needed to be fixed for the tests to pass:

  1. Fix hanami integration app dependencies #2546
  2. There was an empty hanami.rb which looks to have been intended to mock Hanami framework (?). The app requires the actual hanami framework to function and this empty file was loaded instead of hanami itself. I removed the file.
  3. Hanami integration app was missing unicorn configuration, which the test suite was expecting. I copied it from sinatra.
  4. The controller in the test app was written to fail 50% of the time, presumably to provide an environment to test failure. I commented out the failure generation so that CI would pass every time.

I also made the image build script work when ruby version isn't given and to provide a help message so that someone new to this area of the code could actually get it running locally.

Motivation:

Review of #2546.

Test plan
The tests are running on Ruby 2.6 and 2.7 only. Hanami 1 (1.3.5, more exactly) that is currently being used in these tests is not compatible with Ruby 3.

@p-datadog p-datadog requested a review from a team as a code owner May 10, 2024 16:47
@github-actions github-actions bot added the dev/ci Involves CircleCI, GitHub Actions, or GitLab label May 10, 2024
@p-datadog p-datadog marked this pull request as draft May 10, 2024 16:47
@github-actions github-actions bot removed the dev/ci Involves CircleCI, GitHub Actions, or GitLab label May 13, 2024
p added 3 commits June 4, 2024 11:57
* master: (22 commits)
  Remove experimental warning from OpenTelemetry.md
  Remove latest tag on docker images
  add installer system tests
  Extract trace id format helper method (DataDog#3670)
  Remaps http status code tag for otel span for trace metrics (DataDog#3664)
  Update .github/labeler.yml
  Use 3.20
  rb -> ruby
  Add a note about `use` vs `instrument`
  GitHub: Update labeller bot with new products
  Update lockfiles for release 2.0.0.rc1
  Bump version 2.0.0.beta2 to 2.0.0.rc1
  Add 2.0.0.rc1 to CHANGELOG.md
  chore(lib-injection): update base image to alpine 3.18.6
  Apply suggestions from code review
  Revert "DEBUG-2334 Add Debugger component (DataDog#3640)"
  Implement `latest_major` and `lastest_minor` tag for docker init container (DataDog#3643)
  Build oci package
  Update `rexml`  (DataDog#3656)
  Remove bundler cache in for `setup-ruby` step and pin bundler and rubygem version
  ...
* master:
  Add missing Apache 2.0 license from gemspec
  Use ffi 1.16.3
  Add platform
  Output gem version
  Output debug logs
  Fix spec to exclude .vscode directory
  Fix docker run command
  Add vscode settings for dockerfile file associations
  Update gem version
  Update gemfiles/*
  Update `ffi` in Gemfile
This file appears to be loaded by `require 'hanami'`
and overrides actual Hanami code, making the integration application
unusable when it uses Hanami.
p added 4 commits June 6, 2024 10:10
Due to `set -u`, if a ruby version is not specified to build-images,
the script fails at the attempt to check if it's empty.
Initialize the variable to the empty value to get the intended behavior.
The tests attempt to invoke hanami with unicorn, but the
unicorn configuration for hanami was missing resulting in failure.
* master:
  Update lockfiles for release 2.0.0
  Bump version 2.0.0.rc1 to 2.0.0
  Add 2.0.0 to CHANGELOG.md
@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.11%. Comparing base (ae63482) to head (d397cfc).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3639   +/-   ##
=======================================
  Coverage   98.10%   98.11%           
=======================================
  Files        1225     1225           
  Lines       72522    72522           
  Branches     3446     3446           
=======================================
+ Hits        71151    71152    +1     
+ Misses       1371     1370    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@p-datadog p-datadog marked this pull request as ready for review June 6, 2024 18:22
@p-datadog
Copy link
Contributor Author

I ran all of the tests in #3690.

@p-datadog p-datadog merged commit b3c5a3d into DataDog:master Jun 6, 2024
178 checks passed
@p-datadog p-datadog deleted the hanami-ci branch June 6, 2024 20:55
p-datadog pushed a commit to MITSUBOSHI/dd-trace-rb that referenced this pull request Jun 6, 2024
* master: (34 commits)
  Add hanami app to integration CI configurations (DataDog#3639)
  Update UpgradeGuide in README.md
  Update lockfiles for release 2.0.0
  Bump version 2.0.0.rc1 to 2.0.0
  Add 2.0.0 to CHANGELOG.md
  Add missing Apache 2.0 license from gemspec
  Use ffi 1.16.3
  Add platform
  Output gem version
  Output debug logs
  Fix spec to exclude .vscode directory
  Fix docker run command
  Add vscode settings for dockerfile file associations
  Update gem version
  Update gemfiles/*
  Update `ffi` in Gemfile
  Remove experimental warning from OpenTelemetry.md
  Remove latest tag on docker images
  add installer system tests
  Extract trace id format helper method (DataDog#3670)
  ...
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.

4 participants