fix(codepipeline): handle legacy pipelines without versions (#3677)

Co-authored-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
This commit is contained in:
XuJianandxujiantop-crypto authored and GitHub committed 2026-09-15 13:53:31 -04:00
1 parent 0962adaf23
commit 374b80eb65
2 files changed
+71 -2

No files matched your search

@@ -381,8 +381,9 @@ public class CodePipelineService {
private ObjectNode getPipelineResponse(JsonNode request, String region, String account) {
CodePipelinePipeline pipeline = requirePipeline(account, region, text(request, "name"));
int version = request.path("version").asInt(pipeline.getVersion());
if (version != pipeline.getVersion()) {
int currentVersion = pipeline.getVersion() == null ? 1 : pipeline.getVersion();
int version = request.path("version").asInt(currentVersion);
if (version != currentVersion) {
throw new AwsException("PipelineVersionNotFoundException",
"Pipeline version not found: " + version, 400);
}