Skip to content

Promote Script --help and Unknown-Argument Handling to Main - #545

Merged
ptr727 merged 2 commits into
mainfrom
develop
Oct 26, 2026
Merged

ptr727 merged 2 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes develop to main.

Closes #539

Verification

Local staging runs release 851dd6b, built by the changed make-release.sh, and passed the full contract, 1296 URLs. The only change after it, e0c3d91, touches checks/check-live-urls.sh and capture/run-wp2hugo.sh argument handling. The merged check-live-urls.sh passed the same 1296 URLs against that release. #542's CI passed at its merged head.

🤖 Generated with Claude Code

dependabot Bot and others added 2 commits October 26, 2026 12:40
Bumps the actions-deps group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [ptr727/ProjectTemplate/.github/workflows/validate-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1135` | `2.0.1148` |
| [ptr727/ProjectTemplate/.github/workflows/deploy-site-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1135` | `2.0.1148` |
| [ptr727/ProjectTemplate/.github/workflows/merge-bot-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1135` | `2.0.1148` |
| [ptr727/ProjectTemplate/.github/workflows/publish-plan-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1135` | `2.0.1148` |
| [ptr727/ProjectTemplate/.github/workflows/build-release-task.yml](https://github.com/ptr727/projecttemplate) | `2.0.1135` | `2.0.1148` |


Updates `ptr727/ProjectTemplate/.github/workflows/validate-task.yml` from 2.0.1135 to 2.0.1148
- [Release notes](https://github.com/ptr727/projecttemplate/releases)
- [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md)
- [Commits](ptr727/ProjectTemplate@39afd75...f610e42)

Updates `ptr727/ProjectTemplate/.github/workflows/deploy-site-task.yml` from 2.0.1135 to 2.0.1148
- [Release notes](https://github.com/ptr727/projecttemplate/releases)
- [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md)
- [Commits](ptr727/ProjectTemplate@39afd75...f610e42)

Updates `ptr727/ProjectTemplate/.github/workflows/merge-bot-task.yml` from 2.0.1135 to 2.0.1148
- [Release notes](https://github.com/ptr727/projecttemplate/releases)
- [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md)
- [Commits](ptr727/ProjectTemplate@39afd75...f610e42)

Updates `ptr727/ProjectTemplate/.github/workflows/publish-plan-task.yml` from 2.0.1135 to 2.0.1148
- [Release notes](https://github.com/ptr727/projecttemplate/releases)
- [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md)
- [Commits](ptr727/ProjectTemplate@39afd75...f610e42)

Updates `ptr727/ProjectTemplate/.github/workflows/build-release-task.yml` from 2.0.1135 to 2.0.1148
- [Release notes](https://github.com/ptr727/projecttemplate/releases)
- [Changelog](https://github.com/ptr727/ProjectTemplate/blob/main/HISTORY.md)
- [Commits](ptr727/ProjectTemplate@39afd75...f610e42)

---
updated-dependencies:
- dependency-name: ptr727/ProjectTemplate/.github/workflows/validate-task.yml
  dependency-version: 2.0.1148
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
- dependency-name: ptr727/ProjectTemplate/.github/workflows/deploy-site-task.yml
  dependency-version: 2.0.1148
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
- dependency-name: ptr727/ProjectTemplate/.github/workflows/merge-bot-task.yml
  dependency-version: 2.0.1148
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
- dependency-name: ptr727/ProjectTemplate/.github/workflows/publish-plan-task.yml
  dependency-version: 2.0.1148
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
- dependency-name: ptr727/ProjectTemplate/.github/workflows/build-release-task.yml
  dependency-version: 2.0.1148
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Answer --help and Refuse Unknown Arguments in Every Script

Every tracked script now answers --help and -h with its usage on stdout,
exits 0, and refuses an argument it does not recognize, before it reads
anything. make-release.sh checks its arguments before it sources an
environment file, so a flag can no longer start a release.

The checks/ gates and the capture/ scripts parse with argparse. The two
shell scripts in checks/ and deploy/, and run-wp2hugo.sh, check their
own arguments.

checks/tests/test_cli_usage.py discovers every tracked executable and
runs each with --help, -h, and an unknown flag, under stubbed commands
and empty scratch directories, and fails on any effect. A script it
does not classify fails too, so a new one is held to the rule.

Refs #539

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Answer --help Without the Third-Party Modules a Script Needs

redact_media.py and clean_content.py imported Pillow and PyYAML before
parsing, so neither answered --help where its module was absent, and
the checks/ leg of CI, which has neither, would have skipped both on
every run. Each now parses first and reports the missing module after,
so the CLI test runs every script with no skip.

Refs #539

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Name redact_media.py's uv Invocation Once

Both refusals, Pillow missing and Pillow at the wrong pin, now print the
same RUN constant rather than two copies of the command.

Refs #539

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Answer --help After Another Argument in the Shell Scripts

check-live-urls.sh counted its arguments before it looked for --help,
so `extra --help` was refused as an unexpected argument, and
run-wp2hugo.sh looked for --help only in the first position. Both now
answer help wherever it appears, as make-release.sh and every argparse
script already did, and the CLI test runs help after another argument.

Refs #539

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 26, 2026 13:42
@coderabbitai

coderabbitai Bot commented Oct 26, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: bde9e5f5-dc92-4dd2-8b3b-200dc959f19b
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 47.50000% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.98%. Comparing base (9bd721a) to head (b18f7cc).
⚠️ Report is 155 commits behind head on main.

Files with missing lines Patch % Lines
checks/env_docs_gate.py 0.00% 6 Missing ⚠️
scripts/redact_media.py 68.75% 5 Missing ⚠️
checks/media_redactions_gate.py 0.00% 4 Missing ⚠️
checks/url_parity_gate.py 33.33% 4 Missing ⚠️
checks/media_metadata_gate.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #545      +/-   ##
==========================================
- Coverage   54.07%   53.98%   -0.09%     
==========================================
  Files          12       12              
  Lines        3390     3412      +22     
==========================================
+ Hits         1833     1842       +9     
- Misses       1557     1570      +13     
Flag Coverage Δ
python-3.13 53.98% <47.50%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved review issues were identified, and all reviewers assessed the changes as approval-ready.

No open issues 🎉

What changed in this PR

Promotes the completed CLI argument-handling changes and reusable workflow updates to main. Tracked scripts now provide consistent help output and reject unknown arguments before performing work.

Changes:

  • Adds --help, -h, and unknown-argument handling across tracked scripts.
  • Adds executable-wide CLI contract tests covering output, exit codes, side effects, and argument classification.
  • Updates reusable ProjectTemplate workflow pins from 2.0.1135 to 2.0.1148.
File Description
scripts/​redact_media.py Parses arguments before dependency and redaction work.
deploy/​make-release.sh Handles help and invalid arguments before reading deployment configuration.
checks/​url_parity_gate.py Adds structured positional-argument parsing.
checks/​tests/​test_github_env_gate.py Updates tests for the argument-aware gate entry point.
checks/​tests/​test_cli_usage.py Tests CLI behavior for every tracked executable.
checks/​media_redactions_gate.py Adds argument validation before reading the manifest.
checks/​media_metadata_gate.py Adds argument validation before scanning media.
checks/​github_env_gate.py Adds argument validation before accessing GitHub state.
checks/​env_docs_gate.py Defers workflow discovery until after argument parsing.
checks/​check-live-urls.sh Adds help and strict argument validation before URL checks.
capture/​run-wp2hugo.sh Adds early help and rejects unsupported arguments.
capture/​restructure_content.py Replaces ad hoc argument handling with argparse.
capture/​localize_external.py Replaces ad hoc argument handling with argparse.
capture/​enumerate_media.py Parses arguments before reading capture configuration.
capture/​clean_content.py Parses arguments before reporting a missing PyYAML dependency.
capture/​classify.py Parses arguments before reading capture configuration.
capture/​build_redirects.py Adds structured capture-directory and option parsing.
capture/​build_golden.py Parses arguments before reading capture configuration.
.github/​workflows/​test-pull-request.yml Updates the validation workflow pin.
.github/​workflows/​publish-release.yml Updates release planning, validation, and build workflow pins.
.github/​workflows/​merge-bot-pull-request.yml Updates the merge-bot workflow pin.
.github/​workflows/​deploy-site.yml Updates validation and deployment workflow pins.

Review effort: Lite

@ptr727
ptr727 merged commit 2e51a27 into main Oct 26, 2026
13 checks passed
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.

Answer --help and Refuse Unknown Arguments in Every Python Script

2 participants