Commit Graph
13 Commits
Author SHA1 Message Date
Daniël van Ziel f6d67461d2 fix(codepipeline): guard worker polling intervals (#6274) 2026-10-26 07:31:28 -04:00
Daniël van Ziel 74124690b8 fix(codepipeline): stop superseded workers at stage boundaries (#5723)
* fix(codepipeline): stop superseded workers at stage boundaries

* fix(codepipeline): address supersession timing review feedback

Supersede older waiters only at catch-up, persist stable admission ordering for timestamp ties, consolidate failure handling, and place the documentation under Execution.

Local focused validation: 51 tests, four additional checks including the real timestamp-collision reproduction, Checkstyle, and docs checks. Legacy equal-time executions without an ordinal remain conservatively unordered.

* test(codepipeline): consolidate review regression fixtures

Preserve review regression assertions in the shared service fixture, remove private-service reflection, expose waitForTransition to package tests, and shorten user documentation.

Independent exact-candidate QA: 51 focused tests, Checkstyle and docs checks, five supplemental edge/control cases and reverse-arrival rerun. Production method body is unchanged.

* test(codepipeline): configure worker polling for fast tests

Let tests configure a 5 ms worker-poll interval while preserving all existing/default production constructors at 100 ms and independent source scheduling.

Independent exact-candidate QA: 53 focused tests, Checkstyle/docs, repeated diagnostic timings and four supplemental JFR/behavior cases. No timing threshold or production-default change.

* fix(codepipeline): configure worker and assertion polling

Address maintainer feedback with the exact independently reviewed local candidate. Focused affected-area checks passed; remote CI and maintainer acceptance remain outstanding.
2026-10-21 20:58:20 -04:00
Sam Fakhreddine f661923faf feat(codepipeline): roll back a single stage from a successful target execution (#4618)
* feat(codepipeline): roll back a single stage from a successful target execution

RollbackStage now validates the stage and target, then re-runs only the source stages and the target stage as a ROLLBACK execution.

* fix(codepipeline): keep a rollback's stage filter across restart and retry

Persist the rolled-back stage name and derive the include-stages filter from it on start, resume and retry.

* fix(codepipeline): tighten RollbackStage eligibility, trigger type, events and source pinning

* fix(codepipeline): report a busy pipeline from RollbackStage as ConflictException

* fix(codepipeline): refuse rollbacks of source stages, rollback targets and running stages

RollbackStage now answers UnableToRollbackStageException when the stage is a source stage, when the target execution is itself a ROLLBACK execution, or when another execution is still running the stage, per the CodePipeline User Guide considerations for rollbacks.

* fix(codepipeline): reject RollbackStage on PARALLEL pipelines and close the concurrent rollback window

RollbackStage now answers ValidationException for PARALLEL pipelines, checks for a running stage (including a rollback still fetching sources) under the pipeline start lock, records the manual-start triggerDetail instead of the target id, and shares one source-action helper.
2026-10-07 15:54:47 -04:00
Sam Fakhreddine 4c22aaad2e feat(codepipeline): evaluate V2 stage conditions and rules (#4617)
* feat(codepipeline): evaluate V2 stage conditions and rules

Evaluates beforeEntry/onSuccess conditions with VariableCheck and LambdaInvoke rules, records rule executions, and supports OverrideStageCondition.

* fix(codepipeline): bound MATCHES evaluation time and guard rule records and overrides against races

MATCHES: match against a deadline-checked CharSequence so a backtracking pattern fails the rule after 1s instead of hanging the run.
Rule records: mutate and serialize them under the execution lock, and build ListRuleExecutions from a locked snapshot.
OverrideStageCondition: when the run has failed on the condition but not yet left activeRuns, wait (bounded, outside the lock) so the override resumes it.

* fix(codepipeline): harden V2 stage conditions after review

Honor SKIP only before entry, resolve declared variable defaults, fail
rules on unresolved variable references, reject overrides after a pipeline
change, surface a busy-run override as a conflict, hide internal condition
state from GetPipelineExecution, and use the DeploymentWindow provider name.

* fix(codepipeline): keep an accepted stage-condition override when another waiter times out

* fix(codepipeline): reject stale OverrideStageCondition with ConditionNotOverridableException

* refactor(codepipeline): share the busy ConflictException across its four throw sites

* refactor(codepipeline): inject the override test hooks through the constructor

* fix(codepipeline): emit no stage events for a stage skipped by beforeEntry
2026-10-03 14:36:40 -04:00
Sam Fakhreddine a833551d03 feat(codepipeline): emit EventBridge state-change events and SNS approval notifications (#4616)
* feat(codepipeline): emit EventBridge state-change events and SNS approval notifications

Publishes pipeline, stage, and action execution state changes to the default bus and notifies NotificationArn topics for manual approvals.

* fix(codepipeline): match the approval message and event timestamps to the user guide

Mint the pipeline ARN with AwsArnUtils.Arn.of, publish the approval notification as the pipeline's account, emit expires and start-time as ISO-8601, add externalEntityLink, drop the dead console links, truncate the SNS subject to 100 characters, and use warnv.

* fix(codepipeline): restore the approval console links and keep event timestamp precision

consoleLink and approvalReviewLink point at the AWS console URLs from the user guide, expires is to the minute, and start-time keeps its milliseconds. Terminal event dispatch uses switch expressions.
2026-10-02 11:53:44 -04:00
Sam Fakhreddine bcf1045536 feat(codepipeline): execute ThirdParty GitHub version 1 source actions (#4615)
* feat(codepipeline): execute ThirdParty GitHub version 1 source actions

Downloads the configured branch archive from codeload.github.com and republishes it with the repo at the artifact root, keeping unix modes and symlinks; zip entries decode as STORED or DEFLATED only, avoiding the ZSTD/XZ dispatch path that breaks the native build.

* fix(codepipeline): bound GitHub source archive size and reject escaping entries

Cap download, uncompressed bytes and entry count; reject escaping paths and symlinks; end the Inflater.

* refactor(codepipeline): use explicit types and imports in the GitHub source, fix its symlink comment

Rename the test class to the *ServiceTest convention and correct the invalid-ref error message, which claimed the branch cannot contain slashes.

* fix(codepipeline): report the GitHub commit as the source revision and harden the GitHub source

Only the ThirdParty version 1 GitHub action takes the codeload path, so a custom action named GitHub still reaches its worker. The revision is the commit SHA from the archive comment, recorded in sourceRevisions as well. Branch segments are percent-encoded, entry checksums are verified, and the archive caps drop to 128 MiB to keep the heap bounded.

* test(codepipeline): wait on state with Awaitility and order imports in the GitHub source test

* refactor(codepipeline): make GitHub source limits final behind overridable accessors

Archive size, entry and base URL settings move from mutable fields to protected accessors that tests override. Also reject archive entries with a leading slash instead of treating it as the top-level separator.
2026-10-01 13:00:50 -04:00
Priamo Germosen 70df224189 test(codepipeline): make the S3 source poll interval configurable so the negative tests wait less (#4236) 2026-09-24 17:37:36 -05:00
Franklin G. Mendoza 02ad6aa768 fix(codepipeline): resolve effective source revisions (#3514) 2026-09-24 13:30:42 -04:00
Franklin G. Mendoza 196d1586da fix(codepipeline): retry failed stages in place (#3513) 2026-09-24 07:17:04 -04:00
Franklin G. Mendoza ffd2488f02 fix(codepipeline): poll S3 source changes (#3525)
* fix(codepipeline): poll S3 source changes

* fix(codepipeline): serialize source polling baselines
2026-09-14 10:11:15 -04:00
Niels Kootstra 2104b33ea7 fix(codepipeline): cap QUEUED and PARALLEL pipelines at 50 active executions (#3503)
AWS allows at most 50 concurrent executions per QUEUED or PARALLEL
pipeline. StartPipelineExecution now counts the pipeline's InProgress
and Stopping executions under a per-pipeline admission lock and returns
ConcurrentPipelineExecutionsLimitExceededException at the limit. The
admission lock is separate from the monitor a QUEUED worker holds for
its whole run, so a start never waits for the running execution.

A start that reaches the executor after shutdown is persisted as Failed
and returns ConflictException instead of leaking
RejectedExecutionException. Shutdown waits up to five seconds for
execution workers to stop so their final status writes complete before
the process exits.
2026-09-12 14:25:07 -04:00
Sam Fakhreddine a155e66b15 feat(codepipeline): validate ListPipelineExecutions filters and PutApprovalResult inputs (#2696)
* feat: tighten CodePipeline P0 operation contracts

* fix(codepipeline): reject malformed filters and stop stranding approvals on rename

- ListPipelineExecutions: reject non-string succeededInStage.stageName,
  unknown filter/succeededInStage members, and non-integer maxResults
  instead of silently coercing them.
- PutApprovalResult: reject non-string result.summary instead of
  coercing it, and split the "result is required" error from a
  clearer "result must be an object" error for wrong-typed payloads.
- PutApprovalResult: look up the pending approval by token across the
  execution's own captured stage/action names before consulting the
  pipeline's current declaration, so renaming or removing a stage or
  action via UpdatePipeline no longer strands an in-flight approval
  behind a StageNotFoundException/ActionNotFoundException.
- Replace fixed Thread.sleep(100) waits in
  CodePipelineIntegrationTest with polling helpers
  (waitForApprovalToken/waitForApprovalStatus) matching the existing
  waitForJob/waitForExecution pattern, removing test flakiness.
2026-08-28 22:11:07 -04:00
kotov228 3f314dcb4e feat(codepipeline): add AWS CodePipeline emulation (#1469)
* feat(codepipeline): add AWS CodePipeline emulation

* fix(codepipeline): align webhook and rollback response shapes
2026-06-21 09:01:44 -05:00