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
[GitHub][workflows] Add buildbot information comment to first merged PR from a new contributor (#78292)
This change adds a comment to the first PR from a new contributor that
is merged, which tells them what to expect post merge from the build
bots.
How they will be notified, where to ask questions, that you're more
likely to be reverted than in other projects, etc. The information
overlaps with, and links to
https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr.
So that users who simply read the email are still aware, and know where
to follow up if they do get reports.
To do this, I have added a hidden HTML comment to the new contributor
greeting comment. This workflow will look for that to tell if the author
of the PR was a new contributor at the time they opened the merge. It
has to be done this way because as soon as the PR is merged, they are by
GitHub's definition no longer a new contributor and I suspect that their
author association will be "contributor" instead.
I cannot 100% confirm that without a whole lot of effort and probably
breaking GitHub's terms of service, but it's fairly cheap to work around
anyway. It seems rare / almost impossible to reopen a PR in llvm at
least, but in case it does happen the buildbot info comment has its own
hidden HTML comment. If we find this we will not post another copy of
the same information.
# When an issue is reopened, then closed as merged again, we should not
265
+
# add a second comment. This event will be rare in practice as it seems
266
+
# like it's only possible when the main branch is still at the exact
267
+
# revision that the PR was merged on to, beyond that it's closed forever.
268
+
returnFalse
269
+
returnfound_greeting
270
+
271
+
defrun(self) ->bool:
272
+
ifnotself.should_comment():
273
+
return
274
+
275
+
# This text is using Markdown formatting. Some of the lines are longer
276
+
# than others so that the final text is some reasonable looking paragraphs
277
+
# after the long URLs are rendered.
278
+
comment=f"""\
279
+
{PRBuildbotInformation.COMMENT_TAG}
280
+
@{self.author} Congratulations on having your first Pull Request (PR) merged into the LLVM Project!
281
+
282
+
Your changes will be combined with recent changes from other authors, then tested
283
+
by our [build bots](https://lab.llvm.org/buildbot/). If there is a problem with a build,
284
+
you may recieve a report in an email or a comment on this PR.
285
+
286
+
Please check whether problems have been caused by your change specifically, as
287
+
the builds can include changes from many authors. It is not uncommon for your
288
+
change to be included in a build that fails due to someone else's changes, or
289
+
infrastructure issues.
290
+
291
+
How to do this, and the rest of the post-merge process, is covered in detail [here](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr).
292
+
293
+
If your change does cause a problem, it may be reverted, or you can revert it yourself.
294
+
This is a normal part of [LLVM development](https://llvm.org/docs/DeveloperPolicy.html#patch-reversion-policy). You can fix your changes and open a new PR to merge them again.
295
+
296
+
If you don't get any reports, no action is required from you. Your changes are working as expected, well done!
297
+
"""
298
+
self.pr.as_issue().create_comment(comment)
299
+
returnTrue
300
+
301
+
243
302
defsetup_llvmbot_git(git_dir="."):
244
303
"""
245
304
Configure the git repo in `git_dir` with the llvmbot account so
0 commit comments