Skip to content

Commit

Permalink
Add feature flag for adding application name into the github status c…
Browse files Browse the repository at this point in the history
…ontext
  • Loading branch information
dbrougham committed Nov 7, 2021
1 parent 1acd51f commit d143845
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ public void sendNotifications(
String.format(
"Stage '%s' in pipeline '%s' is %s",
content.getStageName(), content.getPipeline(), status);
context = String.format("stage/%s", content.getStageName());
context =
this.hasApplicationNameInContext
? String.format(
"%s/%s/stage/%s", application, content.getPipeline(), content.getStageName())
: String.format("stage/%s", content.getStageName());
targetUrl =
String.format(
"%s/#/applications/%s/executions/details/%s?pipeline=%s&stage=%d",
Expand All @@ -91,7 +95,10 @@ public void sendNotifications(
content.getStageIndex());
} else if (config.get("type").equals("pipeline")) {
description = String.format("Pipeline '%s' is %s", content.getPipeline(), status);
context = String.format("pipeline/%s", content.getPipeline());
context =
this.hasApplicationNameInContext
? String.format("%s/pipeline/%s", application, content.getPipeline())
: String.format("pipeline/%s", content.getPipeline());
targetUrl =
String.format(
"%s/#/applications/%s/executions/details/%s?pipeline=%s",
Expand Down Expand Up @@ -172,4 +179,7 @@ public void setToken(String token) {

@Value("${github-status.token}")
private String token;

@Value("${github-status.hasApplicationNameInContext}")
private boolean hasApplicationNameInContext;
}

0 comments on commit d143845

Please sign in to comment.