-
Notifications
You must be signed in to change notification settings - Fork 0
Chunk list of flaky items #6
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
Conversation
| occurrences_by_ann_path: Dict[str, List[Occurrence]] = {} | ||
| for o in occurrences: | ||
| occurrences_by_ann_path.setdefault(o.annotation_path, []).append(o) | ||
| items = [i for i in occurrences_by_ann_path.items()] | ||
| items.sort(key=lambda i: len(i[1]), reverse=True) # sort by number of occurrences, highest first | ||
|
|
||
| limit = 12 | ||
| items = items[:limit] |
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.
The diff is a bit weird here. These lines did not change at all. The definition of the json structure and this code block has just been swapped in the code
| data = { | ||
| "channel": state.slack_channel, |
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.
Instead of working with a static string and doing replacements there, we now have a data structure that gets serialized to json 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.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
find_flaky_tests.py:147
- [nitpick] The iteration variable 'i' is ambiguous; consider renaming it to 'index' for improved clarity.
content += " ".join([f"<{occr.check_url}|{i+1}> " for i, occr in enumerate(recent_occrs)])
find_flaky_tests.py:182
- [nitpick] Consider renaming the variable 'json' to something more descriptive (e.g., 'json_message') to avoid shadowing the built-in json module.
json = json_lib.dumps(data, indent=4)
Type of Change
Description
The list of items to show in the slack message is now split into chunks with 5 items each. This allows us to stay within the documented limit of 3000 characters for individual sections in a box kit slack message
Checklist