Skip to content

Latest commit

History

1,417 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

cascade-example-primary

A worked example of a cross-repo primary managed by cascade. This repository runs its own two-environment promotion pipeline (staging then prod) while also coordinating artifacts produced in two separate source repositories.

What This Repository Shows

This primary integrates with two source repositories using the two cross-repo mechanisms cascade provides:

MechanismHow it works here
Synchronous reusable callbackThe sharedlib build calls a reusable workflow that lives in cascade-example-artifact-a (uses: ...build-shared.yaml@main). Its artifact_id output is captured during the orchestrate run.
Asynchronous External UpdateAfter each source builds, it dispatches this repo's external-update.yaml. cascade writes {deploy_name, sha, version, artifacts} into the shared manifest under state.<env>.external.<name>.

The external block in .github/manifest.yaml declares both sources:

  • cascade-example-artifact-a -> deploy name artifact-a
  • cascade-example-artifact-b -> deploy name artifact-b

A shared-manifest concurrency guard (cancel_in_progress: false) serializes manifest writes so that two sources updating at the same time never lose an update.

Layout

PathPurpose
.github/manifest.yamlPipeline definition (envs, builds, deploys, external block, release_token).
.github/workflows/orchestrate.yamlGenerated. Builds and deploys to staging on every trunk commit.
.github/workflows/promote.yamlGenerated. Promotes staging to prod and publishes the release.
.github/workflows/external-update.yamlGenerated. Absorbs source updates into the shared manifest.
.github/workflows/build-app.yaml, deploy-app.yamlLocal callbacks for this repo's own application.
.github/workflows/deploy-artifact-a.yaml, deploy-artifact-b.yamlLocal callbacks tracking each external source.
.github/workflows/scenario-suite.yamlEnd-to-end driver that validates the full cross-repo flow.

Getting Started

Prerequisites

  • A CASCADE_STATE_TEST_TOKEN repository secret with contents: write and actions: write scope (the latter lets the source repos dispatch this repo's External Update workflow).

Triggering Pipelines

Push a change under src/** to start the orchestrate run, build the matrix, call the external sharedlib callback, and deploy to staging. When staging is verified, run Actions -> Promote to publish to prod.

What the Test Driver Validates

.github/workflows/scenario-suite.yaml runs weekly (and on demand) and asserts:

JobValidates
resetManifest state resets cleanly.
merge-and-buildOrchestrate runs, the synchronous external callback to artifact-a fires, staging is populated, and a prerelease is created.
external-update-concurrentartifact-a and artifact-b dispatch External Update at the same time; both {sha, version} land under state.staging.external.* with no loss.
promote-stagingprod is populated, the release is published, and external source state survives the promote.

About

Cascade example: cross-repo primary with External Update and external workflow callbacks.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors