Skip to content

Commit

Permalink
Fix & add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iarspider committed Dec 16, 2024
1 parent 8838fff commit c25291f
Show file tree
Hide file tree
Showing 6 changed files with 383 additions and 1 deletion.
2 changes: 1 addition & 1 deletion process_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2370,7 +2370,7 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
managers=releaseManagersList,
)
else:
if not "fully-signed-draft" in old_labels:
if ("fully-signed-draft" in labels) and (not "fully-signed-draft" in old_labels):
messageFullySignedDraft = f'@{pr.user.login} if this PR is ready to be reviewed by the release team, please remove the "Draft" status.'
if not dryRun:
issue.create_comment(messageFullySignedDraft)
Expand Down
90 changes: 90 additions & 0 deletions tests/PRActionData/TestProcessPr.test_draft_pr_ask_ready.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
{
"type": "load-bot-cache",
"data": {
"commits": {
"28ce3f5888b5433dcae409ee336b2ad422595246": {
"files": [
"FWCore/Utilities/BuildFile.xml"
],
"squashed": false,
"time": 1733495641
},
"9138474754099798ff50cb07287e7caa4786f247": {
"files": [
"FWCore/Utilities/BuildFile.xml"
],
"squashed": false,
"time": 1733482192
}
},
"emoji": {
"2523442237": "+1",
"2532358732": "+1",
"2545714988": "+1",
"2545738731": "+1"
},
"last_seen_sha": "28ce3f5888b5433dcae409ee336b2ad422595246",
"signatures": {
"2545714988": "28ce3f5888b5433dcae409ee336b2ad422595246",
"2545738731": "28ce3f5888b5433dcae409ee336b2ad422595246"
}
}
},
{
"type": "emoji",
"data": [
2523442237,
"+1",
true
]
},
{
"type": "emoji",
"data": [
2545714988,
"+1",
true
]
},
{
"type": "emoji",
"data": [
2545738731,
"+1",
true
]
},
{
"type": "add-label",
"data": [
"fully-signed-draft",
"l1-approved"
]
},
{
"type": "remove-label",
"data": [
"l1-pending",
"pending-signatures"
]
},
{
"type": "create-comment",
"data": "@iarspider if this PR is ready to be reviewed by the release team, please remove the \"Draft\" status."
},
{
"type": "edit-comment",
"data": "cms-bot internal usage<!-- bot cache: {\"commits\":{\"28ce3f5888b5433dcae409ee336b2ad422595246\":{\"files\":[\"FWCore/Utilities/BuildFile.xml\"],\"squashed\":false,\"time\":1733495641},\"9138474754099798ff50cb07287e7caa4786f247\":{\"files\":[\"FWCore/Utilities/BuildFile.xml\"],\"squashed\":false,\"time\":1733482192}},\"emoji\":{\"2523442237\":\"+1\",\"2532358732\":\"+1\",\"2545714988\":\"+1\",\"2545738731\":\"+1\"},\"last_seen_sha\":\"28ce3f5888b5433dcae409ee336b2ad422595246\",\"signatures\":{\"2545714988\":\"28ce3f5888b5433dcae409ee336b2ad422595246\",\"2545738731\":\"28ce3f5888b5433dcae409ee336b2ad422595246\"}} -->"
},
{
"type": "status",
"data": {
"commit": "28ce3f5888b5433dcae409ee336b2ad422595246",
"state": "success",
"target_url": "https://github.com/iarspider-cmssw/cmssw/pull/21#issuecomment-2545738731",
"description": "Comment by iarspider at 2024-12-16 14:13:40 UTC processed.",
"context": "bot/21/ack"
}
}
]
88 changes: 88 additions & 0 deletions tests/PRActionData/TestProcessPr.test_draft_pr_fully_signed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
[
{
"type": "load-bot-cache",
"data": {
"commits": {
"28ce3f5888b5433dcae409ee336b2ad422595246": {
"files": [
"FWCore/Utilities/BuildFile.xml"
],
"squashed": false,
"time": 1733495641
},
"9138474754099798ff50cb07287e7caa4786f247": {
"files": [
"FWCore/Utilities/BuildFile.xml"
],
"squashed": false,
"time": 1733482192
}
},
"emoji": {
"2523442237": "+1",
"2532358732": "+1",
"2545714988": "+1",
"2545738731": "+1"
},
"last_seen_sha": "28ce3f5888b5433dcae409ee336b2ad422595246",
"signatures": {
"2545714988": "28ce3f5888b5433dcae409ee336b2ad422595246",
"2545738731": "28ce3f5888b5433dcae409ee336b2ad422595246"
}
}
},
{
"type": "emoji",
"data": [
2523442237,
"+1",
true
]
},
{
"type": "emoji",
"data": [
2545714988,
"+1",
true
]
},
{
"type": "emoji",
"data": [
2545738731,
"+1",
true
]
},
{
"type": "add-label",
"data": [
"fully-signed"
]
},
{
"type": "remove-label",
"data": [
"fully-signed-draft"
]
},
{
"type": "create-comment",
"data": "This pull request is fully signed and it will be integrated in one of the next master IBs after it passes the integration tests. This pull request will now be reviewed by the release team before it's merged. iarspider (and backports should be raised in the release meeting by the corresponding L2)"
},
{
"type": "create-comment",
"data": "A new Pull Request was created by iarspider for master.\n\nIt involves the following packages:\n\n- FWCore/Utilities (**core**)\n\n\n can you please review it and eventually sign? Thanks.\nfelicepantaleo, makortel, missirol, wddgit this is something you requested to watch as well.\niarspider you are the release manager for this.\n\ncms-bot commands are listed <a href=\"http://cms-sw.github.io/cms-bot-cmssw-cmds.html\">here</a>\n"
},
{
"type": "status",
"data": {
"commit": "28ce3f5888b5433dcae409ee336b2ad422595246",
"state": "success",
"target_url": "https://github.com/iarspider-cmssw/cmssw/pull/21#issuecomment-2545742695",
"description": "Comment by iarspider at 2024-12-16 14:15:17 UTC processed.",
"context": "bot/21/ack"
}
}
]
Loading

0 comments on commit c25291f

Please sign in to comment.