Skip to content

ci: add a concurrency group to xma2-decoder.yml (CI-XMA2-CONCURRENCY) - #608

Open
TuroYT wants to merge 2 commits into
ProjectLeonida:mainfrom
TuroYT:ci/xma2-concurrency
Open

TuroYT wants to merge 2 commits into
ProjectLeonida:mainfrom
TuroYT:ci/xma2-concurrency

Conversation

@TuroYT

@TuroYT TuroYT commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: CI-XMA2-CONCURRENCY (#14 (comment))

xma2-decoder.yml is the only workflow in .github/workflows/ without a top-level concurrency: block. It runs on windows-latest, so a superseded pull request run keeps a Windows runner busy until it finishes.

This adds the same block ci.yml uses, with the group prefix xma2-decoder-:

  • group: xma2-decoder-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}
  • cancel-in-progress: ${{ github.event_name == 'pull_request' }}

A pull request cancels its superseded run. A push gets its own group, because run_id is unique per run, so a burst of merges cannot replace a queued main run before it starts. This is the shape #771 gives ci.yml, jactionlint.yml, no-game-data.yml and runtime.yml, which leaves this file to this PR. Nothing else in the file changes.

The branch is based on origin/main. #595 (persist-credentials: false on checkout) was still open when this branch was made. Its hunk is elsewhere in the same file, so the two do not overlap.

Tested:

  • python3 -I -c "import yaml,glob; ..." parses every file in .github/workflows/: prints ok.
  • The parsed concurrency of xma2-decoder.yml is the expected mapping, and the top-level keys are name, on, permissions, concurrency, jobs.
  • git diff --check: clean. git diff --numstat: 5 added lines, 0 removed.
  • python3 -I tests/test_ci_registration.py: 15 tests OK.
  • python3 -I tests/test_no_game_data_workflow.py: 3 tests OK.
  • python3 -I tests/test_runtime_paths.py: 5 tests OK.
  • python3 -I tests/test_pr_conflict_label.py: 12 tests OK.
  • python3 -I scripts/check_no_game_data.py .github/workflows/xma2-decoder.yml: exit 0.
  • Group expression, worked through by hand and not executed: two different PRs give xma2-decoder-pull_request-<n> with different n. A push has no PR number, so it falls through to the run id, giving xma2-decoder-push-<run_id>, a different group for every push. cancel-in-progress is false for a push.

Review follow-up: MoonEyes pointed out that the first revision keyed a push on the ref, so two pushes to main shared one group and GitHub, which keeps at most one pending run per group, replaced the queued one. The second commit uses the run id, as #771 does for the other workflows.

Not tested:

  • The workflow itself was not run. There is no way to run GitHub Actions here, and actionlint is not installed. The CI run on this PR is the real check.
  • Cancellation on GitHub was not observed.

AI-assisted (Claude Code).

xma2-decoder.yml was the only workflow without a concurrency group, so a superseded pull request run kept a windows-latest runner busy until it ended. Add the same block ci.yml uses, with the group prefix xma2-decoder-. Pull requests cancel the superseded run; pushes to main are not cancelled.
@MoonEyes

Copy link
Copy Markdown
Collaborator

The YAML parses and the block matches the other workflows' shape. Two PRs get separate groups (xma2-decoder-pull_request-601 / -602), and a push can never cancel a PR run or the reverse. It also applies cleanly together with #595.

One claim in the description is not accurate: "A push to main ... is never cancelled." Two pushes to main both resolve to xma2-decoder-push-refs/heads/main. GitHub keeps at most one pending run per group, so a queued main run is replaced by a newer one even with cancel-in-progress: false. Only the running build is safe. The inline comment says this correctly; the description does not.

This is the exact pattern #771 removes from ci.yml, jactionlint.yml, no-game-data.yml and runtime.yml, and #771 leaves xma2-decoder.yml to this PR. Suggest using ${{ github.event.pull_request.number || github.run_id }} here so the five workflows stay consistent, or noting in the description that #771 will align it.

Note: the workflow runs on this PR are still action_required, so jactionlint and the XMA2 job have not executed yet.

AI-assisted review (Claude Code).

… will

A push keyed on the ref made two pushes to main share one group, and GitHub
keeps at most one pending run per group, so a queued main run was replaced
by a newer one. The group now uses the PR number or the run id, which is the
shape ProjectLeonida#771 gives ci.yml, jactionlint.yml, no-game-data.yml and runtime.yml.

CI-XMA2-CONCURRENCY
@TuroYT

TuroYT commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Fair point, and thanks for catching it. Two pushes to main did share xma2-decoder-push-refs/heads/main, so a queued run could be replaced even with cancel-in-progress: false. The description was wrong to say a push is never cancelled.

24569ea switches the group to pull_request.number || run_id, the shape #771 gives the other four workflows, with the same comment. The description now says that and no longer claims a push is never cancelled. The YAML still parses and the four workflow-reading tests pass; the workflow itself has not run yet because its checks are waiting for approval.

@TuroYT

TuroYT commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

The windows-ffi job failed on this PR at "Link and run the synthetic C++ ABI smoke test", and it is not caused by this change (the diff only adds the concurrency: block).

The link step reports LNK2019: unresolved external symbol __imp_WaitOnAddress (also __imp_WakeByAddressSingle and __imp_WakeByAddressAll) and LNK1120: 3 unresolved externals. The same error is in the log of the XMA2 decoder run for the push to main at d0da7da (13:44 UTC) and in the run for feat/acphal-xma2-decoder, so main is red on this job too.

Those three functions come from synchronization.lib, which the cl line of that step (ws2_32.lib userenv.lib ntdll.lib) does not list. #877 adds it to runtime/CMakeLists.txt only; it does not touch this workflow.

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