Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/project-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"project_name": "Sandbox App",
"project_summary": "A new Sandbox Application",
"org_repo_url": "N/A",
"project_repo_url": "https://github.com/OSAS/cncf-sandbox-application-template",
"website_url": "https://github.com/OSAS/cncf-sandbox-application-template",
"repository": "OSAS/cncf-sandbox-application-template",
"bootstrapped_at": "2026-09-23T17:45:39Z"
}
22 changes: 17 additions & 5 deletions .github/workflows/sync-checklist-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ permissions:
jobs:
link-pr-on-checklist:
runs-on: ubuntu-latest
# Skip bot PRs and re-entry after this workflow pushes to the PR branch.
if: >
github.event.pull_request.user.login != 'github-actions[bot]' &&
github.actor != 'github-actions[bot]'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update Issue links to PR links
id: link
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_BODY: ${{ github.event.pull_request.body }}
Expand All @@ -35,6 +41,7 @@ jobs:

if [ -z "${issues}" ]; then
echo "No closing keywords found in PR body; skipping."
echo "changed=false" >> "$GITHUB_OUTPUT"
exit 0
fi

Expand All @@ -45,14 +52,19 @@ jobs:

python3 scripts/update_checklist_progress.py

- name: Commit checklist PR link updates
run: |
if git diff --quiet APPLICATION.md README.md; then
echo "No checklist tracking changes."
exit 0
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Commit checklist PR link updates
if: steps.link.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add APPLICATION.md README.md
git commit -m "docs: link checklist items to PR #${{ github.event.pull_request.number }}"
# [skip ci] reduces noise on hosts that honor it; actor guard above is the real loop break.
git commit -m "docs: link checklist items to PR #${{ github.event.pull_request.number }} [skip ci]"
git push
29 changes: 15 additions & 14 deletions .github/workflows/sync-checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:

permissions:
contents: write
pull-requests: write

jobs:
sync-checklist:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'checklist-item')
# Ignore closes caused by bot sync noise; only checklist-item issues.
if: >
contains(github.event.issue.labels.*.name, 'checklist-item') &&
github.event.issue.user.type != 'Bot'
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -32,7 +34,7 @@ jobs:
echo "found=true" >> "$GITHUB_OUTPUT"
echo "Syncing checklist item: $slug (issue #${{ github.event.issue.number }})"

- name: Update APPLICATION.md checkbox
- name: Mark checkbox complete and update progress
if: steps.slug.outputs.found == 'true'
id: update
env:
Expand All @@ -47,15 +49,14 @@ jobs:
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Create pull request with checklist update
# Commit directly to main. Do not open a follow-up bot PR — that re-triggers
# pull_request workflows and produces approval/noise cascades.
# Commits made with GITHUB_TOKEN do not start new workflow runs.
- name: Commit checklist update to main
if: steps.update.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v6
with:
commit-message: "docs: mark checklist item ${{ steps.slug.outputs.slug }} complete"
title: "docs: sync checklist — ${{ steps.slug.outputs.slug }}"
body: |
Automatically updates [APPLICATION.md](APPLICATION.md) and [README.md](README.md) after checklist issue #${{ github.event.issue.number }} was closed.

Closes checklist item: `${{ steps.slug.outputs.slug }}`
branch: bot/sync-checklist-${{ steps.slug.outputs.slug }}-${{ github.event.issue.number }}
delete-branch: true
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add APPLICATION.md README.md
git commit -m "docs: mark checklist item ${{ steps.slug.outputs.slug }} complete"
git push origin HEAD:main
15 changes: 14 additions & 1 deletion .github/workflows/validate-pr-closes-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Validate PR closes checklist issues

on:
pull_request:
types: [opened, edited, synchronize, reopened]
types: [opened, edited, reopened]

permissions:
issues: write
Expand All @@ -11,6 +11,7 @@ permissions:
jobs:
comment-missing-closes:
runs-on: ubuntu-latest
if: github.event.pull_request.user.login != 'github-actions[bot]'
steps:
- name: Check for closing keywords
uses: actions/github-script@v7
Expand All @@ -25,11 +26,23 @@ jobs:
return;
}

const marker = '<!-- checklist-closes-reminder -->';
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
});
if (comments.some(c => c.body && c.body.includes(marker))) {
core.info('Reminder comment already present; skipping.');
return;
}

await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
body: [
marker,
'### Checklist reminder',
'',
'This PR does not reference any checklist issues with closing keywords.',
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ 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.
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 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 opens a PR.
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).

### 5. Submit to CNCF

Expand Down
67 changes: 35 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,43 @@ This repository helps you prepare a [CNCF Sandbox application](https://github.co

**Edit [APPLICATION.md](APPLICATION.md) only** for checklist answers and form content. This README shows progress and mirrors checklist issue/PR links (updated by automation).

## Quick start

1. Click **Use this template** to create your own copy of this repository.
2. Clone and bootstrap checklist issues:

```bash
git clone git@github.com:YOUR_ORG/YOUR_REPO.git
cd YOUR_REPO
./scripts/bootstrap-issues.sh
```

3. Commit bootstrap changes and push.
4. Work in **[APPLICATION.md](APPLICATION.md)** only:
1. complete **Your answer** section
2. Open a PR with `Closes #N` (issue link is on the checklist line)
3. make sure you add the proper `field_id` to `Application fields updated` section: e.g. `project_summary`, `maintainers_file`.
5. When every item is complete:

```bash
./scripts/generate-submission.sh --validate
./scripts/generate-submission.sh --create-issue
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow.

## How tracking works

| 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 |

## Application progress

<!-- checklist-progress:start -->
> **Application progress:** **0 / 33** items complete (0%)
> **Application progress:** **0 / 33** items complete (0%)
> `░░░░░░░░░░░░░░░░░░░░` 0%
<!-- checklist-progress:end -->

Expand All @@ -22,7 +55,7 @@ This repository helps you prepare a [CNCF Sandbox application](https://github.co
Each row links to the matching section in [APPLICATION.md](APPLICATION.md). `(Issue: …)` becomes `(PR: …)` when you open a pull request with `Closes #N`.

<!-- application-dashboard:start -->
### [read_prerequisites](APPLICATION.md#read_prerequisites)
### [Read Prerequisites](APPLICATION.md#read_prerequisites)

- [ ] Reviewed all prerequisite documentation <!-- checklist:read-prerequisites --> (Issue: #ISSUE_READ_PREREQUISITES)

Expand Down Expand Up @@ -167,36 +200,6 @@ Each row links to the matching section in [APPLICATION.md](APPLICATION.md). `(Is
- [ ] Final review complete and application submitted to CNCF <!-- checklist:final-review --> (Issue: #ISSUE_FINAL_REVIEW)
<!-- application-dashboard:end -->

## Quick start

1. Click **Use this template** to create your own copy of this repository.
2. Clone and bootstrap checklist issues:

```bash
git clone git@github.com:YOUR_ORG/YOUR_REPO.git
cd YOUR_REPO
./scripts/bootstrap-issues.sh
```

3. Commit bootstrap changes and push.
4. Work in **[APPLICATION.md](APPLICATION.md)** only: complete **Your answer**, open a PR with `Closes #N` (issue link is on the checklist line).
5. When every item is complete:

```bash
./scripts/generate-submission.sh --validate
./scripts/generate-submission.sh --create-issue
```

See [CONTRIBUTING.md](CONTRIBUTING.md) for the full workflow.

## How tracking works

| 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 |

## References

- [CNCF Sandbox repository](https://github.com/cncf/sandbox)
Expand Down
11 changes: 10 additions & 1 deletion scripts/apply_project_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,28 @@ def section_prefix_lines(section_lines: List[str]) -> List[str]:
"""Preserve static guide blocks and checklist lines at the top of a section."""
idx = 0
preserved: List[str] = []

# Sections usually start with a blank line after the ## heading.
while idx < len(section_lines) and section_lines[idx].strip() == "":
preserved.append(section_lines[idx])
idx += 1

if idx < len(section_lines) and section_lines[idx].strip() == "<!-- field-guide:start -->":
while idx < len(section_lines):
preserved.append(section_lines[idx])
if section_lines[idx].strip() == "<!-- field-guide:end -->":
idx += 1
break
idx += 1

while idx < len(section_lines) and section_lines[idx].strip() == "":
preserved.append(section_lines[idx])
idx += 1

while idx < len(section_lines) and CHECKLIST_LINE.match(section_lines[idx]):
preserved.append(section_lines[idx])
idx += 1

if idx < len(section_lines) and section_lines[idx].strip() == "":
preserved.append(section_lines[idx])
return preserved
Expand Down Expand Up @@ -69,7 +78,7 @@ def update_readme(content: str, metadata: Dict[str, str]) -> str:
f"> **Project name:** {project_name}",
)
content = content.replace(
"> **Checklist issues created:** Run `./scripts/bootstrap-issues.sh` after creating your repo from this template.",
"> **Checklist issues:** Run `./scripts/bootstrap-issues.sh` after creating your repo from this template.",
"> **Checklist issues:** Bootstrapped",
)
content = re.sub(
Expand Down
36 changes: 27 additions & 9 deletions scripts/bootstrap-issues.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,20 +236,38 @@ reverse_lines() {
}

build_checklist_order() {
grep -oE 'checklist:[a-z0-9-]+' "${CHECKLIST_FILE}" \
| sed 's/checklist://' \
# Prefer HTML comment markers so prose mentions of "checklist:" are ignored.
grep -oE '<!-- checklist:[a-z0-9-]+ -->' "${CHECKLIST_FILE}" \
| sed -E 's/<!-- checklist:([a-z0-9-]+) -->/\1/' \
| awk '!seen[$0]++' > "${SLUGS_ORDERED_FILE}"
}

validate_checklist_order() {
local map_slugs app_slugs
map_slugs="$(jq -r 'keys[]' "${MAP_FILE}" | sort)"
app_slugs="$(sort "${SLUGS_ORDERED_FILE}")"
if [[ "${map_slugs}" != "${app_slugs}" ]]; then
echo "Error: checklist slugs in APPLICATION.md do not match checklist-map.json" >&2
comm -3 <<< "${map_slugs}" <<< "${app_slugs}" | sed 's/^/ /' >&2
exit 1
local map_file app_file only_map only_app
map_file="$(mktemp)"
app_file="$(mktemp)"
jq -r 'keys[]' "${MAP_FILE}" | LC_ALL=C sort > "${map_file}"
LC_ALL=C sort "${SLUGS_ORDERED_FILE}" > "${app_file}"

if cmp -s "${map_file}" "${app_file}"; then
rm -f "${map_file}" "${app_file}"
return 0
fi

only_map="$(comm -23 "${map_file}" "${app_file}" || true)"
only_app="$(comm -13 "${map_file}" "${app_file}" || true)"
rm -f "${map_file}" "${app_file}"

echo "Error: checklist slugs in APPLICATION.md do not match checklist-map.json" >&2
if [[ -n "${only_map}" ]]; then
echo " Present in checklist-map.json but missing from APPLICATION.md:" >&2
sed 's/^/ - /' <<< "${only_map}" >&2
fi
if [[ -n "${only_app}" ]]; then
echo " Present in APPLICATION.md but missing from checklist-map.json:" >&2
sed 's/^/ - /' <<< "${only_app}" >&2
fi
exit 1
}

ensure_labels() {
Expand Down
Loading