Skip to content

Refactor verify-action-build into modular package with tests#675

Open
potiuk wants to merge 5 commits intomainfrom
refactor/verify-action-build-modularize
Open

Refactor verify-action-build into modular package with tests#675
potiuk wants to merge 5 commits intomainfrom
refactor/verify-action-build-modularize

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Apr 6, 2026

Summary

  • Split the 3068-line monolithic utils/verify-action-build.py into 15 focused modules organized by responsibility
  • Extracted the inline Dockerfile template to a standalone dockerfiles/build_action.Dockerfile file
  • Added 112 unit tests across 12 test files covering all modules
  • Updated entry points in both pyproject.toml files

Module structure

Module Responsibility
console.py Console setup, UserQuit, ask_confirm, link, run
github_client.py GitHubClient class (gh CLI + REST API)
action_ref.py Parsing org/repo@hash, extracting uses: refs, detecting action type
approved_actions.py actions.yml database interaction
docker_build.py Docker image building + artifact extraction
diff_display.py Colored diff rendering with pagination
diff_js.py JS beautification + compiled JS comparison
diff_node_modules.py Vendored node_modules comparison
diff_source.py Source file diffing between versions
security.py All analyze_* security check functions
pr_extraction.py Extracting action refs from PR diffs
dependabot.py Dependabot PR review/merge workflow
verification.py Orchestration + summary display
cli.py Argument parsing + main() entry point

Test plan

  • All 112 new unit tests pass (uv run pytest utils/tests/ -v)
  • All 49 existing project tests still pass (uv run pytest -v — 161 total)
  • CI pytest workflow passes
  • Manual smoke test: uv run verify-action-build <action_ref>

🤖 Generated with Claude Code

Split the 3068-line monolithic script into 15 focused modules organized
by responsibility (GitHub client, action parsing, Docker building, diff
engines, security analysis, PR extraction, etc.), extracted the inline
Dockerfile to a standalone file, and added 112 unit tests.

Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
potiuk added 2 commits April 6, 2026 17:02
Previously force_terminal=False was passed outside CI, disabling color
on real terminals.  Now we only override Rich defaults inside CI.

Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
RAT check failed because these empty files had no license header.

Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@potiuk potiuk requested review from dave2wave, dfoulks1 and raboof April 6, 2026 15:25
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Apr 6, 2026

Hey @raboof -> since the tool has gone through a series of iterations and seems to be getting closer to regular maintenance - as asked in the #652 (comment), this one should make it far easier to review further changes.

potiuk added 2 commits April 6, 2026 17:33
Replace `uv run utils/verify-action-build.py` with
`uv run --directory utils verify-action-build` in README,
PR template, CI workflow, and package docstring.

Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
uv run doesn't install console script entry points, so the
--directory approach doesn't work. Keep a thin wrapper script
with PEP 723 metadata that delegates to the package, preserving
the original invocation that docs, CI, and users expect.

Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@potiuk potiuk force-pushed the refactor/verify-action-build-modularize branch from 5541d43 to 2a3532b Compare April 6, 2026 15:39
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