-
Notifications
You must be signed in to change notification settings - Fork 375
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-app] Fix CI Visibility Spec Tests #1706
Conversation
Co-authored-by: Marco Costa <marco.costa@datadoghq.com>
Codecov Report
@@ Coverage Diff @@
## master #1706 +/- ##
==========================================
- Coverage 98.31% 98.31% -0.01%
==========================================
Files 928 928
Lines 44803 44811 +8
==========================================
+ Hits 44049 44056 +7
- Misses 754 755 +1
Continue to review full report at Codecov.
|
👍 I admit I'm a bit lost with the rest of the changes in this PR. Why do all these fixtures need to be changed to add the mentioned features? Or is this just a "periodic fixture update dump" kind of thing? |
Most of the changed lines are for adding the "user defined git metadata" fixtures. That is, if the user injects certain environment variables, we want them to take precedence over other metadata. Other than that it is:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Do you mind also updating the PR title/description from your comment for easier future reference?
In future PRs, I suggest breaking the changes into distinct commits with individual messages stating what changed, as that makes it much easier to match the code change with the expected fixture change (and to spot when something is missing).
lib/datadog/ci/ext/environment.rb
Outdated
if branch_or_tag.include?('tags/') | ||
if !branch_or_tag.nil? && branch_or_tag.include?('tags/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: This can be branch_or_tag && branch_or_tag.include?(...)
since everything other than nil and false is considered true for an if ("truthy" is what we usually call it).
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['GIT_URL'], | ||
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['GIT_URL'] || env['GIT_URL_1'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Should we also do || env['GIT_URL_2']
? Or is a "URL_1" always present if "URL_2" exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's correct, it's always present.
What does this PR do?
usersupplied.json
fixture file for user defined git metadata.