Skip to content

chore(repo): Minimize old snapshot comments on new releases#8010

Open
brkalow wants to merge 1 commit intomainfrom
brkalow/collapse-old-snapshots
Open

chore(repo): Minimize old snapshot comments on new releases#8010
brkalow wants to merge 1 commit intomainfrom
brkalow/collapse-old-snapshots

Conversation

@brkalow
Copy link
Member

@brkalow brkalow commented Mar 7, 2026

Description

Added a new step to the snapshot-release workflow that automatically minimizes previous snapshot result comments when a new snapshot is posted. This keeps PR discussions cleaner by collapsing outdated snapshot results and keeping focus on the latest one.

The step:

  • Fetches all comments on the PR
  • Filters for snapshot result comments (identified by the unique marker text)
  • Uses GitHub's GraphQL API to minimize each one with the OUTDATED classifier
  • Runs before the new snapshot comment is created

Type of change

  • 📖 Refactoring / dependency upgrade / documentation

Summary by CodeRabbit

  • Chores
    • Improved snapshot release workflow to automatically minimize and clean up previous snapshot release comments, streamlining release communication and enhancing clarity by reducing clutter in release discussions.

When a new snapshot release is created, previous snapshot result comments are now automatically minimized/collapsed to keep the PR clean and focused on the latest snapshot results.
@changeset-bot
Copy link

changeset-bot bot commented Mar 7, 2026

⚠️ No Changeset found

Latest commit: 33feb47

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Mar 7, 2026 3:36am

Request Review

@brkalow brkalow changed the title Minimize old snapshot comments on new releases chore(repo): Minimize old snapshot comments on new releases Mar 7, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 7, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@8010

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8010

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8010

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8010

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8010

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8010

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8010

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8010

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8010

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8010

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8010

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8010

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8010

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8010

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8010

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8010

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8010

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8010

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8010

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8010

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8010

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8010

commit: 33feb47

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 7, 2026

📝 Walkthrough

Walkthrough

This change adds a new step to the Snapshot release workflow in .github/workflows/release.yml. The step, named "Minimize previous snapshot comments," executes conditionally when the version-packages step outputs success. It uses the github-script action to query the last 100 comments on an issue, identifies comments containing the text "the snapshot version command generated the following package versions," and minimizes each matching comment via GraphQL mutation. The step integrates into the existing release comment flow as a conditional post-processing action.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'Minimize old snapshot comments on new releases' directly and accurately describes the main change: adding a workflow step to minimize previous snapshot comments during releases.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

342-370: Implementation looks good overall.

The logic correctly identifies and minimizes previous snapshot comments before creating a new one. The marker text matches the comment template, and the step placement ensures the new comment won't be minimized.

Optional improvements to consider:

  1. Error resilience: If a single minimize call fails, the loop throws and prevents the new snapshot comment from being created. Consider wrapping the mutation in a try-catch to allow the workflow to continue:

  2. Pagination edge case: per_page: 100 means snapshot comments beyond the first 100 won't be minimized. This is likely fine for most PRs but could be documented.

♻️ Optional: Add error handling for resilience
             for (const comment of snapshotComments) {
+              try {
                 await github.graphql(`
                   mutation MinimizeComment($id: ID!) {
                     minimizeComment(input: { subjectId: $id, classifier: OUTDATED }) {
                       minimizedComment {
                         isMinimized
                       }
                     }
                   }
                 `, { id: comment.node_id });
+              } catch (error) {
+                console.log(`Failed to minimize comment ${comment.id}: ${error.message}`);
+              }
             }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 342 - 370, The minimize loop may
abort on the first failure and also only fetches up to 100 comments; to fix,
wrap the graphql minimize call inside a try-catch around the code that iterates
snapshotComments (the for (const comment of snapshotComments) block) so a single
failing minimize mutation (github.graphql with mutation MinimizeComment) is
logged/ignored and doesn't stop the step, and consider adding pagination to the
comments fetch (the github.rest.issues.listComments call with per_page) or
document the 100-item limit if you choose not to paginate.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 342-370: The minimize loop may abort on the first failure and also
only fetches up to 100 comments; to fix, wrap the graphql minimize call inside a
try-catch around the code that iterates snapshotComments (the for (const comment
of snapshotComments) block) so a single failing minimize mutation
(github.graphql with mutation MinimizeComment) is logged/ignored and doesn't
stop the step, and consider adding pagination to the comments fetch (the
github.rest.issues.listComments call with per_page) or document the 100-item
limit if you choose not to paginate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 86c4220e-1d15-4d9f-9492-113c4684b7df

📥 Commits

Reviewing files that changed from the base of the PR and between 7fb870d and 33feb47.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants