Skip to content

Fix bug-test Python dependency provisioning - #4030

Merged
mnriem merged 4 commits into
github:mainfrom
WOLIKIMCHENG:fix/3997-bug-test-python-provisioning
Aug 10, 2026
Merged

Fix bug-test Python dependency provisioning#4030
mnriem merged 4 commits into
github:mainfrom
WOLIKIMCHENG:fix/3997-bug-test-python-provisioning

Conversation

@WOLIKIMCHENG

Copy link
Copy Markdown
Contributor

Closes #3997.

Summary

  • Provision uv and Python before the bug-test agent runs.
  • Install repository test dependencies with uv sync --extra test.
  • Allow PyPI package downloads through the gh-aw firewall so the agent can refresh dependencies after checking out a fix ref.
  • Add static coverage for the source workflow and compiled lock.

Validation

  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m pytest -p no:cacheprovider tests/test_github_workflows.py -q
  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m pytest -p no:cacheprovider tests/test_security_workflow.py::TestDependencyAuditWorkflow::test_setup_python_pin_matches_repo_standard tests/test_security_workflow.py::TestDependencyAuditWorkflow::test_setup_uv_pin_matches_repo_standard -q
  • uvx ruff@0.15.0 check tests/test_github_workflows.py
  • git diff --check
  • /tmp/gh-aw-0.79.8.sGWKqX/linux-amd64 compile bug-test --no-emit --approve

Comment thread tests/test_github_workflows.py Fixed
Comment thread tests/test_github_workflows.py Fixed
Comment thread tests/test_github_workflows.py Fixed
Comment thread tests/test_github_workflows.py Fixed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes the bug-test workflow’s Python test environment provisioning.

Changes:

  • Provisions Python 3.14, uv, and test dependencies.
  • Allows PyPI traffic through the workflow firewall.
  • Adds static source and compiled-workflow coverage.
Show a summary per file
File Description
.github/workflows/bug-test.md Configures Python tooling and PyPI access.
.github/workflows/bug-test.lock.yml Compiles the updated workflow configuration.
tests/test_github_workflows.py Verifies provisioning, firewall domains, pins, and step order.

Review details

Tip

Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

Address CodeQL py/incomplete-url-substring-sanitization alerts (14-17)
by anchoring the PyPI domain assertions to their structural context:
the `network.allowed` YAML list items in the source and the quoted JSON
entries in the compiled lock. This defeats the incomplete-URL-substring
pattern and strengthens the test to confirm the domains are real
allowlist entries rather than incidental substrings.

Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b54442f-ccc5-4be1-a05c-b360889670e5

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread .github/workflows/bug-test.md Outdated
mnriem and others added 2 commits August 10, 2026 12:34
Replace `uv sync --extra test` with `uv pip install --system -e ".[test]"`
in the bug-test provisioning step.

`uv sync` writes a root `uv.lock` (and `.venv`) into the working tree.
This repository intentionally has no `uv.lock`/`[tool.uv]` (uv.lock is
gitignored), so the sync produced an untracked lockfile before the agent
checks out the fix ref in Step 2. `uv pip install` installs the test
extra into the runner's Python without generating a project lock, keeping
the working tree clean before the fix checkout. The editable install
means the agent's `python3 -m pytest` runs against the checked-out fix
code. Recompiled the lock and updated the assertions accordingly.

Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b54442f-ccc5-4be1-a05c-b360889670e5
… workflows

Dependabot bumps the third-party action `uses:` pins (and header comments)
directly, but does not update gh-aw's own metadata: the per-file
`gh-aw-manifest` JSON blob and the shared `.github/aw/actions-lock.json`
pin cache. As a result the executing pins were already uniform and current
(checkout v7.0.1, setup-node v7.0.0) while the manifest/cache metadata still
recorded checkout v6.0.3 / setup-node v6.4.0.

This is a latent downgrade hazard: a plain `gh aw compile` reads the stale
cache and can silently revert the `uses:` lines back to the older pins,
undoing Dependabot's bumps and breaking lockstep.

Sync all four pin surfaces (uses / header comment / manifest / cache) to the
current pins so every workflow agrees and a future recompile is a no-op:
- actions-lock.json: checkout v6.0.3 -> v7.0.1, setup-node v6.4.0 -> v7.0.0,
  and add the setup-python v7.0.0 + setup-uv v9.0.0 entries now used by
  bug-test.
- gh-aw-manifest blobs in the 5 non-bug-test lock files: checkout + setup-node
  bumped to match their own uses lines (bug-test was already current).

No workflow body changes; only pin metadata. `uses:` pins are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7b54442f-ccc5-4be1-a05c-b360889670e5
Assisted-by: GitHub Copilot (model: Claude Opus 4.8, supervised)
@mnriem

mnriem commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Pushed 62899020 — syncs gh-aw action-pin metadata to the latest pins across all workflows so this PR stays in lockstep.

Why: Dependabot already keeps the executing uses: pins current and uniform across all 6 workflows (checkout v7.0.1, setup-node v7.0.0, setup-python v7.0.0, setup-uv v9.0.0), but it does not touch gh-aw's own metadata — the per-file gh-aw-manifest blob and the shared .github/aw/actions-lock.json cache. Those lagged at checkout v6.0.3 / setup-node v6.4.0 in the files not recently recompiled. Since no CI recompiles the locks, a plain gh aw compile reads the stale cache and can silently downgrade the uses: lines back, undoing Dependabot's bumps and breaking lockstep.

Change (metadata only, no workflow-body changes, uses: pins untouched):

  • .github/aw/actions-lock.json: checkout v6.0.3→v7.0.1, setup-node v6.4.0→v7.0.0, and added the setup-python v7.0.0 + setup-uv v9.0.0 entries this PR introduces via bug-test.
  • gh-aw-manifest blobs in the 5 non-bug-test lock files: checkout + setup-node bumped to match their own uses: lines (bug-test was already current).

Verified: no stale SHAs remain; all 6 manifests uniform at latest; actions-lock.json valid JSON; each lock file changed exactly one metadata line; workflow tests pass (incl. the full-SHA pin-enforcement test).


Posted on behalf of @mnriem by GitHub Copilot (model: Claude Opus 4.8). This commit was agent-generated under maintainer supervision.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review details

  • Files reviewed: 9/9 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@mnriem
mnriem merged commit 2df78f3 into github:main Aug 10, 2026
14 checks passed
@mnriem

mnriem commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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.

[Bug]: bug-test agentic workflow cannot run tests — no Python/uv provisioning and PyPI blocked by egress firewall

4 participants