[pull] main from tinacms:main - #311
Merged
Merged
Conversation
) Closes #6762 **TL;DR** Normalise branch names to valid Git refs at every branch creation site, and disable saving when the name normalises to empty, so "Save to new branch" no longer fails with a generic *Branch operation failed*. **Pain:** A collection `path` with a trailing slash (e.g. `content/articles/` on ssw.com.au) makes the create form build file paths like `content/articles//foo.mdx`. The default branch name derived from that path becomes `tina/articles//foo`, an invalid Git ref, so the server-side workflow fails and the UI only surfaces *Branch operation failed* plus a `Failed to check workflow status` console error. User-typed names containing spaces or other Git-forbidden characters failed the same way, and the `formatBranchName` helper was duplicated with diverged behaviour (the legacy branch switcher deleted invalid characters instead of hyphenating) while collapsing slash runs nowhere. **Solution:** Centralise the naming helpers in `@utils/branch-name` (`formatDefaultBranchName`, `normalizeBranchName`, and the previously duplicated `formatBranchName`) and normalise to `check-ref-format` rules at every creation site: the save-to-new-branch modal, both branch switchers, and the deleted-branch recovery modal. Normalisation collapses repeated and leading/trailing slashes, turns characters Git forbids in refs (whitespace, control characters, `~ ^ : ? * [ \` and the `@{` sequence) into hyphens, collapses `..` runs, and strips leading dots and trailing `.` / `.lock` per path component, using loop-based trims rather than the anchored regexes CodeQL flags. Save buttons are disabled while the name normalises to an empty string (e.g. `///`), and the helpers have unit tests (18 passing). --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
…et (#7459) Closes #7435 **TL;DR** Six dependency PRs merged in four days with no changeset, so none of them ever reached npm. This adds a CI check that flags it. **Pain:** A PR that changes a published package's dependencies without a changeset merges cleanly, produces no version bump, no changelog entry and no release, so the change never reaches npm users. Nothing catches it: CI is green, `dependency-review` only reports what a diff introduces, and review has missed it six times in four days (#7079, #7320, #7422, #7425, #7321, #7447). Two of those were security fixes, which meant the advisory stayed open for anyone installing the package while `main` looked fixed. A naive rule is not enough either, since plenty of manifest changes genuinely need no changeset. **Solution:** Adds `.github/scripts/check-changeset.mjs` and a `require-changeset` workflow that resolves which *published* packages a PR actually affects, either through a changed manifest or through a moved `catalog:` entry that a published package consumes, and skips anything private or listed in the changesets `ignore` config. The check goes red only when such a package is affected and no `.changeset/*.md` is present. It is **not** in the required-status-checks list (`license/cla`, `build (macOS-latest)`, `build (ubuntu-latest)`), so a failure is a visible red X rather than a merge blocker, and it fails open when it cannot determine an answer. Dependabot is deliberately not exempt, since its PRs are the ones that keep merging unreleased; a `skip-changeset` label is the escape hatch for a change that genuinely ships nothing. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )