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

chore: change execute progressive rollout condition #784

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

cre8ivejp
Copy link
Member

@cre8ivejp cre8ivejp commented Feb 2, 2024

Part of #712

Things done

  • Change to enable the flag when the rollout starts (Only if the flag is disabled)
  • Check if the rollout has already stopped before proceeding
  • Refactored the code to update the progressive rollout and the feature flag in the same transaction to avoid race conditions nad unnecessary audit logs
  • Updated tests

This pull request introduces several changes to the pkg/autoops/api/ package in order to improve the handling of progressive rollout status, add checks for stop status, and refactor the code to simplify the logic and improve readability. The changes also include updates to the test suite to reflect these modifications.

Error Handling and Status Checks:

Code Refactoring and Simplification:

  • pkg/autoops/api/progressive_rollout.go: Refactored the ExecuteProgressiveRollout method to use ftstorage.NewFeatureStorage and ftStorage.GetFeature instead of the previous approach. Also added checks for stop status and logic to enable the feature flag if it is disabled and it is the first rollout execution. [1] [2] [3]
  • pkg/autoops/api/progressive_rollout_operation.go: Refactored the ExecuteProgressiveRolloutOperation and related methods to use ftdomain.Feature instead of featureclient.Client. Also simplified the logic to update the rollout strategy. [1] [2]

Test Suite Updates:

Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
@cre8ivejp cre8ivejp force-pushed the chore-pr-execute-condition branch from 0f19b26 to 42c5cca Compare February 2, 2024 05:41
@cre8ivejp cre8ivejp marked this pull request as ready for review February 2, 2024 06:40
Copy link
Contributor

@kentakozuka kentakozuka left a comment

Choose a reason for hiding this comment

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

👍
left a nit

Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
@cre8ivejp cre8ivejp merged commit 06c150c into main Feb 2, 2024
11 checks passed
@cre8ivejp cre8ivejp deleted the chore-pr-execute-condition branch February 2, 2024 07:39
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.

2 participants