Skip to content

docs: document changeset branch hygiene — prevent cross-PR changeset leaks #754

Closed

Description

@diberry

Problem

When a feature branch carries commits from other PRs (e.g., via merge or cherry-pick), their .changeset/*.md files leak into the new PR's diff. This happened on PR #753 which accidentally included #752's pr-readiness-checks.md changeset.

Root Cause

Branch scope pollution — the branch wasn't rebased cleanly from dev before the PR was opened.

Fix

Add guidance to CONTRIBUTING.md about changeset hygiene:

  1. Always rebase from dev before opening a PR
  2. Check \git diff origin/dev --name-only -- .changeset/\ — you should only see YOUR changeset file(s)
  3. If you see someone else's changeset, revert it: \git checkout origin/dev -- .changeset/{file}\

Optional CI Enhancement

The PR readiness workflow could warn when changeset files in the diff don't match the PR's scope (future work, low priority).

Next Steps

Update CONTRIBUTING.md with a 'Changeset Hygiene' section covering the above guidance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions