refactor(artifacts): consolidate artifacts feature flags checks #8096
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to: spinnaker/governance#111
The
artifacts
andartifactsRewrite
flags were intended to be mutually exclusive, but it is possible that this was not fully thought through, as there are several workflows (Find Artifact from Resource stage, Find Artifact from Execution stage) that currently require both flags to be enabled in order to use with the new UI. This PR addresses that bug and consolidates the artifacts feature flag checks to a single service.refactor(artifacts): consolidate artifacts feature flags checks
Adds
ArtifactsModeService
, which is responsible for the mapping between the four possible feature flag configuration states and the three possible UI experiences. Replaces each instance of logic conditional on one or both artifacts feature flags with logic conditional on the UI experience to which they map.fix(artifacts): enable artifact-specific stages when only
artifactsRewrite
feature flag is enabledRegister the Find Artifact from Resource stage and Find Artifact from Execution stage if at least one of the two existing artifacts feature flags is enabled.
Pending a successful audit of the
STANDARD
UI experience, we will:DISABLED
experience (1.20).artifacts
andartifactsRewrite
feature flags (1.20).STANDARD
experience unless a new, temporarylegacyArtifacts
flag is enabled (1.20).LEGACY
experience andlegacyArtifacts
flag. With only theSTANDARD
experience remaining, we can remove theArtifactsModeService
and all conditional calling code (1.21).