-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[tools] handle commits merged without PR in deprecated script #10723
Conversation
Signed-off-by: Asra Ali <[email protected]>
# In this case we cannot add a user login for an assignee. | ||
change_title = commit.message.split('\n')[0] # Remove sign-off mesage | ||
number = ('commit %s') % commit.hexsha | ||
login = None |
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.
GitPython API can only give me author name and email, so I could not assign the issue to the NamedUser login like before. GitPython experts, is there a way?
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.
Not that I know of. Does assigning to email work? Worst case we could assign the script runner to find an owner and print that's what is going on, but it'd be nice if we could do better.
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.
I found search_users
functionality in the API -- I did guard against not finding the user, but I think (?) there's guarantee there will be a user with the email we find.
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.
Edit: I trial ran it without creating the issue, I successfully got your login with the script now:
envoy.reloadable_features.http1_flood_protection deprecation
commit f5b0294f0a7c2d143f6d4d94afae9a0e6f9dacf7 (http: adding response flood protection) introduced a runtime guarded feature. This issue tracks source code cleanup.
>> Assigning to alyssawilk
Signed-off-by: Asra Ali <[email protected]>
Output when running currently:
If I change the script so I deprecate after 1 Day I get:
|
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.
Cool, thanks for the fixes - I thought we'd had setec flags before - I wonder if the way we imported them changed?
number = ('#%d') % pr | ||
login = pr_info.user.login | ||
else: | ||
# Extract Commit message, sha, and author. |
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.
Commit - commit
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.
Done
else: | ||
# Extract Commit message, sha, and author. | ||
# In this case we cannot add a user login for an assignee. | ||
change_title = commit.message.split('\n')[0] # Remove sign-off mesage |
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.
It's not sign off but description too (if there is one) yes?
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.
Yep -- that's right it.
# In this case we cannot add a user login for an assignee. | ||
change_title = commit.message.split('\n')[0] # Remove sign-off mesage | ||
number = ('commit %s') % commit.hexsha | ||
login = None |
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.
Not that I know of. Does assigning to email work? Worst case we could assign the script runner to find an owner and print that's what is going on, but it'd be nice if we could do better.
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
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.
Cool, thanks for being the non-alyssar runner of our release scripts, and fixing the holes! LGTM from "this says it is doing what I think it should be doing" perspective but as far as I'm concerned I do not have python readability so mind getting a pass from someone who does? @junr03 maybe?
Please merge master. Also @junr03 PTAL. Thank you! /wait |
Signed-off-by: Asra Ali <[email protected]>
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.
Some suggestions. I think @alyssawilk is being generous re: my python readability :).
else: | ||
# Extract commit message, sha, and author. | ||
# In this case we cannot add a user login for an assignee. | ||
change_title = commit.message.split('\n')[0] # Remove description. |
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.
should we constrain the length of this message a little bit beyond the newline char? I feel like people could be more verbose here than in a PR title.
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.
Oh maybe, it looks like there's no enforced limit on the commit title. People seem to recommend 50/72 stylistically? I arbitrarily put 50.
print(title) | ||
print(body) | ||
print(' >> Assigning to %s' % pr_info.user.login) | ||
print(' >> Assigning to %s' % (login if login else email)) |
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.
I think you can used shorthand ternary here:
print(' >> Assigning to %s' % (login if login else email)) | |
print(' >> Assigning to %s' % (login or email)) |
Not sure which one is preferred by python people these days
Signed-off-by: Asra Ali <[email protected]>
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.
lgtm!
Signed-off-by: Spencer Lewis <[email protected]> * master: (46 commits) allow specifying the API version of bootstrap from the command line (envoyproxy#10803) config: adding connect matcher (unused) (envoyproxy#10894) Add missing dependency on `assert.h` (envoyproxy#10918) Lower heap and disk space used by kafka tests (envoyproxy#10915) [tools] handle commits merged without PR in deprecated script (envoyproxy#10723) tools: including working tree in modified_since_last_github_commit.sh diff. (envoyproxy#10911) rocketmq_proxy: implement rocketmq proxy [docs] PR template to include commit message (envoyproxy#10900) docs: breaking long word to stop content overflow. (envoyproxy#10880) Delete legacy connection pool code. (envoyproxy#10881) wasm: clarify how configuration is passed (envoyproxy#10782) issue template: clarify security/crash reporting (envoyproxy#10885) api/faq: add entry on incremental xDS. (envoyproxy#10876) router: retry overloaded requests (envoyproxy#10847) Remove inclusion of pthread.h, not needed for linux compilation (envoyproxy#10895) request_id: Add option to always set request id in response (envoyproxy#10808) xray: Use correct types for segment document output (envoyproxy#10834) router: fixing a watermark bug for streaming retries (envoyproxy#10866) http: auditing Path() calls for safety with Pathless CONNECT (envoyproxy#10851) Remove hardcoded type urls Part.2 (envoyproxy#10848) ...
Some commits (eg f5b0294 ) were added without a PR, so the script fails. Change so that issues can still be created.
This uses the commit message and sha instead of the PR title and number.
Testing:
I successfully got:
Flag envoy.reloadable_features.http1_flood_protection added at 2020-03-02 is not ready to remove
Instead of a crash. Tweaking the script to deprecate after 1 day and printing out the issue and title give me:
Signed-off-by: Asra Ali [email protected]