Repository navigation
feat(changelog-preview): Preview several packages in one comment - #924
sentry-junior[bot] wants to merge 8 commits into
Conversation
…ws apart Co-Authored-By: Lorenzo Cian <17258265+lcian@users.noreply.github.com>
|
Co-Authored-By: Lorenzo Cian <17258265+lcian@users.noreply.github.com>
BYK
left a comment
There was a problem hiding this comment.
Ah, sounds great and thanks for the PR! I wonder if we can share a single PR with multiple change logs, collapsed by default? Looks possible with your markers which we can even move into the <details> elements or something or workspace headers?
MathurAditya724
left a comment
There was a problem hiding this comment.
This adds useful monorepo preview isolation that is separate from the AI-summary work merged in #929. Two follow-ups below: avoid directory-identity collisions and preserve the behavior in automated regression tests.
…t the preview step
MathurAditya724
left a comment
There was a problem hiding this comment.
Both earlier comments are addressed: normalization plus a hash separates sanitized paths, and committed fixture tests execute the actual preview step. The seven committed tests pass locally, with typechecking, ESLint and formatting also passing. Additional isolated probes passed for equivalent directory spellings, unsafe/Unicode names and CalVer behavior. One remaining status-mode collision is documented inline: GitHub compares status contexts case-insensitively, unlike comment markers. No other actionable correctness or DRY issues found in the three-file diff.
…survive case-insensitive status contexts
…ead of one per directory
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a3aa50c. Configure here.
…ch tip, not the event's base SHA
…f previewing nothing Running Craft through `cd` inside the fallback-guarded command swallowed a missing directory, so a mistyped single directory produced a green 'None' preview (master fails the step), and a mistyped entry in a multi-directory list was silently dropped. Check every directory up front. Co-Authored-By: Lorenzo Cian <17258265+lcian@users.noreply.github.com>
| inputs: | ||
| working-directory: | ||
| description: 'Directory to run Craft in (relative to repo root)' | ||
| description: 'Directory to run Craft in (relative to repo root). List one directory per line to preview several packages in one comment.' |
There was a problem hiding this comment.
This shouldn't be necessary when using workspaces: https://craft.sentry.dev/targets/github/#release-workspaces
And we should force people to use that rather than having multiple working directories with their own .craft.yml files
|
We're going to use workspaces which is the proper way to release multiple packages. |

Lets one changelog preview cover several packages: list their directories in
working-directory, one per line. The PR gets a single comment (or one status and job summary) with a collapsed section per package that the PR changes.Use case: one PR that touches two packages
Some repos release several packages from separate Craft configs. For example, getsentry/objectstore has a Python client and a Rust client, each with its own
.craft.yml. Today the only option is to call the preview workflow once per package, and then a PR that changes both clients breaks:craft-changelog-previewcomment, so the second overwrites the first. Only one preview survives, and nothing says which package it's for.Changelog Preview / Semver Impactcontext, so the last one wins.The earlier version of this PR gave each directory its own comment and status. As review pointed out, that's noisy. It also needed hashing to keep statuses apart under GitHub's case-insensitive contexts. Rendering every package in one job avoids both problems, and there's no race between jobs editing a shared comment.
The change
The preview becomes:
craft changelog --pradds the PR to every changelog it renders, so the step only renders the packages this PR changes, usinggit diff --quiet <base>...HEAD -- <dir>. If it changes none of them, the preview says so.Changelog Preview / Semver Impact. Its description lists each package, e.g.clients/python: Minor, clients/rust: Patch(cut to GitHub's 140-character limit). The job summary has the same sections as the comment.bump_type,pr_skippedandversioning_policycome from the package with the biggest bump. When no package is changed,pr_skippedistrue, sorequire-conventional-titledoesn't fail PRs outside the packages..and a sub-directory in both modes. The comment body, job summary, status arguments and step outputs were byte-for-byte identical. The step now runs from the repo root andcds into the directory forcraft, instead of setting the step'sworking-directory.working-directoryinput row and a short "Multiple Packages" section indocs/src/content/docs/github-actions.md.Testing
src/__tests__/changelog-preview-workflow.test.tsruns the real "Generate Changelog Preview" step from the workflow file in a temp git repo with a base commit and a PR commit. It uses a stubbedcraftand a fakeghthat stores comments and records statuses. Lookups go through the step's own--jqfilter. It covers:'',.andpackages/pythonkeep the single-package layout and update one comment in place;./packages/rust/works, andbump_typeis the biggest;pr_skipped=true;actionlint,prettier,eslintandtscare clean. I haven't run it on a real PR.Details
via Junior system actor
event.--
View Junior Session [Sentry]