Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cms-bot command to add metadata to issues and PRs #2315

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions jenkins-jobs/es-link-issue.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import os

import es_utils
import base64


def main():
data = os.getenv("DATA", None)
data = base64.b64decode(data.replace("@", "\n").encode()).decode()
doc = json.loads(data)
index = doc.pop("index")
doc["@timestamp"] = int(time() * 1000)
payload = json.dumps(doc)
es_utils.send_payload(index + "-failures", index, None, payload)


if __name__ == "__main__":
main()
29 changes: 15 additions & 14 deletions process_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from categories import (
CMSSW_L2,
CMSSW_ORP,
CMSSW_L1,
TRIGGER_PR_TESTS,
CMSSW_ISSUES_TRACKERS,
PR_HOLD_MANAGERS,
Expand Down Expand Up @@ -204,7 +204,7 @@ def update_CMSSW_LABELS(repo_config):
check_dpg_pog = False
dpg_pog = {} if not check_dpg_pog else get_dpg_pog()
for l in CMSSW_LABELS.keys():
if check_dpg_pog and (not l in dpg_pog) and (not l in TYPE_COMMANDS):
if check_dpg_pog and (not l in dpg_pog):
del CMSSW_LABELS[l]
else:
CMSSW_LABELS[l] = [
Expand Down Expand Up @@ -1135,7 +1135,7 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
br = "_".join(pr.base.ref.split("/")[:2][-1].split("_")[:3]) + "_X"
if br:
extra_rm = extra_rm + get_release_managers(br)
releaseManagers = list(set(extra_rm + CMSSW_ORP))
releaseManagers = list(set(extra_rm + CMSSW_L1))
else:
try:
if (
Expand Down Expand Up @@ -1573,17 +1573,6 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
set_comment_emoji_cache(dryRun, bot_cache, comment, repository)

# end of parsing comments section
# Check if it needs to be automatically closed.
if mustClose:
if issue.state == "open":
print("This pull request must be closed.")
if not dryRun:
issue.edit(state="closed")
elif reOpen:
if issue.state == "closed":
print("This pull request must be reopened.")
if not dryRun:
issue.edit(state="open")

if issue.pull_request:
if (
Expand Down Expand Up @@ -2216,6 +2205,18 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
if add_labels:
issue.edit(labels=list(labels))

# Check if it needs to be automatically closed.
if mustClose:
if issue.state == "open":
print("This pull request must be closed.")
if not dryRunOrig:
issue.edit(state="closed")
elif reOpen:
if issue.state == "closed":
print("This pull request must be reopened.")
if not dryRunOrig:
issue.edit(state="open")

if not issue.pull_request:
issueMessage = None
if not already_seen:
Expand Down
Loading