Behaviour SwRS-MDOKFSTUDIO-CORE-076
CI tags a version change only after a green heavy run of the commit
Every push to main SHALL run the heavy jobs; when the push changes the package version, the CI workflow SHALL tag the commit only when they both succeed, and a push without a version change SHALL still run the tag step and create no tag.
Step 2 of path 1 in StRS-MDOKFSTUDIO-CORE-007: from “The version commit has a green heavy run” to “The tagged version has release notes”.
Scenarios 6
The situations the tests check; open one to read it.
nominalVersion change on main with a green heavy run
Givena push to main whose `package.json` version differs from the version before the push (`release-check` outputs `bump=true`, the same test `scripts/version.py --tag-before` applies)
Whenthe `integration` and `stress` jobs of that push run succeed and `checks` succeeds
Then`tag-release` tags the commit, `release` dispatches the **Release VSIX** workflow with the tag on the default branch, and `pages` builds the site from the merged reports artifact of the same run (`studio-reports-attempt-<n>`, the name the `report` job outputs) instead of running the suite
nominalRe-run of the failed jobs of a version change
Givena version-change push run whose `integration` job failed on attempt 1 ("Release not tagged") and whose `visual` job passed
Whenthe failed jobs are re-run (`gh run rerun {run-id} --failed`) and pass on attempt 2, hours after attempt 1
Then`report` merges `e2e-visual-attempt-1` (the `visual` output kept from attempt 1) with `e2e-integration-attempt-2`, its stages are accepted as one campaign because both carry the run id pinned by the workflow, `tag-release` tags the commit, and `pages` builds the site from `studio-reports-attempt-2`
boundaryArtifact names and attempts
| Input | Outcome |
|---|---|
| an artifact uploaded by a job of `ci.yml` | its name ends with `-attempt-<n>` (`github.run_attempt`); `visual`, `integration` and `report` output that name as `artifact` |
| a job or Pages consumes an artifact of the same run | it downloads the producing job's `artifact` output (Pages: the `reports_artifact` input), never a fixed name |
| only `stress` was re-run | `report` is not re-run; Pages uses `studio-reports-attempt-1` |
| `integration` is skipped | `report` downloads no integration artifact and reports the real VS Code stage as skipped |
| the calling run passes `reports_from_caller` without a `reports_artifact` | Pages warns and runs the suite (an empty name would download every artifact) |
| a failed visual manifest lists `{page, detail}` failures | `report` prints each as `{page}: {detail}`, joined with `; `, never `[object Object]`; string failures print as they are; `error` of the manifest keeps its priority |
| the visual and integration stages started two hours apart or more | `report` fails, unless both campaigns carry the same run id pinned by `STUDIO_E2E_RUN_ID` (`pinnedRunId`) |
nominalPush to main without a version change
Givena push to main whose `static`, `visual` and `report` jobs succeed and whose version is unchanged (`bump=false`)
Whenthe workflow reaches `tag-release`
Then`integration` and `stress` run, with `stress` advisory, `tag-release` runs and outputs no tag, and `release` and `pages` are skipped
boundaryFailure, cancellation and other events
| Input | Outcome |
|---|---|
| version change, `checks`, `integration` or `stress` not `success` (failure, skipped, cancelled; an `integration` failure also fails `report`, then `checks`) | `tag-release` runs, creates no tag, writes "Release not tagged" with the `checks`, `integration` and `stress` results and the re-run command to the job summary, and fails; `release` and `pages` are skipped |
| version change | `stress` blocks (`continue-on-error` is off), so its failure reaches `tag-release`; otherwise it stays advisory |
| no version change, `checks` did not succeed | `tag-release`, `release` and `pages` are skipped |
| `release-check` failed or was cancelled (for example `github.event.before` is not reachable) | the heavy jobs, `tag-release`, `release` and `pages` are skipped and no summary is written; the run is red |
| the run is cancelled | `tag-release`, `release` and `pages` are skipped, no summary is written |
| `tag-release` output an empty tag | `release` and `pages` are skipped |
| the event is not a push to `refs/heads/main` | `release-check` and `tag-release` are skipped; the heavy jobs run only on a dispatch with `heavy` |
| a dispatch with `heavy` (and `gallery` not false) whose `integration` and `report` succeed | `gallery` runs and uploads the gallery and site as `studio-site-attempt-<n>` |
| a dispatch with `heavy` whose `integration` or `report` did not succeed, or with `gallery` false | `gallery` is skipped |
boundaryReports of a later Pages deploy
| Run of the tagged commit | Selected by `scripts/select_e2e_run.py` |
|---|---|
| `workflow_dispatch` run, green, `integration` succeeded, report artifacts present | yes (unchanged) |
| `push` run on `main`, green, `integration` and `stress` succeeded, report artifacts present | yes |
| `push` run whose `integration` or `stress` is skipped, failed or absent | no |
| `push` run on another branch, of another commit, not completed or not green | no |
| run re-run after a failure, several attempts of the reports | yes; the newest attempt of `studio-reports` is downloaded (attempts compared as numbers) |
| newest `studio-reports` attempt expired, or older than the newest attempt of a stage artifact | no (an older attempt is never used instead) |
| artifacts without the `-attempt-<n>` suffix (runs made before it) | no; the suite runs |