Skip to content

ci: Address the Flatpak lint module relative to the job's container (#2705) - #2706

Merged
zackees merged 2 commits into
masterfrom
fix/2705-flatpak-lint-path
Oct 27, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/2705-flatpak-lint-path

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

Why

#2702 ported the flatpak-builder-lint action's two inline run: blocks to ci/flatpak_builder_lint.py (GEN-005) and invoked the module through ${{ github.workspace }}. The Flatpak 📦 job in build-project.yaml runs in a container whose working directory is /__w/obs-studio/obs-studio, and a context interpolation inside a run: string is not translated the way working-directory: is, so it expanded to the runner host path and the very first lint step died before the build:

error: Failed to spawn: /home/runner/work/obs-studio/obs-studio/ci/flatpak_builder_lint.py
  cause: No such file or directory (os error 2)

Evidence: run 40594398865 (Scheduled on this branch's pre-fix state), job log line showing the docker workspace mount /home/runner/work → /__w and the checkout's Working directory is '/__w/obs-studio/obs-studio'.

Change

Both steps already carry working-directory: ${{ inputs.workingDirectory }} (default: the workspace), so the action now addresses everything relative to it:

  • module: uv run --no-project ci/flatpak_builder_lint.py … (the shape the neighbouring uv run --no-project ci/flatpak_compiler_diagnostics.py step already uses in the same job);
  • exceptions: --exceptions '.github/actions/flatpak-builder-lint/exceptions.json' instead of ${{ github.action_path }}, which is also a host path in that container.

All four call sites (manifest, appstream, builddir, repo) go through this one action, so no caller changes.

RED

8dea76a6e ci: Pin that the Flatpak lint action addresses its module relatively — adds ci/test_flatpak_lint_paths.py, which fails on master:

FAIL: test_every_invocation_is_relative — action.yaml:23 passes github.workspace, a runner-host path the container job cannot resolve
FAIL: test_the_lint_step_reads_the_action_own_exceptions — action.yaml:29 should read .github/actions/flatpak-builder-lint/exceptions.json relative to the workspace

GREEN

49fae5533 — the action edits plus the module docstring's usage line.

  • uv run python -m unittest discover -s ci -p test_flatpak_lint_paths.py → 3 tests, OK
  • uv run python -m unittest ci/test_flatpak_builder_lint.py → 10 tests, OK (its count("ci/flatpak_builder_lint.py") == 2 pin still holds)
  • uv run python -m unittest ci/test_uv_run.py → 5 tests, OK
  • ruff check clean on both touched Python files
  • behaviour by hand: ci/flatpak_builder_lint.py guard --artifact manifest → exit 0; --artifact bogus → ::error::Given artifact type is incorrect, exit 2

Not verified by PR CI

No PR-triggered lane runs the Flatpak job (ci_scope.py full only runs from a non-PR path), so the real proof is a workflow_dispatch of Scheduled on this branch, which I am dispatching with this PR open. The lint step's own outcome in that run is the acceptance check; the later compile step is unrelated to this change.

Fixes #2705
Refs #2703

…2705)

The Flatpak job runs in a container at /__w/obs-studio/obs-studio, but
${{ github.workspace }} in a composite action's run: resolves to the runner
host path, so the module never spawns. The pin fails on master.
…2705)

The Flatpak job runs inside a container at /__w/obs-studio/obs-studio, while
${{ github.workspace }} and ${{ github.action_path }} interpolate the runner
host path (/home/runner/work/...). Passing those as arguments is not translated
the way working-directory: is, so #2702's GEN-005 port made the first lint step
die with 'Failed to spawn: .../ci/flatpak_builder_lint.py' before the build.

Both steps already carry working-directory: ${{ inputs.workingDirectory }}
(the workspace by default), so the module and the action's own exceptions.json
are now addressed relative to it, matching the neighbouring
ci/flatpak_compiler_diagnostics.py step in the same job.

Verified locally: the new pin passes, ci/test_flatpak_builder_lint.py stays
green, guard exits 0 for manifest and 2 for an unknown kind, and the action
YAML parses with both run commands as intended. The Flatpak lane itself only
runs from Scheduled/dispatch, so a workflow_dispatch is the real proof.
@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Dispatch evidence (the acceptance check)

gh workflow run scheduled.yaml --ref fix/2705-flatpak-lint-path → run 40597879476, job Build 🧱 / Flatpak 📦 122518542154:

 9 Configure Flatpak Compiler Diagnostics   skipped
10 Validate Flatpak manifest                success   <-- was the "Failed to spawn" failure
11 actions/cache/restore                     success
14 Build Flatpak Manifest 🧾                failure

The lint step the issue is about now runs (guard + flatpak-builder-lint over the manifest) instead of dying at spawn, which is what #2705 asks for.

The later failure is not this change: the job dies at Build Flatpak Manifest 🧾 with Build failed: Error: The process '/app/bin/xvfb-run' failed with exit code 1, and the pre-#2702 dispatch the issue cites (run 40591042433, job 122495240167) has the identical step 10 success → step 14 failure / same xvfb-run annotation. That lane is also flaky independently of this PR — Flatpak 📦 passed at 21:18 and 05:07 today and failed at 20:48, 21:05, 21:57 and 22:23 on other heads — so it is a separate flake, not part of this fix.

@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator (green, clean, queued).

Merged via the queue into master with commit ca9369b Oct 27, 2026
61 of 65 checks passed
@zackees
zackees deleted the fix/2705-flatpak-lint-path branch October 27, 2026 23:06
@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Independent confirmation of this form, from the lane's own image with the worktree mounted exactly as the job mounts it (-v <repo>:/__w/obs-studio/obs-studio -w /__w/obs-studio/obs-studio, ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-26.08):

uv run --no-project ci/flatpak_builder_lint.py guard --artifact manifest       -> 0
uv run --no-project ci/flatpak_builder_lint.py lint --artifact manifest \
  --path build-aux/io.github.obs_rust.OBSStudioRust.json \
  --exceptions .github/actions/flatpak-builder-lint/exceptions.json            -> 0

and the host path still exits 2 with Failed to spawn: … (os error 2).

I also checked the assumption this makes — that callers leave workingDirectory at its default — against all 11 call sites (7 in build-project.yaml, 4 in publish.yaml): none overrides it, so both relative paths resolve against the container's workspace everywhere. I had a duplicate fix in #2707 while reproducing this; closed it in favour of yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: Flatpak lane fails to spawn ci/flatpak_builder_lint.py — the action passes ${{ github.workspace }} where the job runs in /__w (#2702 regression)

1 participant