Skip to content

test(project-status): guard container/services options and working-directory against expressions (#1077) - #1079

Merged
JarryShaw merged 1 commit into
mainfrom
test/1077-project-status-options-guard
Oct 6, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
test/1077-project-status-options-guard

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • test — tests only

Description of your pull request and other information

The project-status.yml guard now rejects ${{ }} under jobs.<id>.container.options, jobs.<id>.services.<id>.options and working-directory (step and defaults.run), as well as run:/shell:. It matches by path suffix rather than last key, because options and working-directory are also legal env: names, and env: is the safe channel. The workflow itself does not change.

Tests: one rejected and one literal fixture per key, plus an env: options: case that must pass. All are cross-checked against yaml.safe_load (ran, PyYAML 6.0.3). With the guard reverted, the five new positive subtests fail (the expression in options:/working-directory: went unseen). The scan() docstrings no longer claim PyYAML is in no extra (see #1078).

Closes #1077

…rectory against expressions (#1077)

Extend the expression guard from run:/shell: to jobs.<id>.container.options,
jobs.<id>.services.<id>.options and working-directory (step and
defaults.run), matched by path suffix so env: names stay unguarded. Add a
rejected and an accepted fixture per key, cross-checked against
yaml.safe_load, and drop the "yaml is in no extra" wording from the scanner
docstrings.
@JarryShaw JarryShaw added review: running A cross-review is in flight against the current head - no verdict yet test Pull requests that add or correct tests (test: subject prefix) labels Oct 6, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Cross-review verdict on 623ee367f: GOOD TO GO (ran on Sonnet; author Opus)

  • Coverage. 19 constructed workflows went through guard_trips. All of these trip:

    • block-style container.options and services.<id>.options;
    • their flow-style forms, which fail closed as UnsupportedYAML;
    • step working-directory and workflow- or job-level defaults.run.working-directory;
    • a quoted 'options': key.

    These do not trip: with: inputs named working-directory, and env: names options at step, job or container level.

  • Fail-without-fix. Reverting only the expression_spliced call sites makes the 5 new positive subtests fail.

  • Real workflows. The YAML agreement holds on all 11 fixtures. No real workflow trips; both existing working-directory: uses are literals.

  • Tests. tests/project: 379 passed, 1 skipped.

  • External check (mine). GitHub's context-availability table allows github, inputs and other contexts in steps.working-directory and jobs.<id>.defaults.run, and in the container/services mappings. So these are real expression sites.

  • Out of test(project-status): extend the injection guard to container.options, services options and working-directory #1077's scope, not flagged: container: ${{ … }} as a plain image string, and image:/volumes: keys.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Coverage: 88.74% (unit tier, Python 3.14, 623ee367f, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 4 93.55%
pcapkit/const 18757 1035 2342 846 90.23%
pcapkit/corekit 1874 91 578 22 94.33%
pcapkit/dumpkit 136 0 40 0 100.00%
pcapkit/foundation 2422 143 842 34 92.62%
pcapkit/interface 112 7 40 5 92.11%
pcapkit/protocols 15653 187 3942 162 98.19%
pcapkit/toolkit 487 71 144 3 84.15%
pcapkit/utilities 429 4 122 4 98.55%
pcapkit/vendor 4409 2359 1006 158 42.84%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit 62a7989 into main Oct 6, 2026
41 checks passed
@JarryShaw
JarryShaw deleted the test/1077-project-status-options-guard branch October 6, 2026 16:25
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Pull requests that add or correct tests (test: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test(project-status): extend the injection guard to container.options, services options and working-directory

1 participant