-
Notifications
You must be signed in to change notification settings - Fork 4
Copy labels from linked issues to their linked PRs #10
Copy labels from linked issues to their linked PRs #10
Conversation
0917aa7
to
44e804d
Compare
44e804d
to
4e5d064
Compare
2aa9a33
to
af86a98
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
This is very good, very fast work. I did not expect this today!
-
Filtering on
linked:issue
is smart. -
We probably need to separate out label-mirroring and column-moving into separate jobs. The reason for this is that we want to mirror the labels before we triage. Which means the PR isn't on the Sprint board yet. Conversely, we only want to do column moving on the Sprint board. That means we'll need different queries.
-
We currently have an allowlist for label copying. I'm thinking we should move to a denylist.
-
Part of me wonders if there isn't a better way to do issue linking. I'm going to look into this.
-
I just had a crazy idea. If the first step of our bot is to set up a local, caching http proxy, we could probably minimize the number of API calls we do per hour without modifying actions. We could also probably give the proxy the token and nobody else.
c5761eb
to
1467c58
Compare
9ceed0f
to
0ffd6a9
Compare
0919594
to
50e28e2
Compare
44234a7
to
3aa8f55
Compare
6b532aa
to
ff117fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbestavros Can we get our output for this PR in the same format as #41 ?
org/repo#n: +added_label existing_label +other_added_label
e87f87c
to
4c7f683
Compare
enarx-copy-labels-linked
Outdated
|
||
# If there are any labels we need to add, add them. | ||
if len(unset_labels) > 0: | ||
print(f"Copying labels from issue {repo.name}#{issue.number} to PR {repo.name}#{pr.number}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(f"Copying labels from issue {repo.name}#{issue.number} to PR {repo.name}#{pr.number}") |
enarx-copy-labels-linked
Outdated
print(f"{repo.name}#{pr.number}:", end="") | ||
for label in sorted(to_set): | ||
state = "" if label in pr_labels else "+" | ||
print(f" {state}{label}", end="") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(f" {state}{label}", end="") | |
print(f" {state}'{label}'", end="") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the above fix, you can't tell if +intel sgx
is +'intel sgx'
or +'intel' 'sgx'
.
4c7f683
to
baf5ef5
Compare
baf5ef5
to
12028d7
Compare
# Get all issue numbers related to a PR. | ||
def get_related_issues(pr): | ||
# Regex to pick out closing keywords. | ||
regex = re.compile("(close[sd]?|fix|fixe[sd]?|resolve[sd]?)\s*:?\s+#(\d+)", re.I) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about cases where we'd close multiple issues? Does the bot need to take care of that?
This PR adds an action to copy labels from linked issues to their PRs.
Resolves #12.