Skip to content

fix(csharp-ci): pin Record-shard-result to workspace for non-root working-directory callers#28

Merged
monsieurleberre merged 2 commits into
devfrom
fix/csharp-ci-shard-upload-working-dir
Jun 19, 2026
Merged

fix(csharp-ci): pin Record-shard-result to workspace for non-root working-directory callers#28
monsieurleberre merged 2 commits into
devfrom
fix/csharp-ci-shard-upload-working-dir

Conversation

@monsieurleberre

Copy link
Copy Markdown
Contributor

Summary

  • csharp-ci.yaml's Upload shard result step (added in v2.2.0's badge feature) fails for any caller passing a non-root working-directory (e.g. working-directory: csharp).
  • The Record shard result run: step had no working-directory: override, so it inherited the job's defaults.run.working-directory and wrote <working-directory>/ci-result/<name>.txt. actions/upload-artifact ignores defaults.run.working-directory and resolves path: relative to the repo root, so the upload looked for ./ci-result/<name>.txt, didn't find it, and failed under if-no-files-found: error.
  • Fix: pin Record shard result to working-directory: ${{ github.workspace }} so it writes at the repo root, exactly mirroring how the adjacent coverage steps (Extract coverage percentage, Prepend coverage title, Write to Job Summary) are already pinned.

Observed downstream in peacefulstudio/canton-localnet-internal PR #102: steps 1–19 (including coverage at 95% and Record shard result) all succeed; only step 20 Upload shard result fails with No files were found with the provided path: ci-result/ubuntu-latest.txt.

Audited every actions/upload-artifact / download-artifact site in the file:

  • Coverage upload pair — producer Extract coverage percentage already pinned to ${{ github.workspace }}. OK.
  • pack job Upload nupkg artifact — its path: comes from Compute artifact path, which runs at ${{ github.workspace }} and explicitly prepends $WD/, so it's already root-relative. OK.
  • coverage-output / matrix-output download steps run in separate jobs with no defaults.run.working-directory, so they resolve at root. OK.

Only Record shard result needed the fix.

Type of change

  • Bug fix (non-breaking)

Test plan

  • actionlint clean on csharp-ci.yaml
  • YAML parses (python3 -c "import yaml; yaml.safe_load(...)")
  • Integration / acceptance: once @v2 carries this, the failing ci / build-and-test job on peacefulstudio/canton-localnet-internal PR #102 is re-run to confirm green. (N/A unit tests — workflow-only change.)
  • Manual verification — traced the Record shard result write path vs. upload-artifact read path for a working-directory: csharp caller.

Checklist

  • Followed red-green TDD where applicable — N/A (CI/workflow tweak; verified via downstream integration run).
  • Every new or renamed source file carries the SPDX header — N/A (no new files; header already present).
  • Updated public-facing docs / examples if the API changed — N/A (no input/output contract change).
  • Added a [Unreleased] entry in CHANGELOG.md for user-visible changes
  • Lint clean
  • No secrets or credentials in code, fixtures, or commit messages

Breaking changes / migration notes

None.

…ing-directory callers upload artifacts

The v2.2.0 badge feature added a `Record shard result` run-step and an
`Upload shard result` upload-artifact step. `Record shard result` had no
`working-directory:` override, so it inherited the job's
`defaults.run.working-directory` (`inputs.working-directory`). For a caller
passing `working-directory: csharp` it wrote `csharp/ci-result/<name>.txt`.

`actions/upload-artifact` ignores `defaults.run.working-directory` and
resolves its `path:` relative to the repo root, so `Upload shard result`
looked for `./ci-result/<name>.txt`, which did not exist, and failed with
`No files were found with the provided path: ci-result/<name>.txt` under
`if-no-files-found: error`. This broke every caller with a non-root
`working-directory` (observed in peacefulstudio/canton-localnet-internal,
PR #102: steps 1-19 including coverage at 95% pass; only the shard upload
fails).

Pin `Record shard result` to `working-directory: ${{ github.workspace }}`
so it writes `ci-result/<name>.txt` at the repo root, matching where
`upload-artifact` reads — mirroring how the adjacent coverage
Extract/Prepend/Write steps are already pinned. The coverage upload pair
and the pack `Compute artifact path`/`Upload nupkg artifact` pair were
audited and already resolve their paths at the repo root, so no other site
needed changing.
Copilot AI review requested due to automatic review settings June 19, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@monsieurleberre monsieurleberre merged commit 796fb81 into dev Jun 19, 2026
2 checks passed
@monsieurleberre monsieurleberre deleted the fix/csharp-ci-shard-upload-working-dir branch June 19, 2026 11:38
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.

2 participants