fix(linear-sync): add stable release comment dedup#3758
fix(linear-sync): add stable release comment dedup#3758
Conversation
Without this check, the linear-sync tool would add duplicate "Now available in stable release" comments on issues that were already released in a pre-release. This backports the dedup logic from vcluster-pro and loft-enterprise copies. Closes DEVOPS-713
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43007074f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
hack/linear-sync/linear.go
Outdated
| // indicate that a stable release comment has already been posted. | ||
| func hasStableReleaseComment(comments []string) bool { | ||
| for _, body := range comments { | ||
| if strings.HasPrefix(body, stableReleaseCommentPrefix) { |
There was a problem hiding this comment.
Scope dedup check to the current stable release
Using only strings.HasPrefix(..., "Now available in stable release") makes the dedup global across all stable releases, so once an issue has any prior stable-release comment, future runs will skip posting comments for later stable tags. This breaks cases where the same Linear issue is intentionally shipped again (for example, backports/cherry-picks in a later stable release) because the new release annotation is never added. Compare against the full expected comment (or at least include the current releaseTagName) instead of a prefix-only match.
Useful? React with 👍 / 👎.
the prefix-only check ("Now available in stable release") was too broad
and would skip posting comments for later stable releases if any prior
stable release comment existed. now checks for the specific release tag
so cherry-picks released in a later version still get their own comment.
addresses codex review feedback on #3758.
Summary
ListIssueCommentsandhasStableReleaseCommentfrom vcluster-pro/loft-enterprise copieshack/linear-synccopies to feature parityWithout this, the same stable release comment could be posted multiple times on an issue if a stable release was re-triggered or if the sync ran more than once for the same release.
Cross-repo PRs
Closes DEVOPS-713
Test plan
hasStableReleaseCommentadded and passinggo test ./... -count=1)