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: bug with skip-current-step #266

Merged
merged 1 commit into from
Dec 1, 2023
Merged

fix: bug with skip-current-step #266

merged 1 commit into from
Dec 1, 2023

Conversation

akorzy-pl
Copy link

We have observed a bug in the skip-current-step action that manifests itself when the current step is Paused due to InconclusiveAnalysisRun. Although executing the action moves the currentStepIndex forward, the rollout remains Paused. We then have to run the resume action to unpause the rollout.

I have found by experimentation that the reason the rollout remains paused is because the skip-current-step action sets obj.status.controllerPause to false. The controllerPause variable is not meant to be modified – it's sufficient to set obj.status.pauseConditions to nil. When pauseConditions is the only variable modified by the action, skip-current-step works properly for us and we don't experience the bug described above.

In addition, the obj.spec.pause = false operation is incorrect, because the rollout specification defines obj.spec.paused (with the letter d). In addition, obj.spec.paused indicates a manual pause (triggered by a user, rather than by the rollout controller) and it's debatable if skip-current-step should resume a manual pause. The resume action can be used for that purpose. I have therefore removed that line entirely.

I have also added an additional if statement that checks if obj.status.pauseConditions is defined and has at least one element. Otherwise the variable isn't touched. This logic is modeled on the resume action.

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.

Please see Contribution FAQs if you have questions about your pull-request.

We have observed a bug in the `skip-current-step` action that manifests itself when the current step is `Paused` due to `InconclusiveAnalysisRun`. Although executing the action moves the `currentStepIndex` forward, the rollout remains `Paused`. We then have to run the `resume` action to unpause the rollout.

I have found by experimentation that the reason the rollout remains paused is because the `skip-current-step` action sets `obj.status.controllerPause` to `false`. The `controllerPause` variable is not meant to be modified – it's sufficient to set `obj.status.pauseConditions` to `nil`. When `pauseConditions` is the only variable modified by the action, `skip-current-step` works properly for us and we don't experience the bug described above.

In addition, the `obj.spec.pause = false` operation is incorrect, because the rollout specification defines `obj.spec.paused` (with the letter `d`). In addition, `obj.spec.paused` indicates a manual pause (triggered by a user, rather than by the rollout controller) and it's debatable if `skip-current-step` should resume a manual pause. The `resume` action can be used for that purpose. I have therefore removed that line entirely. 

I have also added an additional if statement that checks if `obj.status.pauseConditions` is defined and has at least one element. Otherwise the variable isn't touched. This logic is modeled on the `resume` action.
@pasha-codefresh pasha-codefresh changed the title Fix bug with skip-current-step fix: bug with skip-current-step Nov 30, 2023
@pasha-codefresh pasha-codefresh merged commit fd1c1ca into codefresh-io:release-2.8 Dec 1, 2023
9 of 12 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.

3 participants