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-visibility] Update CI Visibility spec #2874

Merged
merged 4 commits into from
Jun 1, 2023

Conversation

juan-fernandez
Copy link
Contributor

@juan-fernandez juan-fernandez commented May 24, 2023

What does this PR do?

Motivation

Keep up with CI Visibility spec changes

How to test the change?
Unit tests via fixtures.

@github-actions github-actions bot added the ci-app CI product for test suite instrumentation label May 24, 2023
@juan-fernandez juan-fernandez force-pushed the juan-fernandez/update-gitlab-extraction branch from 8c2b36f to 042766d Compare May 26, 2023 08:12
@juan-fernandez juan-fernandez changed the title [ci-visibility] Update gitlab's pipeline URL extraction [ci-visibility] Update CI Visibility spec May 26, 2023
@juan-fernandez juan-fernandez marked this pull request as ready for review May 26, 2023 09:36
@juan-fernandez juan-fernandez requested a review from a team May 26, 2023 09:36
.sort_by { |key| key.length }

if extra_tags.length > 0
tags[TAG_NODE_LABELS] = JSON.generate(extra_tags)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON.generate(extra_tags) and extra_tags.to_json are analogous. Since it looks like we are using to_json in other parts of this file, should we try being consistent and use to_json here as well 😄 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that first, but it seems .to_json does not work for lists. .to_s seems to work but it adds some extra spaces I don't want: maybe there's a workaround?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting

I just did a simple example in irb

require 'json'
=> true
irb(main):002:0> test = ["mytag:my-value", "myothertag:my-other-value"]
=> ["mytag:my-value", "myothertag:my-other-value"]
irb(main):003:0> test.to_json
=> "[\"mytag:my-value\",\"myothertag:my-other-value\"]"

That is what you want, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I messed it up somehow 😆 . I'll change it, thanks

@@ -308,6 +325,11 @@ def extract_jenkins(env)
name = name.gsub("/#{normalize_ref(branch)}", '') if branch
name = name.split('/').reject { |v| v.nil? || v.include?('=') }.join('/')
end

if !env['NODE_LABELS'].nil?
node_labels = JSON.generate(env['NODE_LABELS'].split(' '))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codecov-commenter
Copy link

Codecov Report

Merging #2874 (57895f2) into master (df8612f) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2874   +/-   ##
=======================================
  Coverage   98.09%   98.09%           
=======================================
  Files        1269     1264    -5     
  Lines       69969    69941   -28     
  Branches     3161     3162    +1     
=======================================
- Hits        68633    68607   -26     
+ Misses       1336     1334    -2     

see 25 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@GustavoCaso GustavoCaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@juan-fernandez juan-fernandez merged commit 9bebd8c into master Jun 1, 2023
202 checks passed
@juan-fernandez juan-fernandez deleted the juan-fernandez/update-gitlab-extraction branch June 1, 2023 09:20
@github-actions github-actions bot added this to the 1.12.0 milestone Jun 1, 2023
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.

None yet

3 participants