Skip to content

fix(linear-sync): add stable release comment dedup#3758

Open
Piotr1215 wants to merge 2 commits intomainfrom
devops-713/update-linear-sync-teams
Open

fix(linear-sync): add stable release comment dedup#3758
Piotr1215 wants to merge 2 commits intomainfrom
devops-713/update-linear-sync-teams

Conversation

@Piotr1215
Copy link
Copy Markdown
Contributor

Summary

  • Adds duplicate check for "Now available in stable release" comments before posting them
  • Backports ListIssueComments and hasStableReleaseComment from vcluster-pro/loft-enterprise copies
  • Part of cross-repo effort to bring all three hack/linear-sync copies to feature parity

Without 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

  • vcluster-pro: adds ValidTeamKeys filtering (pending)
  • loft-enterprise: adds ValidTeamKeys filtering + strict-filtering flag (pending)

Closes DEVOPS-713

Test plan

  • Unit tests for hasStableReleaseComment added and passing
  • All existing tests pass (go test ./... -count=1)

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
@Piotr1215 Piotr1215 requested a review from a team as a code owner April 1, 2026 09:37
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

// indicate that a stable release comment has already been posted.
func hasStableReleaseComment(comments []string) bool {
for _, body := range comments {
if strings.HasPrefix(body, stableReleaseCommentPrefix) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@Piotr1215 Piotr1215 added backport-to-v0.32 backport this PR to v0.32 branch backport-to-v0.33 labels Apr 1, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v0.32 backport this PR to v0.32 branch backport-to-v0.33

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants