-
-
Notifications
You must be signed in to change notification settings - Fork 740
fix: Handling of site connection issues during outage #3470
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
Open
rippyboii
wants to merge
140
commits into
python-discord:main
Choose a base branch
from
rippyboii:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
140 commits
Select commit
Hold shift + click to select a range
9d344a8
test: add Filtering cog_load and test scaffold and mocked setup
rippyboii 81681ed
docs: import report template (#7)
carlisaksson 7a66cd4
test: cover cog_load behavior when filter list fetch fails
rippyboii 26d30a8
feat: Add retry error filter and mod alert for filter load failures #6
rippyboii 8c3f009
feat: add retry with exponential backoff for filter list loading #6
rippyboii 9253760
test: add tests for invalid extensions and cogs (#3)
96e3018
fix: updated untracked unit test
rippyboii 0bfb84e
feat: add centralized exception logging for extensions and cogs (#3)
a-runebou 0995803
feat: add backoff retry loading (#15)
kahoujo1 2fb991a
fix: added filtering cog retry test and fixed cog_load startup tests #13
rippyboii 2fe59dd
feat: alert mods through discord (#15)
kahoujo1 6216c17
test: Added filtering cog retry-path tests for success and final-fail…
rippyboii 685788e
feat: add helper for checking if error is retryable (#16)
carlisaksson 7727c30
fix: updated filter_load_max_attempts contant to reuse connect_max_re…
rippyboii aa9ec7a
fix: added 408: Request Timeout Error, to imply for retryable and it'…
rippyboii ea30b97
test: add test skeleton and valid load test (#15)
kahoujo1 b5c99bf
feat: Adds retry logic with time buff to `Filtering.cog_load()`
rippyboii bcf9cb9
feat: add retry logic to python_news (#16)
carlisaksson 200a4d8
test: test retry functionality (#15)
kahoujo1 4336867
fix: rewrite test to pass checks (#15)
kahoujo1 9ce2efa
docs: add comments in the cog_load function (#15)
kahoujo1 bac8217
fix: check if the error is retriable (#15)
kahoujo1 4f209a6
feat: alert moderators after max attempts (#16)
carlisaksson 3d0ad6c
feat: add startup failure status message logs (#3 #5)
a-runebou d73ee44
docs: add brief project description (#7)
kahoujo1 b1d23d4
docs: add onboarding experience (#7)
kahoujo1 fe46c4c
docs: write issue overview (#7)
kahoujo1 b3c9edb
docs: add requirements (#7)
kahoujo1 9fe59db
docs: rewrite requirements (#7)
kahoujo1 c989eae
test: add superstarify tests (#14)
crancker96 81f8d34
feat: add logic to functions (#14)
crancker96 3b8d7eb
test: more unit tests for superstarify (#14)
crancker96 f1397a2
merge: merge filters load_cog retries (#13)
a-runebou c27fb5a
merge: Add retry logic with exponential backoff for `Reminders.cog_lo…
kahoujo1 5df0dbc
docs: added example in setting up the project #7
rippyboii 442d7d8
docs: Created table for the Effort spent #7
rippyboii 7647464
docs: created dependencies and setup task table #7
rippyboii 214df2b
docs: added code changes and patch #7
rippyboii 6d0f23f
docs: added test results for both after and before implementation #7
rippyboii 0b89bdb
fix: remove duplicate moderator notification in filters extension (#3)
a-runebou 642f699
merge: merge reminder retries (#15)
a-runebou d582b80
docs: updated overall experience section
rippyboii 8ecd602
fix: remove duplicate moderator notification in reminders extension (#3)
a-runebou 768b2fa
test: mocked setup and pythonNews tests (#16)
carlisaksson 7dd05a0
Merge pull request #19 from rippyboii/issue/3
a-runebou e534601
refactor: remove local mod alerting and update tests (#16)
carlisaksson af38322
Merge branch 'dev' into issue/14
crancker96 4e203c2
refactor: remove _alert_mods_if_loading_failed() (#14)
crancker96 f802833
doc: add effort spent (#7)
crancker96 695f0eb
docs: describe design patterns and our modifications (Closes #25)
a-runebou 6e1c8cd
docs: add personal time spent Alexander (#7)
a-runebou 989b257
merge: add retry logic for pythonNews cog (#16)
a-runebou ae6cd0d
merge: add retry logic for superstarify cogs (Closes #14)
a-runebou 8428c67
test: add tests for invalid extensions and cogs (#3)
b5782ab
feat: add centralized exception logging for extensions and cogs (#3)
a-runebou 50cdacc
feat: add startup failure status message logs (#3 #5)
a-runebou f22028b
test: add Filtering cog_load and test scaffold and mocked setup
rippyboii f4d398b
test: cover cog_load behavior when filter list fetch fails
rippyboii 43f1c5b
feat: Add retry error filter and mod alert for filter load failures #6
rippyboii 8b575f6
feat: add retry with exponential backoff for filter list loading #6
rippyboii 2cbb226
fix: updated untracked unit test
rippyboii f10d6fa
fix: added filtering cog retry test and fixed cog_load startup tests #13
rippyboii 92fc442
test: Added filtering cog retry-path tests for success and final-fail…
rippyboii 71bf092
fix: updated filter_load_max_attempts contant to reuse connect_max_re…
rippyboii 0f81c17
fix: added 408: Request Timeout Error, to imply for retryable and it'…
rippyboii feff4b2
fix: remove duplicate moderator notification in filters extension (#3)
a-runebou e38f365
feat: add backoff retry loading (#15)
kahoujo1 e098a66
feat: alert mods through discord (#15)
kahoujo1 4754f19
test: add test skeleton and valid load test (#15)
kahoujo1 6d9fc0c
test: test retry functionality (#15)
kahoujo1 e1c3796
fix: rewrite test to pass checks (#15)
kahoujo1 49e9639
docs: add comments in the cog_load function (#15)
kahoujo1 abaccdf
fix: check if the error is retriable (#15)
kahoujo1 673d486
fix: remove duplicate moderator notification in reminders extension (#3)
a-runebou 97cdf38
feat: add helper for checking if error is retryable (#16)
carlisaksson 972d298
feat: add retry logic to python_news (#16)
carlisaksson 015927e
feat: alert moderators after max attempts (#16)
carlisaksson 2159edb
test: mocked setup and pythonNews tests (#16)
carlisaksson cd46116
refactor: remove local mod alerting and update tests (#16)
carlisaksson 1afa433
test: add superstarify tests (#14)
crancker96 cc59caf
feat: add logic to functions (#14)
crancker96 62d115a
test: more unit tests for superstarify (#14)
crancker96 1e733d5
refactor: remove _alert_mods_if_loading_failed() (#14)
crancker96 e8c4357
docs: add estimated effort Carl (#7)
carlisaksson be836c3
docs: argue benefits in the context of SEMAT (closes #27)
kahoujo1 bd7fc01
Merge branch 'documentation' of github.com:rippyboii/python-bot into …
kahoujo1 d13351d
docs: add total and individual effort spent (#7)
kahoujo1 262838c
docs: trace tests to requirements (Closes #26)
kahoujo1 8631534
docs: decribe architecture and purpose (#24)
a-runebou 7a48446
docs: write the Essence TEAM part (#7)
kahoujo1 7cc7bfa
doc: Add UML (#17)
crancker96 bd7389a
docs: added table of the content at the top #7
rippyboii 278569e
merge: Merge remote-tracking branch 'origin' into documentation
rippyboii ab2adee
Merge branch 'documentation' of github.com:rippyboii/python-bot into …
rippyboii dc127bd
doc: replace UML bit map with svg (#30)
crancker96 7f43428
fix: replace bitmap with svg (#30)
a-runebou 363c0a8
merge: Merge branch 'documentation' of github.com:rippyboii/python-bo…
a-runebou 9181201
docs: added the team member names #7
rippyboii 516d5b2
merge: Merge branch 'documentation' of github.com:rippyboii/python-bo…
rippyboii 25f7aaf
fix: fix svg (#30)
a-runebou 47ff624
merge: Merge branch 'dev'
rippyboii 442b2ab
merge: Merge remote-tracking branch 'origin/main' into documentation
rippyboii 8eba6aa
merge: Merge branch 'documentation' of github.com:rippyboii/python-bo…
rippyboii ffb1905
docs: add expected behavior for requirements (#33)
kahoujo1 c1325f1
docs: add test structure to requirements (#33)
kahoujo1 3e87546
refactor: add back-off constant (#40)
kahoujo1 6805c9a
refactor: update constants in reminders (#40)
kahoujo1 e64ccf4
refactor: update constants in filtering (#40)
kahoujo1 1e27dde
refactor: update constants in python news (#40)
kahoujo1 7bfd50d
refactor: update constants in superstarify (#40)
kahoujo1 cc0f3a1
fix: remove uncalled method (Closes #36)
a-runebou 3700aee
refactor: rename variables (Closes #38)
a-runebou 4d78a81
refactor: simplyfy merging of lines (Closes #39)
a-runebou 8d4d0a0
refactor: remove explicit context helper function (Closes #45)
a-runebou 7a637c3
refactor: remove dataclass label (Closes #47)
a-runebou 4e40408
refactor: updated the testcases accordingly #36
rippyboii c0ced04
merge: Unified max number of retries and the back-off time using cons…
kahoujo1 a1f890f
merge: remove uncalled method
a-runebou f83a2da
merge: make variables more descriptive
a-runebou a3a87d6
merge: simplify merging of lines in notification
a-runebou a453851
merge: remove explicit context helper function
a-runebou 3f3fa8f
merge: remove dataclass label
a-runebou 7e20fee
refactor: add back-off constant (#40)
kahoujo1 4b196cc
refactor: update constants in reminders (#40)
kahoujo1 7d0f75d
refactor: update constants in filtering (#40)
kahoujo1 1704c9f
refactor: update constants in python news (#40)
kahoujo1 8428cac
refactor: update constants in superstarify (#40)
kahoujo1 0d14e70
fix: remove uncalled method (Closes #36)
a-runebou 02e89ed
refactor: updated the testcases accordingly #36
rippyboii 955682d
refactor: rename variables (Closes #38)
a-runebou 8310588
refactor: simplyfy merging of lines (Closes #39)
a-runebou 1524aff
refactor: remove explicit context helper function (Closes #45)
a-runebou b5fc5b2
refactor: remove dataclass label (Closes #47)
a-runebou 4d73aad
refactor: Move the duplicated retry classifier out of the cogs into a…
rippyboii 3642840
merge: Merge branch 'issue/50' into dev
rippyboii 695206e
refactor: Updated superstarify.py to use the shared retry helper from…
rippyboii 791bb8e
refactor: updated _fetch_with_retries to use logic from filterign #55
rippyboii fe2a8a3
merge: Merge branch 'documentation' of github.com:rippyboii/python-bo…
rippyboii c2a5cbd
docs: fixed test file paths #7
rippyboii 988666a
merge: add report to main (#7)
kahoujo1 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from pydis_core.site_api import ResponseCodeError | ||
|
|
||
|
|
||
| def is_retryable_api_error(error: Exception) -> bool: | ||
| """Return whether an API error is temporary and worth retrying.""" | ||
| if isinstance(error, ResponseCodeError): | ||
| return error.status in (408, 429) or error.status >= 500 | ||
|
|
||
| return isinstance(error, (TimeoutError, OSError)) |
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.
I would probably
breakhere instead ofreturn.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.
Hi,
Since a successful fetch means
cog_load()is finished afterself.fetch_new_media.start(), so we thoughtreturnwould be a good fit to exit the whoel function instead of breaking a loop.If you think this doesn't fit the patch-style or the convention, we can update it in next commit.