Skip to content
Open
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
6 changes: 3 additions & 3 deletions .claude/rules/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ paths:

# Changelog

- A user-visible change adds one towncrier fragment to its app, `apple/changelog.d/<PR>.<type>.md` or `linux/changelog.d/<PR>.<type>.md`, where `<PR>` is the pull request that adds it. A second entry of one type adds a counter: `3452.fixed.1.md`.
- A user-visible change adds one towncrier fragment to its app, `apple/changelog.d/<PR>.<type>.md`, `linux/changelog.d/<PR>.<type>.md` or `windows/changelog.d/<PR>.<type>.md`, where `<PR>` is the pull request that adds it. A second entry of one type adds a counter: `3452.fixed.1.md`.
- `<type>` is `added`, `changed`, `deprecated`, `removed`, `fixed` or `security`.
- One sentence per entry, in the user's terms, at most 120 characters, ending with a period. Fixed names the bug, not the fix. No bullet, PR link or credit: towncrier and `notes.py` add them.
- Only a `chore(release)` pull request edits `apple/CHANGELOG.md` or `linux/CHANGELOG.md`; `scripts/ci/check-changelog-edits.sh` refuses any other, in CI's Lint job and in PR title.
- The release, the lead and `[CRITICAL]`: `apple/RELEASING.md`, Notes, and `linux/docs/releasing.md`.
- Only a `chore(release)` pull request edits `apple/CHANGELOG.md`, `linux/CHANGELOG.md` or `windows/CHANGELOG.md`; `scripts/ci/check-changelog-edits.sh` refuses any other, in CI's Lint job and in PR title.
- The release, the lead and `[CRITICAL]`: `apple/RELEASING.md`, Notes, `linux/docs/releasing.md` and `windows/RELEASING.md`.
1 change: 1 addition & 0 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ jobs:
set -euo pipefail
"$RUNNER_TEMP/release-venv/bin/towncrier" build --draft --dir apple --version 0.0.0
"$RUNNER_TEMP/release-venv/bin/towncrier" build --draft --dir linux --version 0.0.0
"$RUNNER_TEMP/release-venv/bin/towncrier" build --draft --dir windows --version 0.0.0

# pr-title.yml runs the same check on a title edit, which starts no CI run. The title is read now, not from the
# event, so a re-run after a retitle sees the current one.
Expand Down
10 changes: 6 additions & 4 deletions scripts/ci/check-changelog-edits.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail

# Fails when the changes from <base> to HEAD edit apple/CHANGELOG.md or linux/CHANGELOG.md and <title> is not a
# chore(release) title. A version heading added outside a release PR makes version.py refuse its betas and notes.py
# assemble refuse it.
# Fails when the changes from <base> to HEAD edit apple/CHANGELOG.md, linux/CHANGELOG.md or windows/CHANGELOG.md and
# <title> is not a chore(release) title. A version heading added outside a release PR makes version.py refuse its betas
# and notes.py assemble refuse it.
# Usage: check-changelog-edits.sh <base> <title>

if [ $# -ne 2 ] || [ -z "$1" ]; then
Expand All @@ -14,7 +14,9 @@ BASE="$1"
TITLE="$2"

cd "$(git rev-parse --show-toplevel)"
edited="$(git diff --no-renames --name-only "$BASE" HEAD -- apple/CHANGELOG.md linux/CHANGELOG.md)"
# --diff-filter=a excludes an added file: bootstrapping an app's empty CHANGELOG.md once carries no version heading, so
# any PR may add it; every later edit to it is caught.
edited="$(git diff --no-renames --diff-filter=a --name-only "$BASE" HEAD -- apple/CHANGELOG.md linux/CHANGELOG.md windows/CHANGELOG.md)"
[ -n "$edited" ] || exit 0
case "$TITLE" in 'chore(release)'*) exit 0 ;; esac
echo "::error title=Changelog::Only a chore(release) pull request edits ${edited//$'\n'/ or }. Add a changelog.d/<PR>.<type>.md fragment instead."
Expand Down
19 changes: 14 additions & 5 deletions scripts/ci/test_check_changelog_edits.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ def setUp(self):
self.git("-c", "init.defaultBranch=main", "init", "-q")
(self.repo / "scripts/ci").mkdir(parents=True)
shutil.copy(SCRIPT, self.repo / "scripts/ci/check-changelog-edits.sh")
self.base = self.commit(["apple/CHANGELOG.md", "linux/CHANGELOG.md", "README.md"])
self.base = self.commit(
["apple/CHANGELOG.md", "linux/CHANGELOG.md", "windows/CHANGELOG.md", "README.md"]
)

def tearDown(self):
self.temp.cleanup()
Expand Down Expand Up @@ -53,20 +55,20 @@ def test_a_change_without_a_changelog_passes_under_any_title(self):
self.assertEqual(self.check("fix(editor): keep the caret")[0], 0)

def test_a_changelog_edit_fails_outside_a_release_title(self):
for path in ["apple/CHANGELOG.md", "linux/CHANGELOG.md"]:
for path in ["apple/CHANGELOG.md", "linux/CHANGELOG.md", "windows/CHANGELOG.md"]:
with self.subTest(path=path):
self.git("reset", "-q", "--hard", self.base)
self.commit([path])
status, out = self.check("fix(editor): keep the caret")
self.assertEqual(status, 1)
self.assertIn(f"::error title=Changelog::Only a chore(release) pull request edits {path}", out)

def test_both_changelogs_are_named_in_one_line(self):
self.commit(["apple/CHANGELOG.md", "linux/CHANGELOG.md"])
def test_every_changelog_is_named_in_one_line(self):
self.commit(["apple/CHANGELOG.md", "linux/CHANGELOG.md", "windows/CHANGELOG.md"])
status, out = self.check("docs: notes")
self.assertEqual(status, 1)
self.assertEqual(len(out.splitlines()), 1)
self.assertIn("apple/CHANGELOG.md or linux/CHANGELOG.md", out)
self.assertIn("apple/CHANGELOG.md or linux/CHANGELOG.md or windows/CHANGELOG.md", out)

def test_a_release_title_may_edit_a_changelog(self):
self.commit(["apple/CHANGELOG.md"])
Expand All @@ -76,6 +78,13 @@ def test_a_title_naming_release_elsewhere_is_not_a_release_title(self):
self.commit(["apple/CHANGELOG.md"])
self.assertEqual(self.check("fix: chore(release) notes")[0], 1)

def test_adding_a_new_changelog_passes_under_any_title(self):
self.git("rm", "-q", "windows/CHANGELOG.md")
self.git("commit", "-q", "-m", "remove")
base = self.git("rev-parse", "HEAD")
self.commit(["windows/CHANGELOG.md"])
self.assertEqual(self.check("chore(windows): bootstrap changelog", base=base)[0], 0)

def test_an_empty_base_is_a_usage_error(self):
self.assertEqual(self.check("fix: x", base="")[0], 2)

Expand Down
9 changes: 5 additions & 4 deletions windows/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This is the guide for work under `windows/`. The root `AGENTS.md` holds the rule
- `scripts/engine-glyphs.py`: writes `src/TablePro.App/Resources/EngineGlyphs.xaml` from the macOS app's engine artwork. Run it after that artwork changes or an engine is added.
- `scripts/package-assets.py`: writes the MSIX logos in `src/TablePro.App/Assets` from the app icon. Run it after the icon changes.
- `scripts/editor-schemes.py`: writes `src/TablePro.Editor.Model/ColorSchemes.Themes.cs`, the editor's color schemes, from the macOS app's built-in themes. Run it after a theme changes.
- `RELEASING.md`: how a release is built, signed, published and sent to winget.
- `RELEASING.md`: how a release is built, signed, published and sent to winget. `CHANGELOG.md` and `changelog.d/`: the towncrier notes (`.claude/rules/changelog.md`).
- `docs/decisions/`: the decisions only the Windows app makes.
- The core's side of the boundary: `core/crates/ffi` (`core/ARCHITECTURE.md`, Bindings).

Expand Down Expand Up @@ -107,9 +107,10 @@ Pass `-p:UniffiBindgenCs=<path>` when it is not on `PATH`; the target refuses an
## Every change

1. **Tests.** Behavior of the interop library gets a test in `tests/` against a real database file. Behavior of the core gets its Rust test in `core/crates/ffi`.
2. **Strings.** Every word the app shows is in `src/TablePro.App/Strings/en-US/Resources.resw`: `x:Uid` in XAML, `Strings.Get`, `Format` or `Plural` in the app, `HostStrings` in a control. A count takes `Plural` and `{n:N0}`, never a comparison with one, and a join of words is a string too (`docs/decisions/0021-localization.md`). `LocalizationTests` fails on the common shapes; a literal a helper passes on to a control is the review's to catch.
3. **Code style.** `.editorconfig` and the analyzers; a warning fails the build. A comment is one `//` line that says why, never what: no XML doc and no multi-line block.
4. **Commits and pull requests** follow the root rules, with scope `windows` or `windows-<area>`.
2. **Changelog.** A user-visible change adds `changelog.d/<PR>.<type>.md`; only a release PR edits `CHANGELOG.md` (`.claude/rules/changelog.md`).
3. **Strings.** Every word the app shows is in `src/TablePro.App/Strings/en-US/Resources.resw`: `x:Uid` in XAML, `Strings.Get`, `Format` or `Plural` in the app, `HostStrings` in a control. A count takes `Plural` and `{n:N0}`, never a comparison with one, and a join of words is a string too (`docs/decisions/0021-localization.md`). `LocalizationTests` fails on the common shapes; a literal a helper passes on to a control is the review's to catch.
4. **Code style.** `.editorconfig` and the analyzers; a warning fails the build. A comment is one `//` line that says why, never what: no XML doc and no multi-line block.
5. **Commits and pull requests** follow the root rules, with scope `windows` or `windows-<area>`.

## CI

Expand Down
10 changes: 10 additions & 0 deletions windows/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog

All notable changes to TablePro for Windows will be documented in this file.

The format is based on [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Unreleased changes are files in `changelog.d/`.

<!-- towncrier release notes start -->
13 changes: 13 additions & 0 deletions windows/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ The maintainer does these once, in this order: a tag runs the workflow file at t
- For a release, opens the winget-pkgs pull request with wingetcreate, which a reviewer approves.
4. **Afterwards**: check that `https://updates.tablepro.app/windows/TablePro.appinstaller` (or `TablePro-Beta.appinstaller`) names the new version, and watch the winget-pkgs pull request. Its bots validate and install the package, and a label such as `Needs-Author-Feedback` waits for an answer.

## Notes

- A user-visible change adds one towncrier fragment, `windows/changelog.d/<PR>.<type>.md` (`.claude/rules/changelog.md`). Only a `chore(release)` pull request edits `windows/CHANGELOG.md`; CI's Lint job refuses any other.
- The release pull request assembles the fragments into a `CHANGELOG.md` section and curates them, as the macOS app does (`apple/RELEASING.md`, Notes). From a venv built on `scripts/release/requirements.txt`:

```bash
towncrier build --dir windows --version X.Y.Z
```

`[CRITICAL]` on the version heading marks a security or data-loss release, never a beta; later stables carry it forward.
- A beta gets no `CHANGELOG.md` section: its notes are a towncrier draft of the fragments at the tag (`towncrier build --draft --dir windows --version X.Y.Z-beta.N`).
- The GitHub release body the workflow writes is a fixed install line, not the changelog.

## When a run fails

- Nothing reaches users before the GitHub release job. Tags never move: a code fix lands on `main` and ships as the next number.
Expand Down
Empty file added windows/changelog.d/.gitkeep
Empty file.
27 changes: 27 additions & 0 deletions windows/towncrier.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[tool.towncrier]
filename = "CHANGELOG.md"
directory = "changelog.d"
start_string = "<!-- towncrier release notes start -->\n"
title_format = "## [{version}](https://github.com/TableProApp/TablePro/releases/tag/windows-v{version}) - {project_date}"
issue_format = "[#{issue}](https://github.com/TableProApp/TablePro/pull/{issue})"
underlines = ["", "", ""]
ignore = []
issue_pattern = "\\d+"

[[tool.towncrier.type]]
name = "Added"

[[tool.towncrier.type]]
name = "Changed"

[[tool.towncrier.type]]
name = "Deprecated"

[[tool.towncrier.type]]
name = "Removed"

[[tool.towncrier.type]]
name = "Fixed"

[[tool.towncrier.type]]
name = "Security"
Loading