Commit Graph

3 Commits

Author SHA1 Message Date
Stephen Brown II
123cf1e25a [AI] docs: fix broken blog links and add enforce-doc-links remark plugin (#8180)
* [AI] docs: fix broken blog links and add enforce-doc-links remark plugin

- Fix three docs/ pages that linked to blog posts using URL slugs instead of
  file paths, with an extra ../ level in the relative path
- Add src/remark/enforce-doc-links.js: remark plugin that enforces link hygiene
  in docs/ and blog/ at build time (no absolute internal links, .md extension
  required, slug-style links caught via frontmatter cache)
- Upgrade onBrokenMarkdownLinks from 'warn' to 'throw' so broken .md file-path
  links fail the build rather than being silently ignored

* [autofix.ci] apply automated fixes

* [AI] docs: add vfile to spell-check allowlist

* [AI] docs: fix build failures from cross-plugin and absolute links

- Revert docs→blog links to URL-slug style (Docusaurus cannot resolve .md
  file paths across content plugins — blog is a separate plugin from docs)
- Fix absolute /docs/... links in two blog posts to relative URL form
- Fix generate-upcoming-release-notes.mjs hardcoded /docs/releases absolute
  URLs to relative ./releases.md paths
- Update enforce-doc-links plugin: exempt docs→blog URL-slug links from Rule 3
  (cross-plugin constraint means slug URLs are the required format there);
  improve Rule 1 error hint to distinguish docs vs blog context

* [AI] docs: fix blog→docs links to use absolute URLs

Blog posts are embedded in multiple Docusaurus URL contexts (individual post,
paginated list pages, tag pages), so relative URLs resolve differently per
context. Blog→docs links must use absolute URLs (/docs/...) — relative URLs
like ../docs/... incorrectly resolve to /blog/docs/... on list pages.

Update enforce-doc-links plugin to exempt blog files from Rule 1 (absolute
link check) since absolute URLs are the required format for blog→docs links.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-06-10 19:58:39 +00:00
Matiss Janis Aboltins
ab35bd633b [AI] Remove AI-generated release notes workflow and support custom filenames (#7963)
* [AI] Relax release-notes filename convention

Allow descriptive filenames (e.g. add-payee-autocomplete.md) for
upcoming release notes instead of requiring {PR_NUMBER}.md.

The PR number was only used to build the [#1234](.../pull/1234) link in
the generated changelog. The generation script now resolves the PR per
file by finding the commit that added it (git log --diff-filter=A
--follow) and querying GitHub's commits/{sha}/pulls endpoint. Numeric
filenames remain valid via a fast path.

Also retires the CodeRabbit/OpenAI-triggered auto-creator workflow,
which existed to guess summaries and stamp the PR-numbered filename;
neither is needed once contributors can pick a slug up front.

* Add release notes for PR #7963

* [AI] Use execFile to look up release-note add-commits

resolvePrNumber() interpolated a path from fs.readdir into a shell-
evaluated `git log` command. Switch to execFile with an argv array so
filenames containing shell metacharacters can't break out of the
intended command.

* [AI] Drop duplicate release note added by the to-be-removed auto-creator

The CodeRabbit-triggered workflow ran one last time from master before
this PR removes it, and committed upcoming-release-notes/7963.md
duplicating the existing relax-release-notes-filenames.md entry. Keep
the slug-named note since it exercises the new flexible-filename code
introduced in this PR.

* [AI] Don't fail release-notes generation on transient API errors

fetchPrForCommit() handled non-OK HTTP responses but let fetch() and
res.json() exceptions propagate, so a single network blip or malformed
response would abort the whole release-notes generation. Wrap them in a
try/catch that logs and returns null, matching the pattern already used
in resolvePrNumber for execFile errors.

* [AI] Address CodeRabbit full-review nits

- bin/release-note-generator.ts: tighten slug regex to reject trailing
  and consecutive dashes (matching slugify output), and make slugify
  fall back to "untitled" so an all-non-alphanumeric input can't
  produce a hidden ".md" filename.
- packages/ci-actions/bin/release-notes-check.mjs: switch to execFile
  for git fetch/diff, matching release-notes-generate.mjs and removing
  shell interpolation of BASE_REF.
- packages/ci-actions/bin/release-notes-generate.mjs: explicitly check
  GITHUB_REPOSITORY before splitting, consistent with the other env
  var guards a few lines below.
- upcoming-release-notes/relax-release-notes-filenames.md: fix author
  casing (matiss -> MatissJanis) so changelog attribution is correct.

* [AI] Reject empty release-note bodies

content.trim().split('\n').length === 1 is true for the empty string
(''.split('\n') returns [''] of length 1), so blank notes slipped past
the single-line check. Reject empty trimmed content explicitly.

* [AI] Resolve PR numbers from commit subjects instead of GitHub's API

parseReleaseNotes was doing one GitHub API round-trip per non-numeric
release-note file. That scales badly for release generation, and the
docs site's generate-upcoming-release-notes.mjs runs on every docs
build — so contributors were hitting the GitHub API (or failing 401
without a token) every time they previewed docs locally.

actualbudget squash-merges every PR through the GitHub UI, which
appends "(#NNNN)" to the resulting commit subject. So:

  git log -1 --format=%s -- <path>

plus a /\(#(\d+)\)\s*$/ match recovers the PR number without touching
the network, and works offline / without a GITHUB_TOKEN.

Side effect: switched from "first commit that added this file" to
"most recent commit touching this file", which is what we actually
want — when a file is renamed (e.g. 7907.md -> 7954.md when a wrong
PR number is corrected), the changelog should point at the rename PR,
not the original add. The SHA->PR cache and fetchPrForCommit go away;
no longer needed.

If a file's subject doesn't match (direct push to master, manually
rewritten subject), the entry still emits without a PR-link prefix —
same graceful degradation as before.

* [AI] Pin PR-number lookup to each note's add commit

resolvePrNumber was using git log -1 with no diff filter, returning
the latest commit that touched the file. That's fine until someone
edits an existing release note in a follow-up PR (typo fix, author
correction) — at which point the changelog entry would suddenly
point at the wrong PR.

Add --diff-filter=A so the lookup pins to the commit that originally
added the path. Empirically verified against this repo: renames keep
working (git records a rename as A at the new path when --follow
isn't used), and the edit case now correctly returns the original
add commit instead of the most recent touch.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-06-04 21:01:19 +00:00
Matiss Janis Aboltins
75dd9f674a [AI] Add auto-generated Upcoming Release docs page (#8065)
* [AI] Add auto-generated Upcoming Release docs page

Adds a docs page that always reflects the current contents of the
repo-root upcoming-release-notes/ directory — the changes that have been
merged but not yet published in a stable release (i.e. what ships in the
nightly/edge builds).

- Extract parseReleaseNotes/formatNotes from the release-notes generator
  into the shared ci-actions util so both the release generator and the
  docs build reuse the same formatting.
- Add a docs build script that regenerates docs/upcoming-release-notes.md
  on every start/build, with an intro explaining the notes are unreleased
  and how to try them, plus the categorized notes list.
- Wire the generator into the docs start/build scripts, add a sidebar
  entry next to Release Notes, and gitignore the generated page.

https://claude.ai/code/session_01MuY9Phome8uJKH51HbrsQw

* [AI] Simplify upcoming-release-notes generator

- Declare @actual-app/ci-actions as a workspace dependency and import the
  shared util by package name instead of a relative cross-package path, so
  the dependency is registered in the workspace graph.
- Resolve the repo root once via new URL() and drop the dirname import.
- Use a ternary for the page body instead of let + if/else.

https://claude.ai/code/session_01MuY9Phome8uJKH51HbrsQw

* Add release notes for PR #8065

* [AI] Remove edge references, keep only nightly in docs

Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>

* Update packages/docs/scripts/generate-upcoming-release-notes.mjs

Co-authored-by: Matt Fiddaman <github@m.fiddaman.uk>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Matiss Janis Aboltins <MatissJanis@users.noreply.github.com>
Co-authored-by: Matt Fiddaman <github@m.fiddaman.uk>
2026-06-03 20:45:11 +00:00