Skip to content

Commit

Permalink
Merge branch 'master' into improve-test-around-waitForManifestStableTask
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarulg authored Feb 26, 2025
2 parents 2379b03 + 6b45278 commit 377e07a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
# Given a tag, determine what branch we are on, so we can bump dependencies in the correct branch
- name: Get Branch
run: |
BRANCHES=$(git branch -r --contains ${{ github.ref }})
BRANCHES=$(git branch -r --contains ${{ github.ref }} | grep -v 'HEAD')
echo "BRANCHES is '${BRANCHES}'"
# Check for no branches explicitly...Otherwise echo adds a newline so wc thinks there's
# one branch. And echo -n makes it appears that there's one less branch than there
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fiatVersion=1.53.0
fiatVersion=1.54.0
korkVersion=7.251.0
kotlinVersion=1.6.21
org.gradle.parallel=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,22 @@ public boolean processExpressions(

@Override
public void afterStages(@Nonnull StageExecution stage, @Nonnull StageGraphBuilder graph) {
TrafficManagement trafficManagement =
stage.mapTo("/trafficManagement", TrafficManagement.class);
if (trafficManagement.isEnabled()) {
switch (trafficManagement.getOptions().getStrategy()) {
case RED_BLACK:
case BLUE_GREEN:
oldManifestActionAppender.deleteOrDisableOldManifest(stage.getContext(), graph);
break;
case HIGHLANDER:
oldManifestActionAppender.disableOldManifest(stage.getContext(), graph);
oldManifestActionAppender.deleteOldManifest(stage.getContext(), graph);
break;
case NONE:
// do nothing
if (stage.getContext().get("trafficManagement") != null) {
TrafficManagement trafficManagement =
stage.mapTo("/trafficManagement", TrafficManagement.class);
if (trafficManagement.isEnabled()) {
switch (trafficManagement.getOptions().getStrategy()) {
case RED_BLACK:
case BLUE_GREEN:
oldManifestActionAppender.deleteOrDisableOldManifest(stage.getContext(), graph);
break;
case HIGHLANDER:
oldManifestActionAppender.disableOldManifest(stage.getContext(), graph);
oldManifestActionAppender.deleteOldManifest(stage.getContext(), graph);
break;
case NONE:
// do nothing
}
}
}
if (shouldRemoveStageOutputs(stage)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ void rolloutStrategyDisabled() {
assertThat(getAfterStages(stage)).isEmpty();
}

@Test
void rolloutStrategyMissing() {
StageExecutionImpl stage = new StageExecutionImpl();
stage.setContext(getContext(DeployManifestContext.builder().build()));
stage.getContext().remove("trafficManagement");
assertThat(getAfterStages(stage)).isEmpty();
}

@Test
void rolloutStrategyRedBlack() {
givenManifestIsStable();
Expand Down

0 comments on commit 377e07a

Please sign in to comment.