-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Typing files from scripts folder #16493
Conversation
Hi @aasiffaizal, can you complete the following:
|
Hi, @aasiffaizal, this pull request does not have a "CHANGELOG: ..." label as mentioned in the PR pointers. Assigning @aasiffaizal to add the required label. PRs without this label will not be merged. If you are unsure of which label to add, please ask the reviewers for guidance. Thanks! |
"""Print summary of linter error messages. | ||
|
||
Args: | ||
lint_messages: list(str). List of linter error messages. | ||
""" | ||
if lint_messages != '': |
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.
lint_messages is a list of str
and hence this condition is not necessary
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 check if the lint_messages
is non-empty?
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.
Added that check
@@ -367,6 +397,8 @@ def check_test_results(tasks, task_to_taskspec, generate_coverage_report): | |||
) | |||
|
|||
try: | |||
if not tests_failed_regex_match: |
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.
Raising an attribute error since there is an exception handler below to handle if there are no matches
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.
Please add some description to the errors, I know it is going to be lost when we handle it but it still make sense for readability.
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.
Added the 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.
No I meant do Exception('<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.
done
@vojtechjelinek @sahiljoster32 @U8NWXD Could you, please take a look? |
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!
Unassigning @sahiljoster32 since they have already approved the PR. |
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.
Thanks! Just a few nits.
scripts/linters/pre_commit_linter.py
Outdated
@@ -532,11 +578,11 @@ def _get_task_output(lint_messages, failed, task): | |||
return failed | |||
|
|||
|
|||
def _print_errors_stacktrace(errors_stacktrace): | |||
def _print_errors_stacktrace(errors_stacktrace: List[Optional[str]]) -> 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.
Why can the items be 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.
It can be None
because the type of stack_trace
is as follows
oppia/scripts/concurrent_task_utils.py
Line 106 in 58d1033
self.stacktrace: Optional[str] = None |
It is appended to the list over here
oppia/scripts/concurrent_task_utils.py
Line 162 in 58d1033
ALL_ERRORS.append(task.stacktrace) |
should I append to the list only if the stacktrace is present?
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.
Hmm, I would say that if we have task.exception
but no task.stacktrace
then we probably have some kind of issue and we should print something else instead of the stacktrace.
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.
Yeah that makes sense.
done
@@ -367,6 +397,8 @@ def check_test_results(tasks, task_to_taskspec, generate_coverage_report): | |||
) | |||
|
|||
try: | |||
if not tests_failed_regex_match: |
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.
No I meant do Exception('<description>')
Hi @aasiffaizal, the build of this PR is stale and this could result in tests failing in develop. Please update this pull request with the latest changes from develop. Thanks! |
@vojtechjelinek, Addressed all the comments. PTAL! |
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.
Thanks! Took a pass.
Addressed all the comments @vojtechjelinek. PTAL |
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!
@aasiffaizal it looks like this PR introduced a backend flake (documented in #16600). Can you investigate? We can't do a clean revert, so if you can fix it fast, that might be faster than reverting manually |
Replied in the issue. I'll take a look at it |
Overview
scripts/linters/pre_commit_linter
,scripts/linters/python_linter
,scripts/run_backend_tests.py
and their test files.Essential Checklist
Proof that changes are correct
Proof of changes on desktop with slow/throttled network
Proof of changes on mobile phone
Proof of changes in Arabic language
PR Pointers