Skip to content

Commit

Permalink
feature(actifacts): added feature flag for trigger and expected artif…
Browse files Browse the repository at this point in the history
…acts
  • Loading branch information
nemesisOsorio committed May 21, 2024
1 parent df8541f commit 7129b66
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import rx.schedulers.Schedulers;

Expand All @@ -65,6 +66,9 @@ public class ArtifactUtils {
private final ExecutionRepository executionRepository;
private final ContextParameterProcessor contextParameterProcessor;

@Value("${trigger.expected-artifacts-legacy-behavior:false}")
private boolean filterExpectedArtifactsForTriggers;

@Autowired
public ArtifactUtils(
ObjectMapper objectMapper,
Expand Down Expand Up @@ -212,7 +216,8 @@ public void resolveArtifacts(Map pipeline) {
.map(it -> objectMapper.convertValue(it, ExpectedArtifact.class))
.filter(
artifact ->
expectedArtifactIds.contains(artifact.getId())
filterExpectedArtifactsForTriggers
|| expectedArtifactIds.contains(artifact.getId())
|| artifact.isUseDefaultArtifact()
|| artifact.isUsePriorArtifact())
.collect(toImmutableList());
Expand Down

0 comments on commit 7129b66

Please sign in to comment.