chore(repo): Minimize old snapshot comments on new releases#8010
chore(repo): Minimize old snapshot comments on new releases#8010
Conversation
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.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
📝 WalkthroughWalkthroughThis change adds a new step to the Snapshot release workflow in 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
🧹 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:
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:
Pagination edge case:
per_page: 100means 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
📒 Files selected for processing (1)
.github/workflows/release.yml
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:
Type of change
Summary by CodeRabbit