mirror of
https://github.com/penpot/penpot.git
synced 2026-11-26 21:00:32 +00:00
📚 Simplify issue and changelog memories
Keep policy, recovery, and release ordering in the workflow memories. Use the command help for option details and distinguish preview, local writes, and GitHub mutations. AI-assisted-by: gpt-6.2-sol
This commit is contained in:
parent
e23901a36f
commit
3a1f17834e
@ -1,24 +1,7 @@
|
||||
# Changelog helper
|
||||
|
||||
`scripts/changelog.py` holds the checks used by the changelog flow. The rules and the step-by-step live in `mem:workflow/updating-changelog`; this memory documents the subcommands. Calls `scripts/gh.py` via subprocess; never call the GitHub API directly from this script.
|
||||
Use `python3 scripts/changelog.py <subcommand> --help` for current CLI options. For release policy, eligibility and approval order see `mem:workflow/updating-changelog`.
|
||||
|
||||
## Subcommands
|
||||
|
||||
- `collect <MILESTONE> [--changes CHANGES.md]` — read-only. Prints JSON to stdout with all milestone `issues` and `prs`, `eligible_issues` (issue numbers), `related_issues` and `related_prs` resolved in batches, `breaking_notes` keyed by issue number, `advisories`, `security_prs` keyed by GHSA, `dev_only_bugs` (`auto` and `suggested`), and `comparison` against the current changelog (references, missing and ineligible issues, cross-version duplicates, unlisted merged PRs). A missing version section is valid. Keep the snapshot private; it can contain unpublished advisories and PR text. See `mem:workflow/updating-changelog` for when to refresh it.
|
||||
- `boom`, `security`, `cross-ref`, `dev-only-bugs` and `report` accept `--snapshot <FILE>` to reuse GitHub data from `collect` for the same milestone. `cross-ref` and `report` still read the current changelog; `--write`, `--apply` and `report` retain their existing write behavior. Without a snapshot, commands query GitHub as before.
|
||||
- `check-merged <PR...>` (`--file`, `--stdin` accepted) — warn on any non-merged PR, exit 1 when found; run before writing changelog entries.
|
||||
- `boom <MILESTONE> [--changes CHANGES.md --write]` — generate `### :boom: Breaking changes & Deprecations` from the closed, non-excluded milestone issues labelled `breaking change`, sorted by issue number. Each issue becomes a `#### <issue title>` block: content = body of the issue's last `## Breaking change note` comment (whole markdown, headings demoted to `#####` outside code fences; fallback = heading plus refs with a stderr warning), refs = issue link plus merged closing PRs on their own line, with `(by @author)` for `community contribution`. `--write` replaces only that subsection of the version, inserts it after the version header when needed, and removes it when there are no entries. Print-only by default. Uses `gh.py comments`.
|
||||
- `security <MILESTONE> [--changes CHANGES.md --write]` — generate `### :lock: Security fixes` from the advisories whose `patched_versions` include the version (via `gh.py advisories --patched-version`), sorted by GHSA id. Entry: `- Fix <description> (<advisory URL>) (PR: [#N](...))`; description = `Fix` + advisory summary, first word decapitalized unless it starts with an acronym; PRs = merged milestone PRs labelled `pr pt` whose body contains the GHSA id, comma-separated, and no PR is legal. Warns on stderr when a `pr pt` PR references an advisory with no matching `patched_versions`. `--write` replaces only that subsection, placed after `:rocket:` (or `:boom:`, or the version header when neither exists); empty entries remove the subsection; idempotent. Print-only by default.
|
||||
- `cross-ref <MILESTONE> [--changes CHANGES.md]` — fetch milestone PRs with `--state all` once, report merged PRs missing from the version section plus CLOSED (unmerged) warnings. PR links inside `:lock:` entries count as referenced; advisory URLs never appear here by design.
|
||||
- `dev-only-bugs <MILESTONE> [--apply]` — list closed milestone bugs that never reached production, without `no changelog`. Sure: parent issue is a `Feature`/`Enhancement` of the same milestone; `--apply` adds `no changelog` to these only and prints each successful edit to stdout with its issue URL and reason. On failure it exits nonzero and names the failed issue on stderr; earlier confirmations remain visible. Candidates (never labelled automatically): parent is an epic of the milestone, `regression` label, or the "Affected versions" / "Environment" body field names only hourly, develop, staging, PRE or the milestone version itself (`only_unreleased_envs`; any production hint or other version keeps the bug in — versions compare as full semver with missing patch = 0, so for milestone 2.19.2 the released 2.19.0 keeps the bug in). Reads `body` and `parent` from one batched `gh.py issue` lookup.
|
||||
- `report <MILESTONE> [--changes CHANGES.md --output CHANGES-ISSUES.md]` — overwrite the anomaly report: A/B milestone mismatches, E `:boom:` entry without the label, F `:rocket:` sync, G `:boom:` sync, plus the C/D `:rocket:` gaps and the `dev-only-bugs` lists (warnings). `:boom:`/`:rocket:` rule violations are fixed by regenerating or relabelling, not by editing entries in place.
|
||||
|
||||
## Conventions
|
||||
|
||||
- Milestone resolution is batched, never per-item: unknown PRs go through `gh.py prs <numbers>` and unknown issues through `gh.py issue <numbers>` (one GraphQL call per 50 items); a lookup miss resolves to null, never to an extra call.
|
||||
|
||||
- Version-section lookup accepts an optional `(suffix)` after the version header (e.g. `(Unreleased)`); a missing section is an error for `cross-ref` and an empty section for `report`.
|
||||
- PR/issue reference parsing covers standard `[#N](.../pull/N)` / `[#N](.../issues/N)` links plus legacy `PR:[N]` / `[Github #N]` forms.
|
||||
- Shared parsing helpers (`extract_version_section`, `extract_subsection`, `collect_changelog_prs/issues`) live at module top so future subcommands reuse them instead of duplicating regexes.
|
||||
- Report anomaly types: A/B milestone mismatches, E `:boom:` entry whose issue lacks the `breaking change` label (counted, entries preserved — human labels the issue or moves the entry), G `breaking change` issue missing from `:boom:` (counted, same contract as F); C/D are `:rocket:` gaps (warnings, never counted).
|
||||
- `issue_excluded` (closed, non-Task, non-Rejected, no `no changelog` label) is module-level and shared by `report` and `boom` so the exclusions cannot drift. `release blocker` is not a changelog exclusion.
|
||||
- `collect` reads GitHub and the local changelog and prints a JSON snapshot; the snapshot can include unpublished release or security material. The consuming commands accept `--snapshot` for the same milestone. `cross-ref` and `report` still read the current changelog; `report` can query GitHub for additional references missing from the snapshot.
|
||||
- `boom` and `security` print by default. `--write` replaces or removes their named subsection only. `cross-ref` checks the version section without writing; `report` overwrites the report file even without a write flag. `dev-only-bugs --apply` is a GitHub write, not a report option.
|
||||
- Keep version lookup, reference parsing and eligibility shared across commands. Do not replace link-aware matching with bare issue numbers; legacy links are still supported. Batch unknown references through `scripts/gh.py`; keep queries out of per-entry loops.
|
||||
|
||||
@ -1,167 +1,8 @@
|
||||
# GitHub operations helper
|
||||
# GitHub helper
|
||||
|
||||
`scripts/gh.py` is a multi-purpose CLI for querying the penpot/penpot GitHub
|
||||
repository via GraphQL and REST APIs through the authenticated `gh` CLI.
|
||||
Use authenticated `gh` with `python3 scripts/gh.py <subcommand> --help` for current options. Structured results go to stdout; progress and errors go to stderr.
|
||||
|
||||
## When to use
|
||||
|
||||
- Listing issues in a milestone (for changelog generation).
|
||||
- Finding issues with no milestone.
|
||||
- Fetching PR details by number or by milestone.
|
||||
- Comparing milestone issues against CHANGES.md to find missing entries.
|
||||
- Explicitly linking a GitHub issue to a pull request.
|
||||
- Creating an issue with its Issue Type set in a single command.
|
||||
- Listing or inspecting GitHub Security Advisories (GHSA).
|
||||
- Fetching issue comments (the `## Breaking change note` markdown for the changelog).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- `gh` CLI authenticated (`gh auth status`).
|
||||
- Python 3.8+.
|
||||
|
||||
## Subcommands
|
||||
|
||||
### `issues`
|
||||
|
||||
List issues in a milestone, with filtering by state, labels, and project status.
|
||||
|
||||
```bash
|
||||
# Closed issues in a milestone (default)
|
||||
python3 scripts/gh.py issues "2.16.0"
|
||||
|
||||
# All issues in a milestone
|
||||
python3 scripts/gh.py issues "2.16.0" --state all
|
||||
|
||||
# Issues with no milestone
|
||||
python3 scripts/gh.py issues none
|
||||
python3 scripts/gh.py issues none --state open
|
||||
|
||||
# Filter by label (include only)
|
||||
python3 scripts/gh.py issues "2.16.0" --label "bug"
|
||||
python3 scripts/gh.py issues "2.16.0" --label "bug,regression"
|
||||
|
||||
# Exclude by label
|
||||
python3 scripts/gh.py issues "2.16.0" --exclude "no changelog"
|
||||
|
||||
# Show only issues NOT yet in CHANGES.md
|
||||
python3 scripts/gh.py issues "2.16.0" --compare CHANGES.md
|
||||
```
|
||||
|
||||
**Default filters** (override with flags):
|
||||
- Issues with type "Task" are excluded (`--include-tasks` to keep them).
|
||||
- Issues with "Rejected" project status are excluded (`--include-rejected` to keep them).
|
||||
|
||||
Every issue entry carries `assignees` (logins) and `projects` (board titles); every PR entry carries `assignees`.
|
||||
|
||||
**Output**: JSON array to stdout; progress to stderr.
|
||||
|
||||
### `prs`
|
||||
|
||||
Fetch PR details by number or by milestone. Every entry includes a `milestone` field (title or null).
|
||||
|
||||
```bash
|
||||
# Fetch specific PRs
|
||||
python3 scripts/gh.py prs 9179 9204 9311
|
||||
|
||||
# Read PR numbers from file
|
||||
python3 scripts/gh.py prs --file prs.txt
|
||||
|
||||
# Read PR numbers from stdin
|
||||
cat prs.txt | python3 scripts/gh.py prs --stdin
|
||||
|
||||
# All PRs in a milestone (default: merged only)
|
||||
python3 scripts/gh.py prs --milestone "2.16.0"
|
||||
|
||||
# All PRs in a milestone (all states)
|
||||
python3 scripts/gh.py prs --milestone "2.16.0" --state all
|
||||
```
|
||||
|
||||
**Output**: JSON array to stdout; progress to stderr.
|
||||
|
||||
### `issue`
|
||||
|
||||
Fetch issue details by number in batches of 50 (same input styles as `prs`: numbers, `--file`, `--stdin`). No filters. A dead number fails its whole batch (unlike PRs, issues error instead of resolving to null), so the batch falls back to one-by-one lookups and reports misses as `{"number", "error": "not_found"}`. Any other failure aborts.
|
||||
|
||||
**Output**: JSON array to stdout; progress to stderr. Each issue carries the shared issue fields plus `body` and `parent` (`number`, `issue_type`, `milestone`, or null); `changelog.py dev-only-bugs` reads both.
|
||||
|
||||
### `comments`
|
||||
|
||||
Fetch every comment of one or more issues via REST (paginated, 100 per page), oldest first. Same input styles as `issue`: numbers, `--file`, `--stdin`.
|
||||
|
||||
```bash
|
||||
python3 scripts/gh.py comments 11235 11236
|
||||
```
|
||||
|
||||
**Output fields per comment**: `issue`, `id`, `author`, `created_at`, `body`. JSON array to stdout; progress to stderr. `changelog.py boom` reads the `## Breaking change note` comment from this output.
|
||||
|
||||
### `link-issue`
|
||||
|
||||
Explicitly assign a GitHub issue to a pull request:
|
||||
|
||||
```bash
|
||||
python3 scripts/gh.py link-issue <ISSUE_NUMBER> <PR_NUMBER>
|
||||
# Short alias: python3 scripts/gh.py link <ISSUE_NUMBER> <PR_NUMBER>
|
||||
```
|
||||
|
||||
The command resolves both node IDs and calls `addCloseIssueReferences`. It trusts the successful mutation instead of re-querying, because GitHub does not reliably report mutation-created links through `closedByPullRequestsReferences(userLinkedOnly: true)`. It is safe to rerun and works for merged PRs. It does not guarantee the issue stays open: adding `Closes #N` to the body of an already-merged PR closed the issue immediately when tried (#12896 / PR #12067, 2026-11-09). JSON goes to stdout; progress and errors go to stderr; a missing issue/PR or a failed mutation exits non-zero.
|
||||
|
||||
### `create-issue`
|
||||
|
||||
Create an issue and set its Issue Type in one command. `gh issue create` cannot set the type, so the script runs `gh issue create` (always with `--project Main` by default) and then two GraphQL calls: one to get the issue's node ID and one `updateIssue` mutation to set the type. The issue number is parsed from the URL returned by `gh issue create`.
|
||||
|
||||
```bash
|
||||
python3 scripts/gh.py create-issue \
|
||||
--type task \
|
||||
--title "Expand backend email tests" \
|
||||
--body-file /tmp/issue-body.md
|
||||
|
||||
# Optional label (comma-separated); no --milestone (set it later if needed)
|
||||
python3 scripts/gh.py create-issue --type bug --title "..." \
|
||||
--body-file /tmp/issue-body.md --label "breaking change"
|
||||
```
|
||||
|
||||
`--type` is a name from the Issue Type table in `mem:workflow/creating-issues` (`bug`, `enhancement`, `feature`, `task`, `question`, `docs`, `epic`); it is case-insensitive and the ID mapping lives in `ISSUE_TYPE_IDS` in `scripts/gh.py`. The command prints JSON with `number`, `url`, `title` and `issue_type` to stdout, and progress to stderr. If the type assignment fails after creation, the issue is left in place and the error reports its number and URL so it can be fixed by hand. This shortcut does not replace the workflow in `mem:workflow/creating-issues`: title derivation, body templates and verification still follow that memory.
|
||||
|
||||
**Output**: JSON object on stdout; progress and errors on stderr. A bad type, a `gh` failure, or a type that was not applied exits non-zero.
|
||||
|
||||
### `advisories`
|
||||
|
||||
List or inspect GitHub Security Advisories for the repository.
|
||||
|
||||
```bash
|
||||
# List all advisories (summary view)
|
||||
python3 scripts/gh.py advisories
|
||||
|
||||
# Filter by severity
|
||||
python3 scripts/gh.py advisories --severity critical
|
||||
|
||||
# Filter by state
|
||||
python3 scripts/gh.py advisories --state triage
|
||||
|
||||
# Filter by patched version declared in the advisory
|
||||
python3 scripts/gh.py advisories --patched-version 2.19.1
|
||||
|
||||
# Get full detail for a single advisory
|
||||
python3 scripts/gh.py advisories GHSA-xvj6-fh9w-gjw7
|
||||
```
|
||||
|
||||
**Summary output fields**: ghsa_id, cve_id, severity, cvss_score, state, summary, cwes, published_at, closed_at, url.
|
||||
|
||||
**Detail output** (single advisory) adds: description, vulnerabilities (package, version ranges), credits, timestamps.
|
||||
|
||||
`--patched-version` filters the raw advisories before formatting: the match is an exact token of `vulnerabilities[*].patched_versions` (split on `,`/`;`), so `2.19.1` never matches `2.19.10`. Every state is included (`triage`, `draft`, `published`, `closed`, `withdrawn`). The raw `vulnerabilities` stay internal to the filter: the list output keeps the summary schema.
|
||||
|
||||
The repository security-advisories endpoint uses cursor pagination (`before`/`after`), not numeric `page` pagination. Observed failure: `page=1` and `page=2` both returned the same 100 advisories, so a length-based loop never ended. `fetch_advisories` must use `gh api --paginate --slurp` so the GitHub CLI follows the response `Link` headers and returns page arrays for flattening. Do not hand-increment `page`.
|
||||
|
||||
**Output**: JSON to stdout; progress to stderr.
|
||||
|
||||
## Key principles
|
||||
|
||||
- `issues --compare` collects every `#NNNN` token in the file regardless of its link target, so a same-numbered reference to another tracker (e.g. `[Taiga #12312](...)`) or an inline prose number falsely marks that GitHub issue as already listed; verify against `changelog.py cross-ref` when a number collides.
|
||||
- Changelog-specific checks (merge-status verification, milestone-vs-changelog cross-reference, anomaly report) live in `scripts/changelog.py`, which calls this script via subprocess — see `mem:scripts/changelog`.
|
||||
|
||||
- All output is JSON — pipe into `jq` or other tools for further processing.
|
||||
- Transient HTTP 504 responses from `gh` are retried automatically (3 attempts, 5s/15s backoff); any other error fails fast with no retry.
|
||||
- Milestone lookup is by exact title match.
|
||||
- `issues` subcommand auto-paginates (100 items per page).
|
||||
- `prs` subcommand batches PR number lookups (50 per GraphQL query).
|
||||
- `issues` lists issues by milestone (exact title) or with no milestone; milestone queries default to closed issues. `issue` and `comments` fetch issue details and comments. `prs` fetches specific PRs or lists a milestone (merged only by default); request all states when auditing unmerged PRs.
|
||||
- `create-issue` creates the issue and then sets its Issue Type; this is not atomic. For authorization, metadata, and recovery after a partial creation, read `mem:workflow/creating-issues`. `link-issue` sets the Development association, not the PR body; follow `mem:workflow/creating-prs`. The helper trusts the successful mutation because GitHub's link readback can omit mutation-created links.
|
||||
- `advisories` lists or inspects repo advisories. Patched-version matching compares exact tokens, not prefixes, and does not require publication. The endpoint uses cursor pagination: use `gh api --paginate --slurp`, not numeric pages, which can repeat the same data.
|
||||
- `issues --compare` can mistake a same-numbered Taiga reference or prose token for a GitHub issue. Use the changelog-specific reconciliation in `mem:scripts/changelog` when reference targets matter.
|
||||
|
||||
@ -1,432 +1,51 @@
|
||||
# Creating Issues
|
||||
|
||||
Create GitHub issues only on explicit request. Use `gh` CLI authenticated to `penpot/penpot`.
|
||||
Create or edit issues only when authorized. Follow `AGENTS.md` and use authenticated `gh` for `penpot/penpot`.
|
||||
|
||||
## Title Derivation
|
||||
|
||||
Derive the title from the source material (bug report, user feedback, feature request, etc.) — not from any pre-existing title which may be auto-generated or stale.
|
||||
|
||||
### Bug titles (descriptive present tense)
|
||||
|
||||
Describe the symptom as it appears to the user. Format: `[Where] [present-tense verb] when [condition]`.
|
||||
|
||||
- *"Plugin API crashes when setting text fills"*
|
||||
- *"Canvas renders glitches when zooming quickly"*
|
||||
- *"French Canada locale falls back to French (fr) translations"*
|
||||
|
||||
Do **not** start bug titles with "Fix" or any imperative verb — state what's broken, not command a fix.
|
||||
|
||||
### Feature / Enhancement titles (imperative mood)
|
||||
|
||||
Command what should be built. Format: `[Imperative verb] [what] in/on [where]`.
|
||||
|
||||
- *"Add customizable dash and gap length controls to dashed strokes in the sidebar"*
|
||||
- *"Show user, timestamp, and hash in the workspace history panel like git commits"*
|
||||
|
||||
### Universal rules
|
||||
|
||||
- **Include the "where"** — specify the UI location or module (e.g. "in the sidebar", "on the stroke options")
|
||||
- **No prefixes** — strip `bug:`, `feature:`, `feat:`, `:bug:`, `:sparkles:`, `[PENPOT FEEDBACK]`, etc.
|
||||
- **No emoji** — plain text only
|
||||
- **Be specific** — prefer concrete detail over generality
|
||||
- **Two problems → cover both** — if the description has two distinct but related issues, capture both joined by "and"
|
||||
|
||||
## Metadata
|
||||
|
||||
| Field | Rule |
|
||||
|-------|------|
|
||||
| **Labels** | `community contribution` (PRs from non-core) · `breaking change` when the change breaks compatibility (see below) · skip workflow labels (`backport candidate`, `team-qa`) · do **not** add `bug` or `enhancement` labels (use Issue Type instead) |
|
||||
| **Milestone** | Use the current or next planned milestone. Fetch available milestones: `gh api repos/penpot/penpot/milestones --jq '.[].title'`. If unsure, omit. |
|
||||
| **Project** | Always `Main` (project number 8). Use `--project "Main"` flag. |
|
||||
| **Issue Type** | See Issue Type section below. Cannot be set via `gh issue create` — use GraphQL after creation. |
|
||||
|
||||
## Breaking changes
|
||||
|
||||
When the issue introduces a breaking change or a deprecation, it is the unit
|
||||
`mem:workflow/updating-changelog` turns into a block under
|
||||
`### :boom: Breaking changes & Deprecations`. The section is generated from
|
||||
the issue (`scripts/changelog.py boom`), so the issue must carry both:
|
||||
|
||||
1. The `breaking change` label.
|
||||
2. A `## Breaking change note` **comment** (not a body section). Everything
|
||||
after that marker line is copied to the changelog: paragraphs, bullet
|
||||
lists, code blocks and headings are kept (headings are demoted to level 5
|
||||
in `CHANGES.md`). Write it for self-hosters: what changes, what they must
|
||||
do, and what breaks if they do nothing. Keep it short: explain the
|
||||
implications and link the runbook or docs for the detail, never paste the
|
||||
runbook itself. Links must point to a long-lived branch (`staging` or
|
||||
`main`), never to a feature branch.
|
||||
|
||||
Post the note as a new comment. Do not add a breaking-change section to the
|
||||
issue body and do not hand-write the changelog block. When the issue comes
|
||||
from a PR, reuse the text of the PR's breaking-change section.
|
||||
Do not hard-wrap the note: one line per paragraph or bullet.
|
||||
|
||||
The full changelog rules (sections, exclusions, `:rocket:`, pre-flight and
|
||||
anomaly report) live in `mem:workflow/updating-changelog`.
|
||||
- Derive the title from the source material, not from a copied or auto-generated title. Use plain text, no emoji or prefixes. Name the affected UI or module, and cover both issues if two related symptoms matter.
|
||||
- Bug: present-tense symptom, not an imperative. Example: `Canvas renders glitches when zooming quickly`, not `Fix canvas glitches`.
|
||||
- Feature or enhancement: imperative and user-facing. Example: `Add dash and gap controls to stroke options`.
|
||||
|
||||
## Issue Body Template
|
||||
|
||||
Write the body to a temp file to avoid shell quoting issues:
|
||||
- Bug: `### Description`, `### Steps to reproduce`, `### Expected behavior`, `### Affected versions`. Describe actual behavior in the description; use numbered steps.
|
||||
- Feature or enhancement: `### Description`, `### Use case`, `### Affected versions`. Explain what the user can do and why it helps. Don't invent details or versions.
|
||||
- Keep each paragraph or list item on one line, as for PR bodies. Put the body in a private temporary file to avoid shell quoting and remove your temporary files afterward.
|
||||
|
||||
**Bug template:**
|
||||
```markdown
|
||||
### Description
|
||||
## Metadata
|
||||
|
||||
<what breaks, what the user experiences>
|
||||
- Project: `Main` (project 8). Use the current or next planned milestone only when clear; issues from PRs inherit the PR milestone, or none. Assign a known milestone on the existing issue with `gh issue edit --milestone`; the creation helper has no milestone option.
|
||||
- Labels: `community contribution` for non-core contributions; `breaking change` when compatibility breaks. Don't copy workflow labels (e.g. `team-qa`, `backport candidate`) or use `bug`/`enhancement` labels to encode the Issue Type.
|
||||
- Issue Type: `Bug` for broken behavior, `Enhancement` for improvements and ordinary feature requests, `Feature` for feature-level work, and `EPIC` for an umbrella tracking issue. Use `Question` or `Docs` when appropriate and `Task` for other work. Parentage does not decide type: fixing a bug under an epic is still a Bug.
|
||||
|
||||
### Steps to reproduce
|
||||
## Breaking changes
|
||||
|
||||
1. <step 1>
|
||||
2. <step 2>
|
||||
- Add the `breaking change` label and post a separate comment starting with `## Breaking change note`, not a section in the issue body. Reuse the user-facing note from the PR when available.
|
||||
- Explain to self-hosters what changes, what they must do, and what breaks if they do nothing. Link the details on `staging` or `main`, not a feature branch; don't paste the runbook or add issue/PR links the generator supplies. Use one line per paragraph or bullet. See `mem:workflow/updating-changelog` for how the note becomes a generated entry.
|
||||
|
||||
### Expected behavior
|
||||
## Create, recover and verify
|
||||
|
||||
<what should happen instead>
|
||||
|
||||
### Affected versions
|
||||
|
||||
<version>
|
||||
```
|
||||
|
||||
**Enhancement template:**
|
||||
```markdown
|
||||
### Description
|
||||
|
||||
<what the user can now do that they couldn't before>
|
||||
|
||||
### Use case
|
||||
|
||||
<why this is useful, who benefits>
|
||||
|
||||
### Affected versions
|
||||
|
||||
<version>
|
||||
```
|
||||
|
||||
Note: do not soft-wrap paragraphs in the body. Each paragraph is a single line in the source; newlines are reserved for structural breaks (section headers, list items, code-block fences, blank-line separators). List items stay on a single line each. GitHub renders single-line paragraphs correctly, and wrapping makes diffs noisy on every small wording change. Same rule applies to PR bodies.
|
||||
|
||||
## Creating the Issue
|
||||
|
||||
```bash
|
||||
cat > /tmp/issue-body.md << 'ISSUE_BODY'
|
||||
<body content here>
|
||||
ISSUE_BODY
|
||||
|
||||
gh issue create \
|
||||
--repo penpot/penpot \
|
||||
--title "<Derived title>" \
|
||||
--label "<label>" \
|
||||
--project "Main" \
|
||||
--body-file /tmp/issue-body.md
|
||||
```
|
||||
|
||||
Output: `https://github.com/penpot/penpot/issues/<NUMBER>`
|
||||
|
||||
**Shortcut:** `python3 scripts/gh.py create-issue --type <type> --title "..." --body-file /tmp/issue-body.md` does the creation and the Issue Type assignment in one command (see `mem:scripts/gh`). Title derivation, body templates and verification in this memory still apply.
|
||||
|
||||
## Setting the Issue Type
|
||||
|
||||
`gh issue create` can't set Issue Type directly. Use GraphQL after creation.
|
||||
|
||||
**Issue Type IDs for penpot/penpot:**
|
||||
|
||||
| Type | ID |
|
||||
|------|----|
|
||||
| Bug | `IT_kwDOAcyBPM4AX5Nb` |
|
||||
| Enhancement | `IT_kwDOAcyBPM4B_IQN` |
|
||||
| Feature | `IT_kwDOAcyBPM4AX5Nf` |
|
||||
| Task | `IT_kwDOAcyBPM4AX5NY` |
|
||||
| Question | `IT_kwDOAcyBPM4B_IQj` |
|
||||
| Docs | `IT_kwDOAcyBPM4B_IQz` |
|
||||
| EPIC | `IT_kwDOAcyBPM4CEMzF` |
|
||||
|
||||
**Map:**
|
||||
- Bug report (steps to reproduce, expected vs. actual) → Bug
|
||||
- Enhancement / new feature → Enhancement
|
||||
- Feature/epic → Feature
|
||||
- Umbrella/EPIC tracking issue that groups sub-issues → EPIC
|
||||
- Docs → Docs
|
||||
- None of the above → Task
|
||||
|
||||
**Set it:**
|
||||
```bash
|
||||
ISSUE_ID=$(gh api graphql -f query='
|
||||
query { repository(owner: "penpot", name: "penpot") {
|
||||
issue(number: <NUMBER>) { id }
|
||||
}}' --jq '.data.repository.issue.id')
|
||||
|
||||
gh api graphql -f query='
|
||||
mutation {
|
||||
updateIssue(input: {
|
||||
id: "'"$ISSUE_ID"'"
|
||||
issueTypeId: "<TYPE_ID>"
|
||||
}) {
|
||||
issue { number issueType { name } }
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
## Verification
|
||||
|
||||
```bash
|
||||
gh issue view <NUMBER> --repo penpot/penpot \
|
||||
--json title,labels,milestone,projectItems \
|
||||
--jq '{title, milestone: .milestone.title, labels: [.labels[].name], projects: [.projectItems[].title]}'
|
||||
|
||||
gh api graphql -f query='
|
||||
query { repository(owner: "penpot", name: "penpot") {
|
||||
issue(number: <NUMBER>) { issueType { name } }
|
||||
}}' --jq '.data.repository.issue.issueType.name'
|
||||
```
|
||||
|
||||
## Cleanup
|
||||
|
||||
```bash
|
||||
rm -f /tmp/issue-body.md
|
||||
```
|
||||
1. After authorization, run `python3 scripts/gh.py create-issue --type <type> --title "<title>" --body-file <private-file>` with any intended labels. The helper adds the issue to `Main` and assigns its type. See `mem:scripts/gh` for CLI discovery.
|
||||
2. Record the returned number and URL. If the command fails or the result is ambiguous, check whether the issue already exists before retrying. Use the number or URL from the error if present; otherwise search recent issues by the derived title and body. If creation succeeded but type assignment did not, use `ISSUE_TYPE_IDS`, `GQL_ISSUE_NODE_ID_QUERY` and `GQL_UPDATE_ISSUE_TYPE` in `scripts/gh.py` to assign the type to that existing issue. Never create a second one to repair type or linkage.
|
||||
3. Apply any separate, authorized edits using the existing number. Verify the title, labels, milestone and `Main` membership with `gh issue view <NUMBER> --repo penpot/penpot --json title,labels,milestone,projectItems`; verify Issue Type on the issue or via GraphQL `repository.issue.issueType.name`. Return the verified URL and disclose any incomplete follow-up.
|
||||
|
||||
## Adding an Issue as a Sub-issue
|
||||
|
||||
Sub-issues group work under an umbrella/EPIC issue. `gh issue create` cannot
|
||||
link a sub-issue at creation time: create the issue first (normal flow above),
|
||||
then link it.
|
||||
|
||||
**1. Create the sub-issue** as usual and note its number (`NNNN`).
|
||||
|
||||
**2. Get the issue's database id** (the REST `id`, not the `number`):
|
||||
|
||||
```bash
|
||||
SUB_ID=$(gh api repos/penpot/penpot/issues/NNNN --jq .id)
|
||||
```
|
||||
|
||||
**3. Link it to the parent** (`PARENT` = umbrella/EPIC issue number):
|
||||
|
||||
```bash
|
||||
gh api --method POST repos/penpot/penpot/issues/PARENT/sub_issues \
|
||||
-F sub_issue_id=$SUB_ID
|
||||
```
|
||||
|
||||
Use `-F` (typed field), never `-f`: with `-f` the value is sent as a string
|
||||
and the API rejects it with `422 ... /sub_issue_id ... is not of type integer`.
|
||||
|
||||
**4. Verify both directions:**
|
||||
|
||||
```bash
|
||||
gh api repos/penpot/penpot/issues/NNNN/parent --jq '{number, title}'
|
||||
gh api repos/penpot/penpot/issues/PARENT/sub_issues --jq '.[] | {number, title}'
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- The `POST` response is the parent issue and includes `sub_issues_summary`
|
||||
with `total`, `completed` and `percent_completed`, useful to track EPIC
|
||||
progress.
|
||||
- A sub-issue has a single parent.
|
||||
- Issue Type is independent of the parent relationship: choose it with the
|
||||
normal mapping above (an EPIC child that fixes broken behavior is a Bug,
|
||||
not a Task).
|
||||
- Create and verify it first. Read its REST database `id` (not the issue number or GraphQL node ID) with `gh api repos/penpot/penpot/issues/<NUMBER> --jq .id`.
|
||||
- Add it to the umbrella issue with `gh api --method POST repos/penpot/penpot/issues/<PARENT>/sub_issues -F sub_issue_id=<DATABASE_ID>`. Use typed `-F`, not `-f`, which sends a string. An issue has one parent; verify both the child's `/parent` and the parent's `/sub_issues`.
|
||||
|
||||
## Creating Issues from PRs
|
||||
|
||||
Used when the project board needs an issue as the primary changelog/release
|
||||
unit and the PR describes the implementation. The issue is the **WHAT**
|
||||
(user-facing), the PR is the **HOW** (implementation).
|
||||
|
||||
### Fetch the PR
|
||||
|
||||
```bash
|
||||
gh pr view <PR_NUMBER> --repo penpot/penpot \
|
||||
--json title,body,author,labels,baseRefName,mergedAt,state,milestone
|
||||
```
|
||||
|
||||
Identify:
|
||||
|
||||
- **WHAT** — user-facing problem or feature. Goes into the issue.
|
||||
Describe symptoms and impact, not internal mechanisms.
|
||||
- **HOW** — implementation details. These belong in the PR, not the issue.
|
||||
|
||||
### Determine metadata
|
||||
|
||||
- **Title:** rewrite from user perspective using the title rules above. Strip
|
||||
leading emoji prefixes (`:bug:`, `:sparkles:`, `:tada:`). Focus on
|
||||
observable behavior.
|
||||
- **Labels:** copy `community contribution` if present on the PR.
|
||||
- **Milestone:** always copy what's on the PR.
|
||||
|
||||
```bash
|
||||
gh pr view <PR_NUMBER> --json milestone --jq '.milestone.title'
|
||||
```
|
||||
|
||||
If the PR has no milestone, create the issue without one.
|
||||
- **Project:** `Main`.
|
||||
- **Body:** extract the user-facing section (steps to reproduce or feature
|
||||
description). Omit internal details. Use the templates above.
|
||||
- **Issue Type:** use the mapping table above (also handles `:bug:` /
|
||||
`:sparkles:` / `:tada:` title prefixes).
|
||||
- **Breaking changes:** when the PR body has a breaking-change section, post
|
||||
its user-facing text as a `## Breaking change note` comment on the issue and
|
||||
add the `breaking change` label (see **Breaking changes** above).
|
||||
|
||||
### Create the issue
|
||||
|
||||
```bash
|
||||
cat > /tmp/issue-body.md << 'ISSUE_BODY'
|
||||
<body content here>
|
||||
ISSUE_BODY
|
||||
|
||||
gh issue create \
|
||||
--repo penpot/penpot \
|
||||
--title "<Title>" \
|
||||
--label "community contribution" \ # only if PR has this label
|
||||
--milestone "<milestone>" \
|
||||
--project "Main" \
|
||||
--body-file /tmp/issue-body.md
|
||||
```
|
||||
|
||||
Output: `https://github.com/penpot/penpot/issues/<NUMBER>`
|
||||
|
||||
### Assign to the PR author
|
||||
|
||||
```bash
|
||||
AUTHOR=$(gh pr view <PR_NUMBER> --repo penpot/penpot --json author --jq '.author.login')
|
||||
gh issue edit <ISSUE_NUMBER> --repo penpot/penpot --add-assignee "$AUTHOR"
|
||||
```
|
||||
|
||||
GitHub only allows assigning users with write permission, org members, or
|
||||
users who have already commented on the issue. Assigning an outside
|
||||
contributor fails with `422 ... assignees ... invalid`, and `gh issue edit`
|
||||
still exits 0 and prints the issue URL. Verify the result and, when the list
|
||||
stays empty, skip the assignment:
|
||||
|
||||
```bash
|
||||
gh api repos/penpot/penpot/issues/<ISSUE_NUMBER> --jq '[.assignees[].login]'
|
||||
```
|
||||
|
||||
### Set Issue Type and verify
|
||||
|
||||
See the **Setting the Issue Type** and **Verification** sections above — the
|
||||
GraphQL mutations and `gh issue view` calls are identical regardless of how
|
||||
the issue was sourced.
|
||||
|
||||
### Link the PR to the issue
|
||||
|
||||
Add `Closes #<ISSUE_NUMBER>` to the PR body for readable context, then run the explicit assignment command from `mem:workflow/creating-prs`:
|
||||
|
||||
```bash
|
||||
python3 scripts/gh.py link-issue <ISSUE_NUMBER> <PR_NUMBER>
|
||||
```
|
||||
|
||||
The command creates the GitHub Development link by calling `addCloseIssueReferences` and trusts the successful mutation (GitHub does not reliably report mutation-created links back through the API). It is safe to rerun. Do not rely on it to keep the issue open: adding `Closes #N` to the body of an already-merged PR closed the issue immediately when tried (#12896 / PR #12067, 2026-11-09; the timeline shows a cross-reference plus a ClosedEvent with no closer). For changelog units that outcome is fine — a merged fix means a closed issue — but be aware when linking old merged PRs. Do not rely on the body keyword as the assignment operation.
|
||||
|
||||
### Clean up
|
||||
|
||||
```bash
|
||||
rm -f /tmp/issue-body.md /tmp/pr-body.md
|
||||
```
|
||||
|
||||
### Rules for this flow
|
||||
|
||||
- **One issue per PR** — even if a PR fixes multiple things, create a single
|
||||
issue that summarizes the overall change.
|
||||
- **Community attribution:** if the PR has the `community contribution`
|
||||
label or the author is not a core team member, add the label to the issue.
|
||||
- **Don't put implementation details in the issue body** — the issue is for
|
||||
users, QA, and changelog readers.
|
||||
- **Drop the PR's `no issue required` label** once the issue exists: it only
|
||||
marks PRs that need no changelog unit, and it is stale from then on.
|
||||
1. Read the PR body, author, labels and milestone. Create one issue for what the user gains or what was broken; leave implementation details in the PR. Apply the shared creation flow, copy the PR milestone when set and post a breaking-change note when needed.
|
||||
2. Try assigning the PR author when appropriate. `gh issue edit` can still return success when GitHub refuses an outside assignee; verify via `gh issue view` and skip an ineligible assignment.
|
||||
3. For authorized PR edits, put `Closes #<NUMBER>` in the PR body for context and make the explicit Development association using `python3 scripts/gh.py link-issue <NUMBER> <PR>`. Do not treat the body text as proof of the association. Editing an already-merged PR can close the issue; see `mem:workflow/creating-prs` before editing. Drop `no issue required` from the PR once the issue exists.
|
||||
|
||||
## Creating Issues from Draft Body
|
||||
|
||||
Used when the user provides a draft body from elsewhere (Taiga story, user
|
||||
report, discussion transcript) and there is no PR yet.
|
||||
|
||||
### Get the body
|
||||
|
||||
Read the draft body from wherever it was provided. If the user gives only a
|
||||
vague one-liner, ask them to expand it (steps to reproduce, expected vs.
|
||||
actual, use case) before proceeding.
|
||||
|
||||
### Derive the title
|
||||
|
||||
Apply the title rules in the **Title Derivation** section above. Distinguish
|
||||
bug vs. feature from the body content:
|
||||
|
||||
- Steps to reproduce + expected vs. actual → bug
|
||||
- "would be nice", "add support for", "allow users to" → feature / enhancement
|
||||
|
||||
### Choose a body template
|
||||
|
||||
Use the bug or enhancement template from the **Issue Body Template** section
|
||||
above. Fill in placeholders with the user-provided details. If the body
|
||||
doesn't fit either, ask the user which template to use.
|
||||
|
||||
### Determine metadata
|
||||
|
||||
- **Project:** `Main` (always).
|
||||
- **Milestone:** ask the user if not obvious; otherwise omit.
|
||||
- **Labels:** usually none for new user-reported issues. Add
|
||||
`community contribution` if the user is a non-team contributor.
|
||||
- **Issue Type:** use the mapping table above (bug description → Bug; feature
|
||||
request → Enhancement or Feature).
|
||||
|
||||
### Create the issue
|
||||
|
||||
```bash
|
||||
cat > /tmp/issue-body.md << 'ISSUE_BODY'
|
||||
<body content here>
|
||||
ISSUE_BODY
|
||||
|
||||
gh issue create \
|
||||
--repo penpot/penpot \
|
||||
--title "<Title>" \
|
||||
--label "community contribution" \ # only if applicable
|
||||
--milestone "<milestone>" \ # only if provided
|
||||
--project "Main" \
|
||||
--body-file /tmp/issue-body.md
|
||||
```
|
||||
|
||||
### Set Issue Type and verify
|
||||
|
||||
Same GraphQL mutation and `gh issue view` commands as in the
|
||||
**Setting the Issue Type** and **Verification** sections above.
|
||||
|
||||
### Clean up
|
||||
|
||||
```bash
|
||||
rm -f /tmp/issue-body.md
|
||||
```
|
||||
- Read the draft, not its old title. If a vague report gives no observable behavior or use case, ask for enough detail before creating. Pick the body template and metadata above, then use the shared creation flow.
|
||||
|
||||
## Retitling an Existing Issue
|
||||
|
||||
Used when an issue's current title is vague, prefixed, or no longer matches
|
||||
the body (e.g. `[PENPOT FEEDBACK]: ...`, `feature: ...`).
|
||||
|
||||
### Fetch the issue
|
||||
|
||||
```bash
|
||||
gh issue view <NUMBER> --repo penpot/penpot --json title,body
|
||||
```
|
||||
|
||||
### Derive a new title
|
||||
|
||||
Read the body (not the current title) and apply the title rules in the
|
||||
**Title Derivation** section above.
|
||||
|
||||
### Apply the new title
|
||||
|
||||
```bash
|
||||
gh issue edit <NUMBER> --repo penpot/penpot --title "<NEW TITLE>"
|
||||
```
|
||||
|
||||
### Confirm
|
||||
|
||||
```bash
|
||||
gh issue view <NUMBER> --repo penpot/penpot --json title
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- End-to-end orchestration entry point: the `create-issue` skill at
|
||||
`.agents/skills/create-issue/SKILL.md`. The skill is a thin entry
|
||||
point; this memory is the canonical home for all issue-creation rules.
|
||||
- Fetch the existing body, derive the title from its content, and edit only `--title`. Read the title back. Do not change body, metadata or relationships as part of a retitle.
|
||||
|
||||
@ -1,184 +1,37 @@
|
||||
# Updating the changelog
|
||||
|
||||
> Note about this memory: unlike other Serena memories (dense notes written for LLM agents, see `mem:memory-maintenance`), this document is also written for human release managers who need full context. That is why it uses plain language and examples. It is the canonical home of the changelog flow; the `update-changelog` skill is only an entry point that routes here.
|
||||
Use this runbook to prepare a release or audit a version. Only update `CHANGES.md` when authorized under `AGENTS.md`. GitHub is the source for release entries; generate the breaking and security sections, not hand-written substitutes. See `mem:scripts/changelog` for command behavior and `mem:scripts/gh` for GitHub lookups.
|
||||
|
||||
`CHANGES.md` (repository root) is the release notes file. Every entry comes from GitHub: a milestone issue, its merged PR, or a security advisory whose `patched_versions` include the version. It is never written from scratch by hand; the only manual parts are the wording of a description when the title is not enough and the advisory summaries (polished on GitHub, the source of the generated security entries).
|
||||
## Sources and eligibility
|
||||
|
||||
The commands live in `scripts/gh.py` (GitHub queries) and `scripts/changelog.py` (changelog checks). Their flags and internals are documented in `mem:scripts/gh` and `mem:scripts/changelog`.
|
||||
- The milestone supplies the closed issues. Exclude `Task`, project status `Rejected`, and issues labelled `no changelog`. `release blocker` alone is not an exclusion. An issue without a milestone is not a changelog candidate. The issue is the release unit; a PR with `no issue required` does not supply an entry of its own.
|
||||
- Issue Type gives the regular section: `Feature` → `:tada:`, `Enhancement` → `:sparkles:`, `Bug` → `:bug:`. Don't infer classification from title emoji or labels such as `bug`.
|
||||
- `breaking change` puts the issue only in `:boom:`, not its regular section. `release highlight` adds a `:rocket:` entry for an eligible labelled issue; do not select highlights on your own. Security advisories supply `:lock:` independently of issue entries, so the same fix can also have a regular bug entry.
|
||||
- Use only merged PRs. If a closing PR was closed unmerged, look for the merged replacement. Ignore references that plainly close an unrelated issue. If no PR is available, link the issue alone; if a PR has no matching closed milestone issue, don't manufacture an entry for the PR.
|
||||
|
||||
## 1. When to run it
|
||||
## Entry rules
|
||||
|
||||
- Before a release, to fill the section of the version being released.
|
||||
- When new issues are added to an existing milestone.
|
||||
- When asked to audit or refresh `CHANGES.md`.
|
||||
- Add the newest version first; omit empty sections. From 2.20.0, the order is `:boom:`, `:rocket:`, `:lock:`, `:tada:`, `:sparkles:`, `:bug:`. Preserve the older bug-first, combined feature/enhancement layout in existing 2.19.x lines and their patches. Keep one blank line between sections and no manual wrapping within entries.
|
||||
- Regular bullets describe user-facing behavior in the imperative, based on the issue title, then link the issue and append merged fix PR links inline. For `community contribution` on the issue or PR, credit the PR author before the issue link, not the issue author.
|
||||
- `:rocket:` is label-driven and has no generator. Copy the applicable entry's wording and links into the highlight; it must carry both issue and PR references. Omit the section when no issue is eligible. The in-app update dialog uses this section.
|
||||
- `:boom:` uses the issue label and the newest `## Breaking change note` comment, not the issue body. See `mem:workflow/creating-issues` for authoring. If the generator warns about a missing note or multiple notes, fix the source before regenerating. An unclosed issue will not be generated even if a provisional block is already present.
|
||||
- `:lock:` uses exact matches in advisory `patched_versions`, including unpublished advisories. A merged milestone PR labelled `pr pt` and naming the advisory can supply a PR reference; an advisory without a PR is valid. If a `pr pt` PR refers to an advisory with no matching patch version, fix the advisory. Durable wording belongs in its summary; the generator adds `Fix` and regenerates the text.
|
||||
|
||||
Editing `CHANGES.md` happens only on explicit request or as part of the release process; see `mem:critical-info`.
|
||||
|
||||
## 2. Sources of truth
|
||||
|
||||
| Question | Source |
|
||||
|---|---|
|
||||
| Which issues belong to the version? | GitHub milestone |
|
||||
| Which security fixes? | Advisories whose `patched_versions` include the version |
|
||||
| Which section? | Issue Type |
|
||||
| Is it a breaking change? | `breaking change` label |
|
||||
| Is it a highlight? | `release highlight` label |
|
||||
|
||||
- **Issue Type decides the section**: `Feature` → `:tada:`, `Enhancement` → `:sparkles:`, `Bug` → `:bug:`, `Task` is excluded (internal chores). Labels `bug`/`enhancement` and title emoji prefixes are often wrong or missing; do not use them.
|
||||
- **Security fixes come from advisories**: an advisory whose `patched_versions` include the version becomes a `:lock:` entry (section 7). `triage`, `draft` and `published` are all valid states; the advisory may still be unpublished when the changelog is written. A security fix may also carry a regular bug issue; both entries are legal and independent (the issue lives in `:bug:` as any other bug).
|
||||
- **Two labels override the Issue Type**: `breaking change` → an entry only under `:boom:`, never in its regular section; `release highlight` → an extra entry under `:rocket:` on top of its regular entry.
|
||||
- **Only closed issues**. An open issue in the milestone is not generated, even if someone added a provisional entry by hand before the merge.
|
||||
- **Excluded issues**: `no changelog`, `Task` issue type, `Rejected` project status. `release blocker` is not a changelog filter.
|
||||
- **Bugs that never reached production** stay out: a bug found and fixed while building a feature of the same, unreleased version never affected users. The flow finds these bugs and labels the sure cases `no changelog` (section 8, Review).
|
||||
- **Excluded PRs**: a PR with `no issue required` does not bring an entry of its own.
|
||||
- **An issue with no milestone** belongs to another (probably private) project: it is neither changelog candidate nor anomaly.
|
||||
|
||||
## 3. Layout of `CHANGES.md`
|
||||
|
||||
The newest version goes at the top, right after the `# CHANGELOG` header. Inside a version, the section order is fixed:
|
||||
|
||||
```markdown
|
||||
# CHANGELOG
|
||||
|
||||
## 2.20.0 (Unreleased)
|
||||
|
||||
### :boom: Breaking changes & Deprecations
|
||||
|
||||
#### <Breaking change title>
|
||||
|
||||
<content>
|
||||
|
||||
[#ISSUE](https://github.com/penpot/penpot/issues/ISSUE) (PR: [#PR](https://github.com/penpot/penpot/pull/PR))
|
||||
|
||||
### :rocket: Epics and highlights
|
||||
|
||||
- Add configurable keyboard shortcuts [#9924](https://github.com/penpot/penpot/issues/9924) (PR: [#10237](https://github.com/penpot/penpot/pull/10237))
|
||||
|
||||
### :lock: Security fixes
|
||||
|
||||
- Fix <user-facing description of the vulnerability> (<advisory URL>) (PR: [#PR](https://github.com/penpot/penpot/pull/PR))
|
||||
|
||||
### :tada: Features
|
||||
|
||||
- Add <user-facing description of the feature> [#ISSUE](https://github.com/penpot/penpot/issues/ISSUE) (PR: [#PR](https://github.com/penpot/penpot/pull/PR))
|
||||
|
||||
### :sparkles: Enhancements
|
||||
|
||||
- Improve <user-facing description of the existing behaviour> [#ISSUE](https://github.com/penpot/penpot/issues/ISSUE) (PR: [#PR](https://github.com/penpot/penpot/pull/PR))
|
||||
|
||||
### :bug: Bugs
|
||||
|
||||
- Fix <user-facing description of the bug> [#ISSUE](https://github.com/penpot/penpot/issues/ISSUE) (PR: [#PR](https://github.com/penpot/penpot/pull/PR))
|
||||
```
|
||||
|
||||
- `:boom:` first, then `:rocket:`, `:lock:`, `:tada:`, `:sparkles:`, `:bug:`. Features come before enhancements so they stand out to readers deciding whether to update.
|
||||
- **This layout applies from 2.20.0.** Versions up to 2.19.x use the old one: `:bug: Bugs fixed` before `:sparkles: New features & Enhancements`, which mixes features and enhancements. Keep the old layout in those sections, including new 2.19.x patches, so a minor line reads the same. The in-app update dialog only reads `:rocket:`, so the change does not affect it.
|
||||
- Other headings exist in old versions (`:heart:` community contributions); do not add them to new versions.
|
||||
- Include a section only when it has entries. `boom --write` removes an empty `:boom:` subsection and does not insert one when there are no breaking changes. `:lock:` is omitted (and removed on `--write`) when the version has no security advisories.
|
||||
- One blank line between the last entry of a section and the next heading.
|
||||
- No manual line wrapping: one line per bullet or paragraph, however long.
|
||||
|
||||
## 4. Regular entries (`:tada:`, `:sparkles:`, `:bug:`)
|
||||
|
||||
The entry shape is:
|
||||
|
||||
```markdown
|
||||
- <description> (by @github_username) [#ISSUE](https://github.com/penpot/penpot/issues/ISSUE) (PR: [#PR](https://github.com/penpot/penpot/pull/PR), [#PR2](https://github.com/penpot/penpot/pull/PR2))
|
||||
```
|
||||
|
||||
- **Description**: derived from the issue title, not the PR title. Strip emoji prefixes (`:bug:`, `:sparkles:`, `:tada:`) and write the user-facing behaviour in imperative mood. Examples: `Plugin API token methods fail with schema validation error` → `Fix Plugin API token methods failing with schema validation error`; `Custom uploaded font family names are not sanitized` → `Sanitize font family names on custom uploaded fonts`.
|
||||
- **Issue is the primary link**: the issue is the changelog unit, the PR is the implementation. Multiple fix PRs go comma-separated inline.
|
||||
- **Community attribution**: when the issue or its PR carries `community contribution`, add `(by @username)` before the issue link. Use the PR author, not the issue author.
|
||||
- **Closed issue with no PR** in the milestone: link the issue only, no PR reference.
|
||||
- **PR with no linked issue**: link a matching closed issue in the milestone when one exists; otherwise skip it, because the issue is the changelog unit.
|
||||
- **False-positive PR links**: a PR may claim to close an unrelated issue (ancient PR, cross-project reference). If the titles are clearly unrelated or the PR predates the issue by years, treat it as a data glitch and ignore it.
|
||||
|
||||
## 5. `:boom:`: breaking changes and deprecations
|
||||
|
||||
Each breaking change is a `####` block, not a bullet. The title is the issue title without its emoji prefix; the content comes from a comment on the issue; the references go on their own line at the end.
|
||||
|
||||
The **issue** must carry:
|
||||
|
||||
1. The `breaking change` label.
|
||||
2. A comment whose first line is `## Breaking change note`. Everything after that marker line is the changelog content: paragraphs, bullet lists, code blocks, tables, headings (they are demoted to `#####` on write), and so on. The marker itself is case-insensitive and accepts `#`, `##` or `###`; use `##`.
|
||||
|
||||
Example comment:
|
||||
|
||||
```markdown
|
||||
## Breaking change note
|
||||
|
||||
The Admin Console is now enabled by default and the `enable-admin-console` flag is no longer needed.
|
||||
|
||||
Self-hosted instances must deploy the `penpot-admin-console` service and set `PENPOT_ADMIN_CONSOLE_URI` in frontend and backend (check the [upgrade guide](https://help.penpot.app/technical-guide/getting-started/docker/#upgrade-to-2.19)).
|
||||
```
|
||||
|
||||
Generated block:
|
||||
|
||||
```markdown
|
||||
#### Enable the Admin Console by default
|
||||
|
||||
The Admin Console is now enabled by default and the `enable-admin-console` flag is no longer needed.
|
||||
|
||||
Self-hosted instances must deploy the `penpot-admin-console` service and set `PENPOT_ADMIN_CONSOLE_URI` in frontend and backend (check the [upgrade guide](https://help.penpot.app/technical-guide/getting-started/docker/#upgrade-to-2.19)).
|
||||
|
||||
[#12807](https://github.com/penpot/penpot/issues/12807) (PR: [#12475](https://github.com/penpot/penpot/pull/12475))
|
||||
```
|
||||
|
||||
Rules for the note:
|
||||
|
||||
- **Write it for admins**: what changes, what they must do, and what breaks if they do nothing. Do not paste the full runbook; explain the implications and link the runbook or docs.
|
||||
- **Link a long-lived branch**, `staging` or `main`, never a feature branch (`issue-1234`). The link may 404 until the PR merges; that is expected.
|
||||
- **Do not add issue or PR links**: the generator appends them.
|
||||
- **One note per issue**. If several comments carry the marker, the generator uses the last one and warns.
|
||||
- **No note**: the generator warns on stderr and emits only the heading and references; fix the issue, not `CHANGES.md`.
|
||||
- **`####`, not `###`**: `###` is the level of the changelog sections. An entry at `###` would render as a sibling section and the scripts that read and rewrite `:boom:` would cut the section there. The note author never writes the `####`: the generator adds it.
|
||||
- **Only merged closing PRs** are referenced; unmerged or superseded PRs are skipped.
|
||||
- **Never hand-edit the section**. Generate it with `boom` (section 8). The note lives on GitHub; edit it there.
|
||||
|
||||
## 6. `:rocket:`: epics and highlights
|
||||
|
||||
- Lists exactly the milestone issues with the `release highlight` label, and nothing else. Product decides highlights by labelling issues; a regeneration cannot undo that choice.
|
||||
- Every entry copies the text and references of the issue's regular entry and MUST carry both an issue link and a PR reference.
|
||||
- If no issue is labelled, leave the section out; do not pick highlights yourself.
|
||||
- No command generates `:rocket:` today. Build it from the eligible labelled issues in the snapshot, using their regular entries, and verify it with `report`. Change the label on GitHub to change which issues appear; do not pick highlights in the changelog.
|
||||
|
||||
## 7. `:lock:`: security fixes
|
||||
|
||||
Generated from the advisories that declare the version in `patched_versions`; never written by hand.
|
||||
|
||||
- **Source and filter**: `python3 scripts/gh.py advisories --patched-version <VERSION>` keeps the advisories whose `vulnerabilities[*].patched_versions` contain the version as an exact token (so `2.19.1` never matches `2.19.10`). Any state is valid — `triage`, `draft`, `published` — because the advisory may still be unpublished when the changelog is written.
|
||||
- **Fill the advisories first**: `patched_versions` must be filled before generating the changelog. The release process publishes the advisories with (or after) the release; the changelog does not wait for publication.
|
||||
- **PR reference**: a merged PR in the milestone labelled `pr pt` whose body contains the GHSA id contributes its number inline; several PRs go comma-separated. An advisory with no PR is legal: the entry links only the advisory.
|
||||
- **Missing `patched_versions`**: when a `pr pt` PR references an advisory that declares no matching `patched_versions`, `security` prints a warning on stderr and leaves it out. Fix the advisory, not `CHANGES.md`.
|
||||
- **Entry format**: `- Fix <description> (<advisory URL>) (PR: [#PR](...))`. The description is `Fix` plus the advisory summary, with the first word decapitalized unless it starts with an acronym (`SVG`, `CVE-...`).
|
||||
- **Wording**: the flow may polish the description. Re-running `security --write` rewrites it from the summary, so the durable place for wording is the advisory summary on GitHub; keep it a problem statement, because the generator adds `Fix`.
|
||||
- **Empty version**: no matching advisories → the subsection is not inserted (and is removed by `--write`).
|
||||
- **Never hand-edit the section**: generate it with `security` (section 8).
|
||||
|
||||
## 8. Flow
|
||||
## Flow
|
||||
|
||||
### Collect
|
||||
|
||||
- Confirm the version if unclear. Use an authenticated `gh` CLI and a private temporary file: the snapshot can contain unpublished advisories and PR text.
|
||||
|
||||
```bash
|
||||
snapshot=$(mktemp)
|
||||
python3 scripts/changelog.py collect "<VERSION>" > "$snapshot"
|
||||
```
|
||||
|
||||
- Use the same snapshot throughout. Collect again if GitHub data changes or if the final report needs to resolve a new reference absent from the snapshot.
|
||||
Confirm the release version. Save `python3 scripts/changelog.py collect "<VERSION>"` output in a private temporary file (`$snapshot`); it can contain unpublished advisories and PR text. Reuse it through review and verification. Collect again if GitHub changes, or if new references now need to be resolved.
|
||||
|
||||
### Review
|
||||
|
||||
- Use `eligible_issues` to select entries, `comparison` to reconcile the current text (section 9), and `prs` and `related_prs` to verify links. Reference only `MERGED` PRs. If a closing PR was closed unmerged, look for its replacement; use `check-merged` for PRs looked up outside the snapshot.
|
||||
- Review `dev_only_bugs`. A bug with a `Feature` or `Enhancement` parent in the same milestone is a sure case (`auto`). An epic parent in the same milestone, a `regression` label, or an unreleased-only environment is only a hint (`suggested`). Show candidates to the user, who labels the ones they confirm.
|
||||
- Use the snapshot to find eligible non-bug issues labelled `release blocker`. Show them to the user for review: internal work gets `no changelog`, and the rest keeps its entry. `release blocker` alone excludes nothing.
|
||||
- **Separate GitHub write, only if there are sure cases:** `python3 scripts/changelog.py dev-only-bugs "<VERSION>" --snapshot "$snapshot" --apply` adds `no changelog` to `auto` issues and prints each successful edit to stdout. If a later edit fails, earlier edits still stand. Collect again after applying labels before proceeding.
|
||||
- Reconcile the current version before adding entries. Remove duplicates already listed in an earlier version (earlier wins for backports), stale milestone entries, deleted or transferred issues, and issues now open or excluded. Move retyped issues to the proper section, or remove them if now `Task`. Fix stale PR references, but don't silently drop cross-milestone discrepancies; use **Anomaly report** below. Reconcile the labels for breaking changes and highlights, then add eligible missing issues.
|
||||
- Review `dev_only_bugs`: `auto` is a Bug under a Feature or Enhancement of the same milestone. An epic parent, `regression` label or unreleased-only environment is a clue, not proof. Show candidates to the user for confirmation; `--apply` must never apply to candidates. Also review eligible non-bug `release blocker` entries with the user: only confirmed internal work should receive `no changelog`.
|
||||
- Keep review read-only with respect to GitHub. A separate authorized `dev-only-bugs "<VERSION>" --snapshot "$snapshot" --apply` labels only the `auto` set. A partial failure does not undo earlier edits: inspect the printed successes and refresh the snapshot before continuing.
|
||||
|
||||
### Write
|
||||
|
||||
- Update only on explicit request or during a release. Categorize and draft entries using sections 2–4. Build `:rocket:` from `release highlight` as described in section 6.
|
||||
- Use the generators for `:boom:` and `:lock:` (sections 5 and 7). Omit `--write` to preview; use it only after the version header exists.
|
||||
- When authorized, reconcile and draft regular and highlight entries. Preview generated sections first by omitting `--write`. The version header must exist before replacing the generated sections.
|
||||
|
||||
```bash
|
||||
python3 scripts/changelog.py boom "<VERSION>" --snapshot "$snapshot" --write
|
||||
@ -187,55 +40,16 @@ python3 scripts/changelog.py security "<VERSION>" --snapshot "$snapshot" --write
|
||||
|
||||
### Verify
|
||||
|
||||
- `cross-ref` shows missing merged PRs and warns about closed, unmerged PRs. `report` checks the updated changelog and overwrites `CHANGES-ISSUES.md` (section 10).
|
||||
- Use `check-merged` for PRs verified outside the snapshot. Run `cross-ref` to find missing merged PRs and warnings for closed-unmerged PRs. `report` verifies the edited version and **overwrites a local report** (default `CHANGES-ISSUES.md`); it does not modify GitHub or `CHANGES.md`.
|
||||
|
||||
```bash
|
||||
python3 scripts/changelog.py cross-ref "<VERSION>" --snapshot "$snapshot"
|
||||
python3 scripts/changelog.py report "<VERSION>" --snapshot "$snapshot"
|
||||
```
|
||||
|
||||
## 9. Pre-flight: reconcile before writing
|
||||
## Anomaly report
|
||||
|
||||
Start from a fresh `collect` snapshot. Refresh it if GitHub changes during review (labels, notes, advisories, or PRs). Fix these in `CHANGES.md` before adding the new section:
|
||||
|
||||
1. **Duplicate across versions** → remove it from the current section; the earlier version wins for backports.
|
||||
2. **Stale milestone assignment** (the issue moved out of this milestone) → remove the entry.
|
||||
3. **Newly applied exclusion label** (`no changelog`) → remove the entry.
|
||||
4. **Issue no longer closed, deleted, or now `Rejected`** → remove the entry.
|
||||
5. **Unmerged or moved PR reference** → fix the reference or remove the entry. A PR merged in a different milestone is an anomaly (section 10); do not remove it silently.
|
||||
6. **Issue Type changed** → to `Task`: remove the entry; to another type: move the entry to that type's section.
|
||||
7. **Breaking change out of sync** (a `breaking change` issue outside `:boom:`, or a `:boom:` entry without the label) → regenerate the section; a labelled issue has no regular entry.
|
||||
8. **Highlight out of sync** (`:rocket:` entry without the label, or a labelled issue missing) → remove it or add it.
|
||||
9. **Missing valid issues** (closed, non-excluded, referenced nowhere) → add them to their section.
|
||||
|
||||
## 10. Anomaly report
|
||||
|
||||
`report` classifies problems it cannot decide alone. The total counts A, B, E, F and G; C and D are warnings.
|
||||
|
||||
- **A — issue in this milestone, referenced PR in another milestone (or none).** The claim "this issue is fixed by this PR in this milestone" is inconsistent. Fix the milestone on the issue or the PR, or remove the entry.
|
||||
- **B — PR in this milestone whose closing issue is in another milestone.** Same fix. An issue with no milestone is not an anomaly (another, probably private, project).
|
||||
- **E — `:boom:` entry whose issue lacks the `breaking change` label.** The entry stays in the changelog: either label the issue or move the entry to its regular section.
|
||||
- **F — `:rocket:` out of sync with the `release highlight` label.** A rule violation: `:rocket:` must list exactly the labelled issues. Fix the label or re-run the flow.
|
||||
- **G — `breaking change` issue missing from `:boom:`.** A rule violation: `:boom:` must list exactly the labelled issues. Regenerate the section or relabel.
|
||||
- **C — released X.Y.0 version without a `:rocket:` section** (gap; patches never carry highlights).
|
||||
- **D — `:rocket:` entry without issue AND PR references** (gap).
|
||||
|
||||
**Bugs that may never have reached production** are warnings too (section 8, Review): sure cases still unlabelled and candidates for the user to confirm. They never count toward the total.
|
||||
|
||||
Anything else is a rule violation, not a report item: fix it in the pre-flight and re-run.
|
||||
|
||||
## 11. Pitfalls
|
||||
|
||||
- **Open issues with provisional entries**: a PR author may add the entry before the merge. `boom` will not generate it until the issue closes; keep the hand-written block identical to what the generator would produce.
|
||||
- **Labels, not emoji**: title prefixes are cosmetic and often missing; the section comes from Issue Type and the two labels.
|
||||
- **Taiga references**: old entries link to Taiga. Resolve them to the GitHub issue via the description text or the PRs that mention the Taiga URL, then link issue and PR.
|
||||
- **Long-lived links only**: runbooks and docs referenced from a note must point to `staging` or `main`, never to a feature branch that will be deleted.
|
||||
- **Generated sections**: use `boom` and `security` for `:boom:` and `:lock:`. Change the label, note or advisory on GitHub rather than patching their output. For `:rocket:`, follow the label-driven workflow in section 6.
|
||||
- **Deleted or transferred issues**: an issue referenced in the changelog that returns 410/404 (deleted or moved out of the repo) must lose its entry in the pre-flight. Its security fixes, if any, stay in `:lock:` through the advisory.
|
||||
|
||||
## 12. Where the code is
|
||||
|
||||
- `scripts/gh.py`: `issues`, `issue`, `comments`, `prs`, `link-issue`, `advisories` (with `--patched-version`). Details: `mem:scripts/gh`.
|
||||
- `scripts/changelog.py`: `collect`, `check-merged`, `boom`, `security`, `cross-ref`, `dev-only-bugs`, `report`. Details: `mem:scripts/changelog`.
|
||||
- Tests: `scripts/test_gh.py`, `scripts/test_changelog.py`.
|
||||
- The note contract for issue authors: `mem:workflow/creating-issues`, section **Breaking changes**.
|
||||
- Resolve issue/PR milestone mismatches by checking both sides. A known closing issue in another milestone is a mismatch; a closing issue with no milestone is not the same case. Do not silently remove a mismatched PR link to make the report pass.
|
||||
- A breaking entry without the label needs a source correction or classification as a regular entry; a missing breaking entry needs regeneration or label correction. Highlight entries must match the eligible labels; resolve the underlying decision instead of silently selecting different highlights.
|
||||
- Treat missing major/minor highlights and highlights lacking issue or PR references as warnings, not the same as counted mismatches. A patch release should not require a highlights section. Treat unconfirmed dev-only bug candidates as warnings as well; see `scripts/changelog.py` for the report codes.
|
||||
- A deleted or transferred issue can lose its normal entry while a related advisory stays in `:lock:`. For historical Taiga references, resolve the actual GitHub issue from its text or fix PR; matching bare numbers are not enough.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user