Skip to content

Adopt two-phase CI/CD with PR smoke builds and opt-in publish - #99

Merged
ptr727 merged 6 commits into
mainfrom
develop
Jun 4, 2026
Merged

Adopt two-phase CI/CD with PR smoke builds and opt-in publish#99
ptr727 merged 6 commits into
mainfrom
develop

Conversation

@ptr727

Copy link
Copy Markdown
Owner

Release merge of develop into main.

Headline change (#98, closes#97)

Two-phase CI/CD that decouples merging from publishing across all four delivery targets (Docker, NuGet, PyPI, console executable):

  • PRs smoke-test only — path-gated, reduced builds (Docker linux/amd64, trimmed executable matrix), no publish.
  • Sole publisherpublish-release.yml (weekly schedule + manual dispatch) builds/publishes both branches via a matrix; the push trigger publishes only when the PUBLISH_ON_MERGE repository variable is true (opt-in legacy continuous-release). Default is two-phase.
  • Parameterized chain (ref/branch/smoke, per-target enable_* gates), branch-suffixed artifacts, branch-scoped Docker cache, hardened required-status aggregator.
  • Robustness: skip GitHub release on a duplicate version (no-op weeks), pin the release tag to NBGV GitCommitId, global publish concurrency, cache-to/login gating reviewed.
  • CodeGen weekly → daily; test-release-task.yml + publish-periodic-docker-release.yml removed.
  • Corrected the Copilot review runbook (reliable requestReviews mutation) and made the wait-for-maintainer-merge gate explicit.

Also includes routine codegen updates (#93, #95).

🤖 Generated with Claude Code

ptr727-codegenBotand others added 3 commits May 25, 2026 03:11
This PR updates the codegen files.
Co-authored-by: ptr727-codegen[bot] <275599072+ptr727-codegen[bot]@users.noreply.github.com>
This PR updates the codegen files.
Co-authored-by: ptr727-codegen[bot] <275599072+ptr727-codegen[bot]@users.noreply.github.com>
Closes#97.
## What
Decouple merging from publishing across all four delivery targets
(Docker, NuGet, PyPI, console executable).
- **Two-phase by default.** PRs run unit tests plus a **path-gated smoke
build** of only the changed targets (Docker `linux/amd64` only, reduced
executable matrix, no push). Merges to `main`/`develop` no longer
publish.
- **Sole publisher.** `publish-release.yml` (weekly schedule + manual
dispatch) builds and publishes **both** branches in one run via a branch
matrix; its `push` trigger publishes only when the
**`PUBLISH_ON_MERGE`** repository variable is `true` (opt-in legacy
continuous-release).
- **Parameterized chain.** `ref`/`branch`/`smoke` are threaded through
every reusable task; branch-derived config keys off `inputs.branch`,
never `github.ref_name`, so a scheduled run can version/build `develop`
as well as `main`. `get-version-task.yml` gained a `ref` input.
- **Collision/cache safety for the matrix.** Build artifacts are
branch-suffixed and the Docker registry cache is branch-scoped
(`buildcache-main`/`buildcache-develop`, reads both, writes own) so the
two legs never collide or overwrite each other's cache.
- **Required check hardened.** The aggregator fails if the paths-filter
job fails, so a target-changing PR can't merge with its smoke build
silently skipped.
- **Consolidation.** CodeGen weekly → daily; unit tests folded into the
PR workflow; `test-release-task.yml` and
`publish-periodic-docker-release.yml` removed.
- **Per-target modularity.** Self-contained leaf tasks + `enable_*`
gates so a derived project can drop a target with minimal edits
(checklist in AGENTS.md).
## Copilot runbook
Corrects `.github/copilot-instructions.md`: the `requestReviews` GraphQL
mutation now reliably re-requests a review (previously documented as
non-working / manual-UI-only), and the wait-for-maintainer-merge gate is
now explicit in AGENTS.md.
## Notes
- `.NET` NuGet restore caching is intentionally left off (low overhead,
no lock files under Central Package Management) — documented inline.
- Default flips the template's prior "publish on every push" identity to
two-phase; docs (README/AGENTS.md) updated accordingly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
CopilotAI review requested due to automatic review settings June 3, 2026 23:04

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the repository’s CI/CD into a two-phase model: pull requests run unit tests plus path-gated smoke builds (no publishing), while a single publisher workflow handles scheduled/manual (and optionally merge-triggered) full releases across Docker, NuGet, PyPI, and executables.

Changes:

  • Replaces PR “test release” runs with a path-filtered smoke-build pipeline and a hardened required-status aggregator (test-pull-request.yml).
  • Consolidates publishing into publish-release.yml with a branch matrix (main + develop), global publish concurrency, opt-in publish-on-merge via PUBLISH_ON_MERGE, and duplicate-release avoidance.
  • Threads ref/branch/smoke through reusable build tasks; branch-suffixes artifacts and scopes Docker registry cache per-branch to avoid matrix collisions.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
README.mdUpdates template documentation to describe the new two-phase release model, opt-in publish-on-merge, and updated schedules/badges.
ProjectTemplate.slnxRemoves deleted workflows from solution items.
CodeGen/CodeGen.csRoutine codegen timestamp update.
AGENTS.mdDocuments the new release model and updated workflow/concurrency conventions and review loop mechanics.
.github/workflows/test-release-task.ymlRemoves the old reusable “test release” workflow (superseded by PR unit-test + smoke-build).
.github/workflows/test-pull-request.ymlImplements path-gated smoke builds plus required-status aggregation for conditional jobs.
.github/workflows/run-periodic-codegen-pull-request.ymlChanges codegen schedule from weekly to daily (staggered vs. weekly publish).
.github/workflows/publish-release.ymlBecomes the sole publisher: schedule/dispatch publish both branches; push publishes only when PUBLISH_ON_MERGE=true; adds global concurrency and branch matrix.
.github/workflows/publish-periodic-docker-release.ymlRemoves the old standalone periodic Docker publisher (consolidated into publish-release.yml).
.github/workflows/get-version-task.ymlAdds ref input and GitCommitId output to support matrix publishing and immutable release tagging.
.github/workflows/build-release-task.ymlAdds ref/branch/smoke and per-target enable gates; enforces “smoke never publishes”; pins releases to GitCommitId; skips duplicate GitHub releases.
.github/workflows/build-pypilibrary-task.ymlAdds ref/branch, branch-suffixed artifacts, and branch-driven PEP 440 prerelease logic for matrix publishing.
.github/workflows/build-nugetlibrary-task.ymlAdds ref/branch and branch-suffixed artifacts; uses branch-driven build configuration for matrix publishing.
.github/workflows/build-executable-task.ymlAdds ref/branch/smoke, reduces runtime matrix in smoke mode, and branch-suffixed artifacts/patterns for matrix publishing.
.github/workflows/build-docker-task.ymlAdds ref/branch/smoke, amd64-only smoke mode, branch-scoped buildcache, and branch-driven tagging/config.
.github/workflows/build-datebadge-task.ymlAdds branch input so badge writes only occur for main in a branch-matrix publish run.
.github/copilot-instructions.mdUpdates the Copilot review runbook to document programmatic re-requesting via requestReviews.

This PR updates the codegen files.
Co-authored-by: ptr727-codegen[bot] <275599072+ptr727-codegen[bot]@users.noreply.github.com>
## Problem
The dual-target codegen "byte-identical output" mechanism (#92) was
silently broken. `run-codegen-pull-request-task.yml` passed `--runtime
"${{ github.run_started_at }}"` to both matrix legs, but
**`github.run_started_at` resolves to an empty string in this
reusable-workflow context**. `CodeGenBuilder` falls back to
`DateTime.UtcNow` when `--runtime` is empty, so each leg stamped its own
wall-clock time — the `main` and `develop` legs diverged (observed ~5s
apart), and `CodeGen.cs` differed between branches, reintroducing the
exact `develop → main` release conflict the mechanism was meant to
prevent.
## Fix
Capture **one** UTC timestamp in a new `get-runtime` job and feed it to
both matrix legs via `needs.get-runtime.outputs.runtime`. Both legs now
receive an identical, non-empty value, so `CodeGen.cs` is byte-identical
across branches again.
Discovered while resolving the `CodeGen.cs` conflict on the develop→main
release PR (#99). AGENTS.md updated to match.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
CopilotAI review requested due to automatic review settings June 3, 2026 23:44
This PR updates the codegen files.
Co-authored-by: ptr727-codegen[bot] <275599072+ptr727-codegen[bot]@users.noreply.github.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread.github/workflows/test-pull-request.yml
@ptr727ptr727 closed this Jun 4, 2026
@ptr727ptr727 reopened this Jun 4, 2026
@ptr727
ptr727 merged commit 7671bea into mainJun 4, 2026
21 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants

@ptr727