diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7be5f03..222876e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,12 +4,14 @@ ## Checklist items - + Closes # ## Application fields updated - + -- [ ] See [APPLICATION.md](../APPLICATION.md) — list field IDs here, e.g. `project_summary`, `maintainers_file` +- `field_id` diff --git a/.gitignore b/.gitignore index 1e49fa4..5d126fa 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ .env .env.* .vscode/ -CNCF-SUBMISSION.md \ No newline at end of file +CNCF-SUBMISSION.md +__pycache__/ +scripts/__pycache__/ diff --git a/APPLICATION.md b/APPLICATION.md index e69ae1e..b55430b 100644 --- a/APPLICATION.md +++ b/APPLICATION.md @@ -2,7 +2,7 @@ Single source of truth for the CNCF sandbox application. Each `## field_id` section maps to the [official CNCF application form](https://github.com/cncf/sandbox/blob/main/.github/ISSUE_TEMPLATE/application.yml). -**Work here only:** Each checklist line shows `(Issue: …)` until you open a PR; automation then shows `(PR: …)` in this file and in [README.md](README.md). Edit answers below; do not edit README for application content. +**Work here only:** Each checklist line shows `(Issue: …)` until you open a PR with `Closes #N`; automation then checks the box and shows `(PR: …)` here and in [README.md](README.md). Edit answers below; do not edit README or toggle checklist boxes yourself. Run `./scripts/generate-submission.sh` when ready to submit to CNCF. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ccc20f..92346bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,7 +24,7 @@ Each section includes: - A checklist line with `(Issue: [#N](…))` (after bootstrap) - A **Your answer** area for form content -Pick an issue, edit the relevant section(s) in `APPLICATION.md`, and open a pull request with `Closes #N`. Automation updates the checklist line to `(PR: [#…](…))` in **both** `APPLICATION.md` and [README.md](README.md). **Do not edit README** for answers or tracking. +Pick an issue, edit the relevant section(s) in `APPLICATION.md`, and open a pull request with `Closes #N`. Do **not** manually check the checklist box — automation marks it `[x]` and updates `(PR: …)` in **both** `APPLICATION.md` and [README.md](README.md). **Do not edit README** for answers or tracking. Progress lives in README only; it updates when checklist boxes are checked after issues close. @@ -42,9 +42,13 @@ When the PR merges to the default branch, GitHub closes the linked issue automat ### 4. Checklist sync -The [sync-checklist-pr workflow](.github/workflows/sync-checklist-pr.yml) runs when you open or update a PR with `Closes #N`, replacing `(Issue: …)` with `(PR: …)` in `APPLICATION.md` and README (on your PR branch). +The [sync-checklist-pr workflow](.github/workflows/sync-checklist-pr.yml) runs when you open or update a PR with `Closes #N`. On your PR branch it: -The [sync-checklist workflow](.github/workflows/sync-checklist.yml) runs when a checklist issue is closed. It checks the box in `APPLICATION.md`, refreshes the README dashboard and progress bar, and **commits directly to `main`** (no follow-up bot PR). +1. Replaces `(Issue: …)` with `(PR: …)` +2. Checks the box (`[x]`) in `APPLICATION.md` +3. Mirrors those lines and refreshes progress in README + +The [sync-checklist workflow](.github/workflows/sync-checklist.yml) is a fallback when a checklist issue is closed (e.g. if the PR link step did not run). It checks the box on `main` if needed. ### 5. Submit to CNCF diff --git a/README.md b/README.md index 701400c..ad26098 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow. | Stage | Checklist line shows | | --- | --- | -| After bootstrap | `(Issue: [#N](…))` — open GitHub issue | -| After you open a PR with `Closes #N` | `(PR: [#N](…))` — in APPLICATION.md and this README | -| After the PR merges | Checkbox `[x]`; issue closes | +| After bootstrap | `- [ ] … (Issue: [#N](…))` | +| After you open a PR with `Closes #N` | `- [x] … (PR: [#M](…))` in APPLICATION.md and this README | +| After the PR merges | Issue closes; progress on `main` matches | ## Application progress @@ -52,7 +52,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow. ## Application checklist -Each row links to the matching section in [APPLICATION.md](APPLICATION.md). `(Issue: …)` becomes `(PR: …)` when you open a pull request with `Closes #N`. +Each row links to the matching section in [APPLICATION.md](APPLICATION.md). A PR with `Closes #N` checks the box and switches `(Issue: …)` to `(PR: …)` automatically — do not edit these lines by hand. ### [Read Prerequisites](APPLICATION.md#read_prerequisites) diff --git a/scripts/checklist_tracking.py b/scripts/checklist_tracking.py index 673b304..b756683 100644 --- a/scripts/checklist_tracking.py +++ b/scripts/checklist_tracking.py @@ -180,18 +180,20 @@ def update_files_for_pr(root: Path, repo: str, pr_number: int, issue_numbers: Li registry_path = root / ".github" / "issue-registry.json" registry = load_issue_registry(registry_path) application_path = root / "APPLICATION.md" - readme_path = root / "README.md" - application = application_path.read_text(encoding="utf-8") + before = application_path.read_text(encoding="utf-8") + application = before changed_slugs: List[str] = [] for issue_number in issue_numbers: slug = slug_for_issue(registry, issue_number) if not slug: continue + # Closes #N is enough: swap Issue→PR and check the box. README mirrors APPLICATION.md. application = apply_pr_link(application, slug, pr_number, repo) + application = mark_checkbox_complete(application, slug) changed_slugs.append(slug) - if not changed_slugs: + if not changed_slugs or application == before: return False, [] application_path.write_text(application, encoding="utf-8") @@ -237,7 +239,7 @@ def main() -> int: if not changed: print("No checklist lines updated for PR", file=sys.stderr) return 0 - print(f"Updated PR links for: {', '.join(slugs)}") + print(f"Updated PR links and checked boxes for: {', '.join(slugs)}") return 0 if args.command == "sync-readme": diff --git a/scripts/render_application_template.py b/scripts/render_application_template.py index 79ecb8e..9773931 100644 --- a/scripts/render_application_template.py +++ b/scripts/render_application_template.py @@ -45,7 +45,7 @@ def render() -> str: "", "Single source of truth for the CNCF sandbox application. Each `## field_id` section maps to the [official CNCF application form](https://github.com/cncf/sandbox/blob/main/.github/ISSUE_TEMPLATE/application.yml).", "", - "**Work here only:** Each checklist line shows `(Issue: …)` until you open a PR; automation then shows `(PR: …)` in this file and in [README.md](README.md). Edit answers below; do not edit README for application content.", + "**Work here only:** Each checklist line shows `(Issue: …)` until you open a PR with `Closes #N`; automation then checks the box and shows `(PR: …)` here and in [README.md](README.md). Edit answers below; do not edit README or toggle checklist boxes yourself.", "", "Run `./scripts/generate-submission.sh` when ready to submit to CNCF.", "",