fix: bare except clauses, noisy logging, and dead type annotation in API server and frontend handlers#5364
Merged
michaelkedar merged 3 commits intoMay 15, 2026
Conversation
… noise - Replace 4 bare `except:` blocks in _match_versions/_match_events with `except Exception:` to avoid silently catching SystemExit/KeyboardInterrupt - Downgrade the noisy ecosystem-helper logging.error to logging.debug as noted by the existing TODO(michaelkedar) comments - Remove dead `source_path: str` type annotation in add_source_info that was misleading (variable is already bound on line 517)
Member
|
/gcbrun |
Contributor
Author
Thank you for the approval! I don't have access to the GCB logs, is there anything I can do on my end to fix the snapshot test failure, or is it something that needs to be handled internally? |
Member
Sorry this is an unrelated failure. I will merge this PR when we've dealt with it |
Member
|
/gcbrun |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes : #5363
Summary
except:blocks in_match_versionsand_match_events(gcp/api/server.py)with
except Exception:to prevent silently swallowingSystemExitandKeyboardInterruptlogging.error→logging.debugfor the ecosystem helper failure path,addressing the existing
TODO(michaelkedar): This log is noisycommentssource_path: strtype annotation inadd_source_info(
gcp/website/frontend_handlers.py) — variable is already bound viapartition(':')on line 517, making the annotation misleading
Files Changed
gcp/api/server.py—_match_versions,_match_eventsgcp/website/frontend_handlers.py—add_source_infoTesting
No behavior change intended. The
except Exception:narrowing is strictly safer andthe log level change matches the intent described in the existing TODO comment.