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

fix(experiments): fire rollout event on experiment step #4124

Conversation

meeech
Copy link
Contributor

@meeech meeech commented Feb 9, 2025

This fix (feat?) resolves the issue raised in #4009.

I think this meets what users would expect from the use of an Experiment as a Step in a Rollout.

As a user, if I setup notifications on AnalysisRun events, I would expect an AnalysisRun that fails should generate a notification. To be clear, this is ONLY when the Analysis Run belongs to an Experiment, which itself belongs to the Rollout (As a Step in that Rollout). https://argo-rollouts.readthedocs.io/en/stable/features/experiment/#integration-with-rollouts

Please let me know if you would like to discuss this further, but this feels like a 'safe' change. It should even be good to backport to 1.7x (which is what I developed it against).

I could use some guidance around testing this - I didn't see any prior integration test for this code path. But maybe there's some e2e and I wasn't having success finding it.

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.

Signed-off-by: mitchell amihod <[email protected]>
… a Rollout. We can then identify when an experiment is a Step in a Rollout.

Signed-off-by: mitchell amihod <[email protected]>
@meeech meeech force-pushed the 4009-fire-rollout-event-on-experiment-step branch from f8634b0 to 64f8285 Compare February 9, 2025 23:26
Copy link
Contributor

github-actions bot commented Feb 10, 2025

Published E2E Test Results

  4 files    4 suites   3h 9m 58s ⏱️
113 tests 104 ✅  7 💤 2 ❌
458 runs  424 ✅ 28 💤 6 ❌

For more details on these failures, see this check.

Results for commit bd4aa34.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Feb 10, 2025

Published Unit Test Results

2 300 tests   2 300 ✅  2m 59s ⏱️
  128 suites      0 💤
    1 files        0 ❌

Results for commit bd4aa34.

♻️ This comment has been updated with latest results.

@meeech meeech force-pushed the 4009-fire-rollout-event-on-experiment-step branch from 31f99c3 to 7aa0804 Compare February 11, 2025 03:31
@meeech
Copy link
Contributor Author

meeech commented Feb 11, 2025

@zachaller tightened things up a bit.

Signed-off-by: mitchell amihod <[email protected]>
…he Experiment

Addresses argoproj#4009. This change will fire Analysis Run events bound to the parent Rollout object when the Experiment is a Step in the Rollout.

Signed-off-by: mitchell amihod <[email protected]>
If we pass belongs to rollout check, we know there is a rollout to find.

Signed-off-by: mitchell amihod <[email protected]>
@meeech meeech force-pushed the 4009-fire-rollout-event-on-experiment-step branch from 7aa0804 to 2c4dfa0 Compare February 11, 2025 03:48
@meeech meeech force-pushed the 4009-fire-rollout-event-on-experiment-step branch from 2c4dfa0 to bd4aa34 Compare February 11, 2025 04:02
@meeech meeech requested a review from zachaller February 11, 2025 21:43
// #4009
roRef := experimentutil.GetRolloutOwnerRef(ec.ex)
if roRef != nil {
rollout, err := ec.argoProjClientset.ArgoprojV1alpha1().Rollouts(ec.ex.Namespace).Get(context.TODO(), roRef.Name, metav1.GetOptions{})
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am ok leaving this as a client call because the rest of the experiment code does this but it would be nice if we had access to the rollouts informer in experiment controller

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'd be open to making that change (maybe later iteration - i think i will be back in this code later around fixing the complation/delay bug I reported). I wasn't sure about the implications around a changelike that, so I took a light touch.

@zachaller zachaller merged commit a748f05 into argoproj:master Feb 14, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants