Skip to content

infra: Port the generate-docs version stamp to Python and clear its GEN-005 exception (shell-budget burn-down) #2681

Closed

Description

@zackees

What

ci-lint precheck on origin/master (pin a1917ce7…) reports 11 violation(s), 491 approved exception(s), 10 needs_review. The violation floor is structural, but the GEN-005 (shell budget) baseline is still 358 findings, and each is a run: step that should be one call into a Python module.

This is the first unit of that burn-down, chosen because it is a single self-contained step whose callers all run on Linux:

.github/actions/generate-docs/action.yaml runs.steps[0] (id: setup) is a 30-line shell block:

  • greps LIBOBS_API_{MAJOR,MINOR,PATCH}_VER out of libobs/obs-config.h, reshapes it with sed/tr and splits it with read into three variables;
  • rewrites docs/sphinx/conf.py with three sed -i -E expressions (version, release, copyright with the current year);
  • optionally blanks html_link_suffix, and appends artifactName / commitHash to $GITHUB_OUTPUT.

[GEN-005] APPROVED EXCEPTION .github/actions/generate-docs/action.yaml — runs.steps[0]: run: step violates the shell budget (more than one line; control syntax (;, |, $(, <<); leading if/for/while).

Scope of this unit (one PR)

  1. RED: ci/test_docs_version_stamp.py pins the port: the step is one uv run --no-project --script ci/docs_version_stamp.py line, the module stamps conf.py from a fixture obs-config.h and writes the two step outputs, the action installs uv before the call, and ci.toml has no GEN-005 exception for that path.
  2. GREEN: ci/docs_version_stamp.py (stdlib only, #!/usr/bin/env -S uv run --script), the action step becomes one line, astral-sh/setup-uv is added to the action with the repo's save-cache/cache-suffix expressions (the compatibility-validator precedent, CACHE-013), and the [[exceptions]] block is deleted.

RED/GREEN is the precheck header: 491 → 490 approved exceptions, with the GEN-005 … generate-docs line gone and no new finding.

Why this step and not another

  • The three callers (ci.yml, push.yaml, dispatch.yaml's update-documentation jobs) run on a bare ubuntu-26.04 with no uv, so the action installs it itself — the same shape compatibility-validator already uses, so the cache/family rules are unchanged.
  • The port is behaviour-preserving: same version parsing, same three sed substitutions, same two outputs, no dialog and no new dependency.
  • ci-pre.yml-style traps (stock distro containers with neither Python nor uv) do not apply here, and neither does .github/scripts/retry (bootstrap shell).

Not in this unit

The other 357 GEN-005 findings (the large build-project.yaml, release-rust.yaml, appimage.yaml blocks and the PowerShell helper trees). Each is its own path-scoped unit; .github/scripts/build-*, package-* and the .ps1 helpers need a per-caller check on whether the interpreter exists where they run, before they can be claimed.

Verified: ci-lint precheck header on origin/master, the step text, the three call sites, and ci/test_uv_run.py's allowlist (the action's line carries the literal uv run, so TOOL-003 is satisfied). Not verified: an actual docs run on a GitHub runner (the update-documentation job is gated on repository_owner == 'obsproject', so PR CI never executes it).

Activity

  1. added
    infra
    P2
    size:S
    on Oct 27, 2026
  2. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    /ready

    Checked against the definition of Ready (WORKFLOW.md):

    1. Scope is concrete — one action, one step: .github/actions/generate-docs/action.yaml runs.steps[0] becomes a single call into ci/docs_version_stamp.py, and the file's [[exceptions]] GEN-005 block is deleted.
    2. Acceptance criteria — the precheck header goes 491 → 490 approved exceptions, the GEN-005 … generate-docs line is gone with no new finding, ci/test_docs_version_stamp.py passes, and ci/test_uv_run.py/CACHE-013 pins stay green.
    3. Dependencies — none; no blockers.
    4. No open Decision needed: — the port is behaviour-preserving (same parsing, same substitutions, same two step outputs); uv is installed by the action itself, the compatibility-validator precedent, so no cache policy changes.
    5. Labels — infra, P2, size:S; one PR.

    Infra/CI-only change, so no docs/features.md line.

  3. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: GEN-005 generate-docs \u2014 port the version stamp to Python (branch infra/2681-gen-005-generate-docs)

    Plan (one PR):

    1. RED 0ced87273: ci/test_docs_version_stamp.py pins the shape and the behaviour (module stamps conf.py from a fixture obs-config.h, writes artifactName/commitHash, action installs uv, exception gone). Fails on master: module absent, step still shell, exception present.
    2. GREEN: ci/docs_version_stamp.py (stdlib only), the step becomes one uv run --no-project --script ci/docs_version_stamp.py line, astral-sh/setup-uv added with the repo's save-cache/cache-suffix expressions, GEN-005 exception deleted.
    3. RED/GREEN is the precheck header (491 → 490 approved exceptions) plus the ci/test_* sweep.
  4. added
    ready
    on Oct 27, 2026
  5. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Landed: #2682 merged into master as 8b84251 (2026-10-27 19:50Z).

    What changed: .github/actions/generate-docs/action.yaml's 30-line setup shell block is now one uv run --no-project --script ci/docs_version_stamp.py … call; the action installs uv first (all three callers run on a bare ubuntu-26.04); ci/test_docs_version_stamp.py is the pin and the file's GEN-005 [[exceptions]] block is gone.

    Measured header: ci-lint precheck on master at 3edfaac read 11 violations / 491 approved exceptions / 10 needs_review; after the merge (8b84251) it reads 11 / 490 / 10.

    Nothing left on this unit. The remaining GEN-005 approved exceptions are the next worker unit.

  6. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Closed: the unit landed in #2682 (8b84251), and the measured header on master is now ci-lint precheck: 11 violation(s), 490 approved exception(s), 10 needs_review (was 491 before the merge). The GEN-005 generate-docs exception is gone; the rest of the GEN-005 burn-down is separate path-scoped units, not this issue.

  7. moved this from In progress to Done in obs-rust Multiviewon Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2infrareadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions