You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmd/gerritbot: avoid changing the content of comment sync messages
CL 525976 included an update of several messages to use
go.dev/wiki shortlinks instead of the equivalent
github.com/golang/go/wiki links, including to be more future-proof given
the wiki content is likely to move in the near future.
This included updating the URL used in the sync messages posted on the
GitHub PR to notify a contributor of a new Gerrit comment.
This in turn caused GerritBot to start re-posting what were effectively
duplicate sync comments to various open GitHub PRs. This is because
GerritBot's sync of Gerrit comments to the GitHub PR is nicely simple,
and currently relies on historical sync messages on the PR exactly
matching what the current incarnation of GerritBot would have posted for
old Gerrit comments. If the sync message content changes, GerritBot
thinks it has never posted about even old Gerrit comments because it
cannot find an exact match on the PR, and hence posts the new sync
message content about old Gerrit comments.
This CL restores the content of the sync messages, and adds a comment to
help future contributors.
The other messages modified in CL 525976 were not affected in
the same way because they are posted in reaction to an event
of creating a new GitHub PR or an update to the PR. Those other messages
have also recently been modified by other CLs without triggering
reposts.
CL 525976 was noticed as misbehaving within ~10 minutes of being
deployed. Also within ~10 minutes of being deployed, GerritBot
encountered a 403 error and stopped posting duplicates:
403 You have exceeded a secondary rate limit and have been
temporarily blocked from content creation
The deployment was rolled back ~10 minutes after that.
Updates golang/go#61573
Change-Id: Ibc5d299494baaa26118916799eaed023e5ccb26c
Reviewed-on: https://go-review.googlesource.com/c/build/+/530736
Reviewed-by: Heschi Kreinick <[email protected]>
Auto-Submit: Heschi Kreinick <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
// NOTE: care is required to update this message. GerritBot's sync of Gerrit comments
515
+
// to the GitHub PR is simple and currently relies on historical sync messages on the
516
+
// PR exactly matching what the current incarnation of GerritBot would have posted for
517
+
// old Gerrit comments. As implemented, changing the content here will cause
518
+
// GerritBot to post effectively duplicate messages to the GitHub PR. See CL 530736 for details.
519
+
// TODO: allow message content to evolve more easily, perhaps by writing an ID or timestamp
520
+
// for the Gerrit message being synced, or a coarser solution like having a time cutoff,
521
+
// or tracking more state, or some other solution.
513
522
header:=fmt.Sprintf("Message from %s:\n", authorName)
514
523
msg:=fmt.Sprintf(`
515
524
%s
516
525
517
526
---
518
527
Please don’t reply on this GitHub thread. Visit [golang.org/cl/%d](https://go-review.googlesource.com/c/%s/+/%d#message-%s).
519
-
After addressing review feedback, remember to [publish your drafts](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it)!`,
528
+
After addressing review feedback, remember to [publish your drafts](https://github.com/golang/go/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it)!`,
0 commit comments