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

feat(analysis): Adds rollout Spec.Selector.MatchLabels to AnalysisRun. Fixes #2888 #2903

Merged
merged 8 commits into from
Aug 10, 2023

Conversation

gnunn1
Copy link
Contributor

@gnunn1 gnunn1 commented Jul 22, 2023

fixes: #2888

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional with a list of types and scopes found here, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I've signed my commits with DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My builds are green. Try syncing with master if they are not.
  • My organization is added to USERS.md.

This is a small change to add the rollout matchLabels to the AnalysisRun when created as per the linked issue.

Note that I am not a golang developer, even though it's a tiny chnage that I've tested locally it's possible I've missed things so feel free to give me feedback and I'm happy to modify as needed. I'm also not sure how/were a unit test for this would need to be created as I'm not seeing existing tests for labels in analysis_test.go that I could use as a reference, happy to take feedback on that as well if one is needed.

@codecov
Copy link

codecov bot commented Jul 22, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (f5088fe) 81.74% compared to head (8484c9b) 81.74%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2903   +/-   ##
=======================================
  Coverage   81.74%   81.74%           
=======================================
  Files         134      134           
  Lines       20367    20370    +3     
=======================================
+ Hits        16649    16652    +3     
  Misses       2861     2861           
  Partials      857      857           
Files Changed Coverage Δ
rollout/analysis.go 81.12% <100.00%> (+0.16%) ⬆️

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2023

Go Published Test Results

2 040 tests   2 040 ✔️  2m 41s ⏱️
   118 suites         0 💤
       1 files           0

Results for commit 8484c9b.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2023

E2E Tests Published Test Results

    4 files      4 suites   3h 32m 44s ⏱️
102 tests   91 ✔️   6 💤   5
424 runs  384 ✔️ 24 💤 16

For more details on these failures, see this check.

Results for commit 8484c9b.

♻️ This comment has been updated with latest results.

@@ -460,6 +460,11 @@ func (c *rolloutContext) newAnalysisRunFromRollout(rolloutAnalysis *v1alpha1.Rol
for k, v := range rolloutAnalysis.AnalysisRunMetadata.Labels {
run.Labels[k] = v
}

for k, v := range c.rollout.Spec.Selector.MatchLabels {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think taking the labels on the rollout object vs the MatchLabels probably make more sense and follows what we do with ReplicaSets, with RS we take the pod template labels and put them on the RS as labels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @zachaller, I'll have a look at the RS code and follow the same practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay, as requested updated to use template labels.

@zachaller zachaller changed the title feat(analysis): Adds rollout matchLabels to AnalysisRun. Fixes #2888 feat(analysis): Adds rollout labels to AnalysisRun. Fixes #2888 Aug 9, 2023
@sonarcloud
Copy link

sonarcloud bot commented Aug 10, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
7.7% 7.7% Duplication

@zachaller zachaller changed the title feat(analysis): Adds rollout labels to AnalysisRun. Fixes #2888 feat(analysis): Adds rollout Spec.Selector.MatchLabels to AnalysisRun. Fixes #2888 Aug 10, 2023
@zachaller zachaller merged commit 0b81ca2 into argoproj:master Aug 10, 2023
23 checks passed
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.

Add Rollout match selector label to AnalysisRuns
2 participants