Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 7 additions & 9 deletions .agents/skills/merge/clean-changesets.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ Remove changeset files that were already released on `main` and should not be in

## Background

When `main` is merged into `next`, changeset files (`.changeset/*.md`) that were consumed by a release on `main` may still appear as new files on `next` if the `next` branch diverged before that release. These stale changesets cause pre-release versions on `next` to include version bumps that were already released as stable versions, leading to version conflicts like `@astrojs/sitemap@3.6.1-beta.3` being published after `@astrojs/sitemap@3.7.0`.
When `main` is merged into `next`, changeset files (`.changeset/*.md` and `.changeset/pre/*.md`) that were consumed by a release on `main` may still appear as new files on `next` if the `next` branch diverged before that release. These stale changesets cause pre-release versions on `next` to include version bumps that were already released as stable versions, leading to version conflicts like `@astrojs/sitemap@3.6.1-beta.3` being published after `@astrojs/sitemap@3.7.0`.

## Steps

1. **Identify stale changesets.** Compare the changeset files on this branch against what exists on `origin/next`:
1. **Identify stale changesets.** Compare the changeset files (including those in the `.changeset/pre/` directory) on this branch against what exists on `origin/next`. Since the diff command is recursive, it will list all new markdown files automatically:

```bash
# List changeset .md files that are new (not in next already)
git diff --name-only --diff-filter=A origin/next -- .changeset/
```

Expand All @@ -27,22 +26,21 @@ When `main` is merged into `next`, changeset files (`.changeset/*.md`) that were
- Check if those bumps have already been released on `main` by looking at the current versions in `package.json` files on `origin/main`
- A changeset is stale if the version bump it describes has already been released

3. **Also check `pre.json`.** Read `.changeset/pre.json` if it exists. This file tracks the pre-release state. Ensure it does not reference any changesets that should be removed.

4. **Remove stale changesets.** Delete the identified files:
3. **Remove stale changesets.** Delete the identified files using their exact paths from the diff output:

```bash
git rm .changeset/<stale-file>.md
git rm <path-to-stale-changeset>
```

5. **Verify.** Check that the remaining changeset `.md` files look valid (proper frontmatter with package names and bump types).
4. **Verify.** Check that the remaining changeset `.md` files look valid (proper frontmatter with package names and bump types).

6. Do NOT commit or run `pnpm install` — the orchestrator will handle that.
5. Do NOT commit or run `pnpm install` — the orchestrator will handle that.

## Important Notes

- Do NOT remove changesets that are specific to `next` (ones that describe major version changes or new features being developed on `next`).
- Do NOT remove the `.changeset/config.json` file.
- Do NOT remove the `.changeset/pre/` folder.
- Do NOT remove `.changeset/pre.json` — it's needed for pre-release mode.
- If unsure whether a changeset is stale, err on the side of keeping it. A human reviewer can remove it later.

Expand Down
11 changes: 5 additions & 6 deletions .agents/skills/merge/evals/evals.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
},
{
"id": 2,
"prompt": "Run the merge skill with `step=clean-changesets` as an output-only dry run. Do not inspect or modify the checkout and do not execute commands. Use only this synthetic snapshot and return the exact removal list, required `pre.json` edit, and commands that would be used.\n\nNew files reported by `git diff --name-only --diff-filter=A origin/next -- .changeset/`:\n- `.changeset/fuzzy-rivers.md`\n- `.changeset/brave-stars.md`\n- `.changeset/quiet-moon.md`\n\n`.changeset/fuzzy-rivers.md`:\n```md\n---\n'@astrojs/sitemap': patch\n---\n\nFixes generated sitemap entries for encoded paths\n```\n\n`.changeset/brave-stars.md`:\n```md\n---\n'astro': major\n---\n\nAdds the version 6 route manifest API\n```\n\n`.changeset/quiet-moon.md`:\n```md\n---\n'@astrojs/node': patch\n---\n\nFixes response headers when streaming empty bodies\n```\n\n`origin/main` has `@astrojs/sitemap` 3.7.0 and its 3.7.0 changelog contains the exact fuzzy-rivers message. `origin/next` has 3.6.1-beta.2. Main has Astro 5.14.2, so brave-stars is next-only. Main's `@astrojs/node` version advanced for unrelated releases, but its history and changelog contain no quiet-moon message, so there is no evidence that quiet-moon was released.\n\n`.changeset/pre.json` is valid pre-mode JSON whose `changesets` array is `[\"fuzzy-rivers\", \"brave-stars\", \"quiet-moon\"]`.",
"expected_output": "A conservative changeset-cleanup dry run that removes only the demonstrably released sitemap changeset, removes its identifier from pre.json, and retains next-specific or uncertain changesets.",
"prompt": "Run the merge skill with `step=clean-changesets` as an output-only dry run. Do not inspect or modify the checkout and do not execute commands. Use only this synthetic snapshot and return the exact removal list from files in the `.changeset/pre/` folder, and commands that would be used.\n\nNew files reported by `git diff --name-only --diff-filter=A origin/next -- .changeset/pre/`:\n- `.changeset/pre/fuzzy-rivers.md`\n- `.changeset/pre/brave-stars.md`\n- `.changeset/pre/quiet-moon.md`\n\n`.changeset/pre/fuzzy-rivers.md`:\n```md\n---\n'@astrojs/sitemap': patch\n---\n\nFixes generated sitemap entries for encoded paths\n```\n\n`.changeset/pre/brave-stars.md`:\n```md\n---\n'astro': major\n---\n\nAdds the version 6 route manifest API\n```\n\n`.changeset/pre/quiet-moon.md`:\n```md\n---\n'@astrojs/node': patch\n---\n\nFixes response headers when streaming empty bodies\n```\n\n`origin/main` has `@astrojs/sitemap` 3.7.0 and its 3.7.0 changelog contains the exact fuzzy-rivers message. `origin/next` has 3.6.1-beta.2. Main has Astro 5.14.2, so brave-stars is next-only. Main's `@astrojs/node` version advanced for unrelated releases, but its history and changelog contain no quiet-moon message, so there is no evidence that quiet-moon was released.\n\n`.changeset/pre/` folder contains valid pre-mode Markdown changeset files.",
"expected_output": "A conservative changeset-cleanup dry run that removes only the demonstrably released sitemap changeset from `.changeset/pre/` folder, and retains next-specific or uncertain changesets.",
"files": [],
"assertions": [
"The removal list contains only `.changeset/fuzzy-rivers.md`.",
"The proposed `pre.json` result removes `fuzzy-rivers` from `changesets` while retaining `brave-stars` and `quiet-moon`.",
"The response retains `.changeset/brave-stars.md` as next-specific and `.changeset/quiet-moon.md` because its release status is unproven.",
"The proposed deletion command is `git rm .changeset/fuzzy-rivers.md`; neither `.changeset/pre.json` nor `.changeset/config.json` is deleted.",
"The removal list contains only `.changeset/pre/fuzzy-rivers.md`.",
"The response retains `.changeset/pre/brave-stars.md` as next-specific and `.changeset/pre/quiet-moon.md` because its release status is unproven.",
"The proposed deletion command is `git rm .changeset/pre/fuzzy-rivers.md`; neither `.changeset/pre/` nor `.changeset/config.json` is deleted.",
"No checkout file is actually modified, and no `pnpm`, install, or commit command is executed or proposed."
]
},
Expand Down
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
"$schema": "https://unpkg.com/@changesets/config@4.0.0/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "withastro/astro" }],
"commit": false,
"linked": [],
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,14 @@ jobs:

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
uses: changesets/action@8488615a623b1b9c987934bb89eae8af6a946ac1 # v2.1.1
with:
# Note: pnpm install after versioning is necessary to refresh lockfile
version: pnpm run version
publish: pnpm exec changeset publish
commit: "[ci] release"
title: "[ci] release"
env:
# Needs access to push to main
GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
# Use OIDC for npm authentication instead of NPM_TOKEN
NPM_TOKEN: '' # https://github.com/changesets/changesets/issues/1152#issuecomment-3190884868
version-script: pnpm run version
publish-script: pnpm exec changeset publish
commit-message: "[ci] release"
pr-title: "[ci] release"
github-token: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}

- name: Check if astro-vscode was published
id: vscode-published
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
"devDependencies": {
"@astrojs/check": "^0.9.5",
"@biomejs/biome": "2.5.3",
"@changesets/changelog-github": "^0.5.2",
"@changesets/cli": "^2.29.8",
"@changesets/changelog-github": "^1.0.0",
"@changesets/cli": "^3.0.1",
"@earendil-works/pi-ai": "^0.83.0",
"@flue/runtime": "^2.0.3",
"@types/node": "^22.10.6",
Expand Down
Loading
Loading