NCBC-4283: Let FIT runs test a branch's performer image - #163
Conversation
Motivation ---------- The FIT caller hardcoded `performer: 'dotnet-fit-performer:main'`, so every run tested master's SDK. The SDK under test is baked into the performer image rather than taken from the workflow's own checkout, so selecting a branch in the Actions UI changed which YAML ran but not which code was tested — a PR could pass FIT without its changes ever being exercised. Testing a branch meant a throwaway commit editing the hardcoded tag. Changes ------- Add an optional `performer_tag` dispatch input which defaults to the branch the workflow is run from, so a branch run tests that branch. Deriving the tag needs shell (branch names like dk/ncbc-4283 are not valid Docker tags), and a `uses:` job cannot also have `steps`, so a small `performer-tag` job resolves it and hands it over via outputs. It mirrors the two rules the publish side applies: sdk-docker-build-action renames master to main, and docker/metadata-action collapses runs of [^a-zA-Z0-9._-] to '-'. The resolved image is echoed into the log. The nightly is unchanged: `schedule` passes no inputs and GITHUB_REF_NAME is master, which resolves to main as before. Note the performer image must already exist — build it first via "Publish FIT Performer Image" with ref=<your-branch>. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the FIT test workflow so manual runs can test the correct SDK code by selecting a matching dotnet-fit-performer image tag (instead of always using main).
Changes:
- Adds a
performer_tagworkflow_dispatch input to select the performer image tag (defaults to the branch-derived tag). - Introduces a
performer-tagjob which normalizesGITHUB_REF_NAMEinto a valid Docker tag and exposes it as a job output. - Updates the
fitreusable-workflow invocation to use the resolved tag for itsperformerinput.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| preset: ${{ vars.FIT_CLI_PRESET || inputs.preset || 'op-multi-lite' }} | ||
| collect_extra_diagnostics: ${{ inputs.collect_extra_diagnostics == '' && true || inputs.collect_extra_diagnostics }} | ||
| performer: 'dotnet-fit-performer:main' | ||
| performer: dotnet-fit-performer:${{ needs.performer-tag.outputs.tag }} |
|
We had a "Run FIT-CLI (Shared)" ( LGTM 👍 after Copilot's comment on the |
|
Thanks both. @Copilot's
@emilienbev re the old Also smoke-tested end to end: built |
NCBC-4283
Problem
fit-testing-dotnet.ymlhardcodedperformer: 'dotnet-fit-performer:main', so every FIT run tested master's SDK.The SDK under test is baked into the performer image (built by
publish-fit-performer.ymlfrom a chosen ref), not taken from the calling workflow's checkout. Selecting a branch in the Actions UI therefore changed which YAML ran but not which code was tested — the UI implies otherwise, so a PR could pass FIT without its changes ever being exercised. The workaround was a throwaway commit editing the hardcoded tag on the branch.Change
Adds an optional
performer_tagdispatch input, defaulting to the branch the workflow is run from.Deriving that tag needs shell —
dk/ncbc-4283is not a valid Docker tag — and auses:job cannot also havesteps, so a smallperformer-tagjob resolves it and passes it via job outputs. It mirrors the two rules the publish side already applies:sdk-docker-build-actionrenamesmaster→maindocker/metadata-actioncollapses runs of[^a-zA-Z0-9._-]to-Verified against the tags actually published to ghcr.io today:
GITHUB_REF_NAMEmaster(nightly)maindk/ncbc-4300dk-ncbc-4300dk/pe-ramp-bootstrapdk-pe-ramp-bootstrapNCBC-4271NCBC-4271release/3.9.xrelease-3.9.xThe resolved image is echoed into the job log, so a run states what it tested.
The input is passed via
env:rather than interpolated into the script body, since${{ }}is substituted before bash parses it. The tag job getspermissions: {}— it has no need for the OIDC token thefitjob requires.Nightly is unchanged
schedulepasses no inputs andGITHUB_REF_NAMEismaster, which resolves tomainexactly as before.Usage
Build the image first, or the run fails to pull it:
ref=<your-branch><your-branch>— noperformer_tagneededPass
performer_tag: mainto test master's SDK from a branch.🤖 Generated with Claude Code