-
Notifications
You must be signed in to change notification settings - Fork 566
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
Handle disfunctional issue handlers properly in triage #4476
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
80d27d5
Adding logging to figure out what issue tracker is being instanciated
vitorguidi ebeba8d
Uncomment grouping
vitorguidi 3e0ed9a
Log the reason for testcase to be skipped in triage
vitorguidi 07b3b63
Fix lint
vitorguidi bf771e9
Fix misuse of project tracker type
vitorguidi 64470a0
Wrapping issue tracker calls with try except after grouping
vitorguidi 6e9bc64
Fix unit tests
vitorguidi 0d31426
Revert "Wrapping issue tracker calls with try except after grouping"
vitorguidi 570daa0
Catch ValueError in triage when issue tracker is not defined for a pr…
vitorguidi 62f0d7d
Fix lint
vitorguidi 4713a6c
Fix nit
vitorguidi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -353,37 +353,50 @@ def main(): | |
testcase = data_handler.get_testcase_by_id(testcase_id) | ||
except errors.InvalidTestcaseError: | ||
# Already deleted. | ||
logs.info( | ||
f'Skipping testcase {testcase_id}, since it was already deleted.') | ||
continue | ||
|
||
critical_tasks_completed = data_handler.critical_tasks_completed(testcase) | ||
|
||
# Skip if testcase's job is removed. | ||
if testcase.job_type not in all_jobs: | ||
logs.info(f'Skipping testcase {testcase_id}, since its job was removed ' | ||
f' ({testcase.job_type})') | ||
continue | ||
|
||
# Skip if testcase's job is in exclusions list. | ||
if testcase.job_type in excluded_jobs: | ||
logs.info(f'Skipping testcase {testcase_id}, since its job is in the' | ||
f' exclusion list ({testcase.job_type})') | ||
continue | ||
|
||
# Emmit the metric for testcases that should be triaged. | ||
_emit_untriaged_testcase_age_metric(critical_tasks_completed, testcase) | ||
|
||
# Skip if we are running progression task at this time. | ||
if testcase.get_metadata('progression_pending'): | ||
logs.info(f'Skipping testcase {testcase_id}, progression pending') | ||
continue | ||
|
||
# If the testcase has a bug filed already, no triage is needed. | ||
if _is_bug_filed(testcase): | ||
logs.info( | ||
f'Skipping testcase {testcase_id}, since a bug was already filed.') | ||
continue | ||
|
||
# Check if the crash is important, i.e. it is either a reproducible crash | ||
# or an unreproducible crash happening frequently. | ||
if not _is_crash_important(testcase): | ||
logs.info( | ||
f'Skipping testcase {testcase_id}, since the crash is not important.') | ||
continue | ||
|
||
# Require that all tasks like minimizaton, regression testing, etc have | ||
# finished. | ||
if not critical_tasks_completed: | ||
logs.info( | ||
f'Skipping testcase {testcase_id}, critical tasks still pending.') | ||
continue | ||
|
||
# For testcases that are not part of a group, wait an additional time to | ||
|
@@ -398,29 +411,40 @@ def main(): | |
# metadata works well. | ||
if not testcase.group_id and not dates.time_has_expired( | ||
testcase.timestamp, hours=data_types.MIN_ELAPSED_TIME_SINCE_REPORT): | ||
logs.info(f'Skipping testcase {testcase_id}, pending grouping.') | ||
continue | ||
|
||
if not testcase.get_metadata('ran_grouper'): | ||
# Testcase should be considered by the grouper first before filing. | ||
logs.info(f'Skipping testcase {testcase_id}, pending grouping.') | ||
continue | ||
|
||
# If this project does not have an associated issue tracker, we cannot | ||
# file this crash anywhere. | ||
issue_tracker = issue_tracker_utils.get_issue_tracker_for_testcase(testcase) | ||
try: | ||
issue_tracker = issue_tracker_utils.get_issue_tracker_for_testcase( | ||
testcase) | ||
except ValueError: | ||
issue_tracker = None | ||
if not issue_tracker: | ||
logs.info(f'No issue tracker detected for testcase {testcase_id}, ' | ||
'publishing message.') | ||
issue_filer.notify_issue_update(testcase, 'new') | ||
continue | ||
|
||
# If there are similar issues to this test case already filed or recently | ||
# closed, skip filing a duplicate bug. | ||
if _check_and_update_similar_bug(testcase, issue_tracker): | ||
logs.info(f'Skipping testcase {testcase_id}, since a similar bug' | ||
' was already filed.') | ||
continue | ||
|
||
# Clean up old triage messages that would be not applicable now. | ||
testcase.delete_metadata(TRIAGE_MESSAGE_KEY, update_testcase=False) | ||
|
||
# File the bug first and then create filed bug metadata. | ||
# # File the bug first and then create filed bug metadata. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extra |
||
if not _file_issue(testcase, issue_tracker, throttler): | ||
logs.info(f'Issue filing failed for testcase id {testcase_id}') | ||
continue | ||
|
||
_create_filed_bug_metadata(testcase) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 the part that solves the incident, along deleting the config
@jonathanmetzman