fix(dx): harden cicd-diagnostics scripts with preflight checks and error handling#34866
Open
fix(dx): harden cicd-diagnostics scripts with preflight checks and error handling#34866
Conversation
…ror handling (#34865) Add DiagnosticError, preflight_check(), and _run_gh() wrapper to replace raw subprocess calls with actionable error messages. Fix dead-code bug where Path objects were checked with truthiness instead of .exists(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
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.
Summary
Closes #34865
DiagnosticErrorexception class replacing cryptic subprocess failures with actionable error messagespreflight_check()function validating Python 3.8+,ghCLI installed,ghauthenticated, and can reach dotCMS/core_run_gh()wrapper centralizingghCLI execution with error classification (401→auth, 403→rate limit, 404→not found)subprocess.run(..., check=True)to_run_gh()if not workspace:→if not workspace.exists():(Path objects are always truthy)Test plan
preflight_check()returns "All checks passed" when prerequisites metinit-diagnostic.pyshows proper usage error for missing argsfetch-metadata.py/fetch-jobs.pyreject nonexistent workspace directories_run_gh()with invalid run ID returns proper DiagnosticError with 404 details🤖 Generated with Claude Code