Skip to content

feat(workflow): add digest-bearing image publication workflows#17

Merged
josh-tracey merged 35 commits into
mainfrom
experiment/runkernel
Jul 15, 2026
Merged

feat(workflow): add digest-bearing image publication workflows#17
josh-tracey merged 35 commits into
mainfrom
experiment/runkernel

Conversation

@josh-tracey

@josh-tracey josh-tracey commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

PR #17 implements:

  • Typed image publication planning, provenance, and mandatory digests
  • Non-mutating push planning
  • Protected, immutable image push execution
  • Target-neutral provenance data foundation

Non-Goals for this PR:

  • GitOps write-backs
  • Argo CD API or app syncs
  • Direct cluster reconciliation or applies
  • Rollbacks

Stage 1: image publication contract

Status: complete

Includes:

  • ImagePushPlanItem
  • PublishedImageArtifact
  • ImageProvenance
  • validated image push plans
  • image report plumbing
  • digest-bearing image references

Stage 2: ci-build-push-plan

Status: complete

Includes:

  • non-mutating push planning
  • workflow:push-plan
  • image_push_plan in workflow reports
  • plan/graph/explain support

Stage 3: ci-build-push

Status: complete

Includes:

  • protected image push workflow
  • CI external approval requirement
  • registry authentication
  • mandatory digest capture
  • runtime artifact reports
  • GitHub Actions, CircleCI, and Travis guidance
  • source revision evidence for every actual publication

Provenance policy:

  • all actual image publications require source revision evidence
  • plan-only workflows may omit source revision evidence

Stage 3.5: external repository validation

Status: tracked separately

Separate pilot goals:

  • run Sailr from an external application repo
  • validate CircleCI and another CI provider
  • build and push a real application image
  • produce a digest-bearing report
  • remove repository-specific assumptions

Stage 4: target-neutral promotion planning

Status: follow-up PR

Goals:

  • consume a published image artifact report
  • plan promotion between environments
  • resolve a deployment target
  • produce a non-mutating desired-state diff
  • avoid Argo CD-specific core abstractions

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sailr Ready Ready Preview, Comment Jul 12, 2026 5:27pm

@josh-tracey josh-tracey changed the title wip: add workflow - image build, push, and promotion draft: add image build, push, and promotion workflows Jul 8, 2026
Adds a safe, non-mutating stage for planning image pushes. Introduces the ImagePushPlan model and wiring in the WorkflowPlanner. Verifies safe step configurations for profiles.
Replace the intermediate ImagePushPlan/ImagePushPlanReport indirection
with a flat ImagePushPlanReport that owns environment, mutates_registry,
and a vec of ImagePushPlanItem (with action, image_ref fields).
- Rename WorkflowPlan.push_plan to image_push_plan (ImagePushPlanReport)
- Compute ImagePushPlanReport during planning, attach to WorkflowPlan
- Write image_push_plan into JSON report via write_workflow_report
- Add render_image_push_plan_text for CLI output
- Add ImageArtifact::from_push_plan_item helper
- Fix tests: set profile.name manually (field is #[serde(skip)])
- Use tempdir in runner report test to avoid project-dir side effects
…tion

This commit implements the first registry-mutating workflow, `ci-build-push`, proving that Sailr can safely build, push, and capture immutable image artifacts in a CI pipeline.

Key changes:
- **Profiles**: Added `ci-build-push` profile to `sailr.workflow.toml` and `default_config.toml` configured with `push=run` and `apply=true`.
- **Registry Configs**: Refactored `Environment.registry` to parse either a string or a detailed `RegistryConfig`, enabling dynamic namespace configuration instead of relying on hardcoded defaults.
- **Push Execution**: Generated `ServicePush` and `ImageReport` tasks in `planner.rs` to orchestrate `docker push`.
- **Digest Capture**: Implemented `parse_pushed_digest` for safe, regex-free substring scanning to capture immutable image digests from Docker output.
- **Workflow Accumulator**: Introduced the Sailr-owned `WorkflowReportAccumulator` to securely collect pushed `ImageArtifact` records at runtime and plumb them back into the final JSON execution report without polluting `runkernel`.
- **Safety Gates**: Enforced strict safety validations in `runner.rs`, mandating `--apply` and `approval=external` to execute `push=run`.
- **Workflows**: Added a manual `.github/workflows/image-push.yml` GitHub action to test the pipeline.

Implements Stage 3 of PR #17.
@josh-tracey josh-tracey changed the title draft: add image build, push, and promotion workflows feat(workflow): add digest-bearing image publication workflows Jul 12, 2026
- Fix test environments to pass RegistryConfig.host() checks
- Refactor test_write_workflow_report to JSON fixture validation
- Resolve identical blocks, unused mut, and unused field assignments flagged by clippy
- Expand inspect() to correctly surface image target refs and resolved registry
Refactor finalizer lifecycle into discrete BeforeReport and ReportSink phases.
This guarantees all runtime logic, like writing build caches, completes prior
to generating the workflow report, preventing side-effects from missing the
report status or hiding failures.

Success logic is unified: pipeline failure OR finalizer failure halts execution
and results in a failed workflow run. Tests have been updated to reflect the new
WorkflowReportFinalizers representation without altering older fixtures directly.
@josh-tracey
josh-tracey marked this pull request as ready for review July 12, 2026 20:12
@josh-tracey
josh-tracey merged commit 9d62fce into main Jul 15, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant