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-app] Fix CI Visibility Spec Tests #1706

Merged
merged 9 commits into from
Oct 5, 2021

Conversation

juan-fernandez
Copy link
Contributor

@juan-fernandez juan-fernandez commented Sep 30, 2021

What does this PR do?

@juan-fernandez juan-fernandez marked this pull request as ready for review September 30, 2021 13:58
@juan-fernandez juan-fernandez requested a review from a team September 30, 2021 13:58
@marcotc marcotc added the ci-app CI product for test suite instrumentation label Oct 4, 2021
Co-authored-by: Marco Costa <marco.costa@datadoghq.com>
@codecov-commenter
Copy link

codecov-commenter commented Oct 5, 2021

Codecov Report

Merging #1706 (a6d56bf) into master (b1bd0c0) will decrease coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
lib/datadog/ci/ext/environment.rb 98.85% <88.88%> (-0.55%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1bd0c0...a6d56bf. Read the comment docs.

@ivoanjo
Copy link
Member

ivoanjo commented Oct 5, 2021

thanks! We did it, it looks like :-)

👍 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?

@juan-fernandez
Copy link
Contributor Author

juan-fernandez commented Oct 5, 2021

thanks! We did it, it looks like :-)

👍 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:

Copy link
Member

@ivoanjo ivoanjo left a 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).

Comment on lines 450 to 457
if branch_or_tag.include?('tags/')
if !branch_or_tag.nil? && branch_or_tag.include?('tags/')
Copy link
Member

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).

Comment on lines -260 to +267
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['GIT_URL'],
Datadog::Ext::Git::TAG_REPOSITORY_URL => env['GIT_URL'] || env['GIT_URL_1'],
Copy link
Member

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?

Copy link
Contributor Author

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.

@juan-fernandez juan-fernandez merged commit 735404e into master Oct 5, 2021
@juan-fernandez juan-fernandez deleted the juan-fernandez/ci-app-fix-spec branch October 5, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-app CI product for test suite instrumentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants