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

Update script for backporting. #9685

Merged
merged 1 commit into from
Mar 17, 2020
Merged

Conversation

KochetovNicolai
Copy link
Member

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category (leave one):

  • Build/Testing/Packaging Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix auto-label for backporting script.

next_category = True

if category in Description.MAP_CATEGORY_TO_LABEL:
self.label_name = Description.MAP_CATEGORY_TO_LABEL[category]
else:
if not category:
print('Cannot find category in pr description')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe print PR number too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is printed in message before. like
Trying to auto-label pull-request: 8882

@@ -10,6 +10,10 @@ class Description:
'Performance Improvement': 'pr-performance',
# 'Backward Incompatible Change': doesn't match anything
'Build/Testing/Packaging Improvement': 'pr-build',
'Non-significant (changelog entry is not needed)': 'pr-non-significant',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe reuse pr-other tag? It's shorter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that tag pr-non-significant is less surprising than pr-other while converting from this description.

@@ -80,6 +80,8 @@

members = set(github.get_members("ClickHouse", "ClickHouse"))
def print_responsible(pull_request):
if "author" not in pull_request or pull_request["author"] is None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which cases this may happen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a case when there was an exception and pull_request["author"] was None

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/nik-kochetov/dev/ClickHouse/utils/github/__main__.py", line 117, in <module>
    print(f'{CROSS_MARK} {bad["number"]}: {bad["url"]} ({print_responsible(bad)})')
  File "/home/nik-kochetov/dev/ClickHouse/utils/github/__main__.py", line 83, in print_responsible
    if pull_request["author"]["login"] in members:
TypeError: 'NoneType' object is not subscriptable

But I have lost exact pr :(

@KochetovNicolai KochetovNicolai merged commit cf7b6a4 into master Mar 17, 2020
@KochetovNicolai KochetovNicolai deleted the backport-script-fixes branch March 17, 2020 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants