Remove asserts - #237
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces runtime assertions with explicit exceptions so validation remains active under optimized Python execution.
Changes:
- Converts assertions across UI, state, subprocess, collector, and submitter paths.
- Enables Python optimization in the snap.
- Adds more descriptive invariant errors.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
snap/snapcraft.yaml |
Enables optimized Python execution. |
src/bugit_v2/apps/app.py |
Validates CLI command names. |
src/bugit_v2/bug_report_submitters/jira_submitter.py |
Adds explicit Jira state checks. |
src/bugit_v2/bug_report_submitters/launchpad_submitter.py |
Adds explicit Launchpad checks. |
src/bugit_v2/bug_report_submitters/local_file_submitter.py |
Validates archive creation state. |
src/bugit_v2/bug_report_submitters/mock_jira.py |
Updates mock Jira validation. |
src/bugit_v2/bug_report_submitters/mock_lp.py |
Updates mock Launchpad validation. |
src/bugit_v2/checkbox_utils/checkbox_exec.py |
Validates Checkbox availability. |
src/bugit_v2/checkbox_utils/submission_extractor.py |
Validates submission archive contents. |
src/bugit_v2/components/confirm_dialog.py |
Validates dialog button IDs. |
src/bugit_v2/components/file_picker.py |
Validates delete-button filenames. |
src/bugit_v2/dut_utils/log_collectors.py |
Adds explicit collector preconditions. |
src/bugit_v2/models/app_state.py |
Converts state-machine assertions. |
src/bugit_v2/screens/bug_report_screen.py |
Adds worker and report-data checks. |
src/bugit_v2/screens/job_selection_screen.py |
Validates job selection. |
src/bugit_v2/screens/recover_from_autosave_screen.py |
Validates autosave actions. |
src/bugit_v2/screens/session_selection_screen.py |
Validates selected session paths. |
src/bugit_v2/screens/submission_progress_screen.py |
Adds submission-state checks. |
src/bugit_v2/utils/async_subprocess.py |
Validates subprocess pipes and return codes. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
No description provided.