Skip to content

feat(changelog): Let workspaces own or exclude unowned paths - #921

Merged
BYK merged 1 commit into
masterfrom
feat/changelog-unowned-paths
Oct 22, 2026
Merged

BYK merged 1 commit into
masterfrom
feat/changelog-unowned-paths

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Workspace changelogs treat every file outside all workspaces as shared, so it lands in every workspace's changelog. That breaks repos where an application lives at the root next to independently released packages. In getsentry/sentry, @sentry/scraps@0.2.0 picked up 785 commits since scraps@0.1.0; only 21 touched static/packages/scraps. The rest were backend changes under src/ and tests/.

This adds changelog.unownedPaths:

  • include (default): current behavior.
  • exclude: this workspace ignores files outside every workspace.
  • own: this workspace claims them, and every other workspace ignores them. Only one workspace may set own. Workspaces without their own changelog block inherit the top-level one, so a top-level own that reaches several workspaces is rejected.
workspaces:
  sentry:
    changelog:
      unownedPaths: own
  static/packages/scraps:
    changelog:
      policy: auto

First releases

A workspace's first release has no matching tag, so Craft read the whole repository history. When sentry switched scraps from scraps-v* to scraps@* tags, craft prepare ran through about 75k commits and ~1,500 GraphQL batches, and the run was cancelled after 34 minutes.

Now, when no previous tag exists and a workspace is selected, Craft walks back through .craft.yml history to the commit that first defined the workspace's key and starts there. If that commit has no parent, Craft keeps the full history. Craft now logs how many commits it reads: at info level when it found a starting commit, and as a warning when it falls back to the full history. Pushing a tag with the workspace's prefix still overrides this.

Against a sentry checkout at the 0.2.0 release base, a first release of static/packages/scraps reads 1,152 commits starting at the commit that added the workspace (getsentry/sentry#126643) and keeps 21 once sentry owns unowned paths.

Relation to #920

#920 handles includePaths when Craft runs without workspaces. This PR only changes workspace mode, so the two don't overlap in behavior. exclude is the workspace option that #920's open question describes. Both PRs edit the top of getChangesSince, so whichever lands second needs a small rebase.

via BYK.

--

View Junior Session in Sentry

Add changelog.unownedPaths (include, exclude, own) so a root application
can claim files outside every workspace, or a package can ignore them.

Start a workspace's first changelog at the commit that added it to
.craft.yml instead of the full repository history, and log how many
commits Craft reads when no previous tag exists.

Co-Authored-By: BYK <burak.kaya@sentry.io>
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-22 12:48 UTC

@BYK
BYK merged commit 843b6fc into master Oct 22, 2026
30 checks passed
@BYK
BYK deleted the feat/changelog-unowned-paths branch October 22, 2026 12:47
BYK added a commit that referenced this pull request Oct 22, 2026
`changelog.includePaths` and `changelog.unownedPaths` only change which
release workspace owns a path. A configuration without `workspaces` has
no ownership to change, so Craft accepted both settings and silently
ignored them. That's how the objectstore case behind #920 started:
`includePaths` in `clients/.craft.yml` looked like it should work, but
did nothing.

Validation now rejects either setting in the top-level `changelog` when
no `workspaces` are defined:

```
changelog.includePaths: Only release workspaces support this setting. Define "workspaces" to use it.
```

When `workspaces` exist, top-level values are still allowed because
workspaces inherit them.

This is a breaking change for configs that set these keys without
workspaces. A GitHub code search for `includePaths` in `.craft.yml`
finds only getsentry/toolkit, which uses it inside a workspace. Repos
like objectstore that need "only these directories" can define a
workspace with `unownedPaths: exclude` plus `includePaths` (#921). This
replaces the approach in #920.

<!-- junior-request-attribution:start -->
via **BYK**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A5fa09a4fbd66e4ebf0b123c1 -->

--

[View Junior Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A5fa09a4fbd66e4ebf0b123c1/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <burak.kaya@sentry.io>
BYK added a commit to getsentry/sentry that referenced this pull request Oct 22, 2026
Since the move to Craft release workspaces (#126643), Craft treats every
pnpm workspace directory as owned by something other than the `sentry`
workspace. That includes `static/app`, `static/gsApp`, `static/gsAdmin`,
`api-docs` and `tests/js`. Commits that only touch those directories are
dropped from the automatic `CHANGES` changelog. Between `scraps@0.1.0`
and the scraps 0.2.0 release base, that's 451 of 1,232 commits.

This lists those directories under `changelog.includePaths` for the
`sentry` workspace. With this config, 1,227 of the 1,232 commits are
kept. The 5 still excluded only touch `static/packages/scraps` or its
lint plugin. `includePaths` has been supported since Craft 2.32.0, below
our `minVersion` of 2.33.1.

The scraps and icons changelogs still pick up backend commits, because
files outside every workspace (`src/`, `tests/`, …) count as shared.
getsentry/craft#921 adds `changelog.unownedPaths: own` so the `sentry`
workspace can claim those files. Setting it here will be a follow-up
once that ships in a Craft release.

<!-- junior-request-attribution:start -->
via **BYK**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A5fa09a4fbd66e4ebf0b123c1 -->

--

[View Junior Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A5fa09a4fbd66e4ebf0b123c1/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <burak.kaya@sentry.io>

This branch was previously deployed

1 inactive deployment
false — 59d196cc Deployed Oct 22, 2026 by sentry-junior[bot] via Build #3157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant