Improve GitHub API error diagnostics, CLI error handling, and spec isolation#389
Merged
Merged
Conversation
cloudofficer-admin
approved these changes
May 17, 2026
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
Addresses the two remaining High-severity findings from the deep code review (BUG-004, TEST-005) and fixes a filesystem-isolation defect uncovered while verifying them: the unit suite deleted the repo's own root linter configs when run from the repo root, because
LinterJobBuilderoperates on relative paths in the CWD and severallinter_job_builder_speccontexts letFile.exist?call through without stubbingFile.delete.Key changes:
GitHubAPIClientnow raises a typedGHB::GitHubAPIErrorthat includes a truncated (1000-char) response body, so GitHub's actionablemessage/errors[]detail is no longer discarded on 4xx/5xx (BUG-004).Application#configure_optionsbroadens its rescue fromOptionParser::InvalidOptionto the parentOptionParser::ParseError(now also handlesMissingArgument/AmbiguousOption) and writes to STDERR viawarninstead of STDOUT.Options#args_from_filewrapsShellwords.splitso a corrupted persisted args comment raises a clearConfigErrorinstead of a raw stack trace; empty--excluded_foldersentries are dropped.--excluded_folders, malformed quoting) and API-client specs asserting response-body inclusion and 1000-char truncation (TEST-005).beforehook inlinter_job_builder_specthat defaultsFile.delete/FileUtils.ln_sto no-ops, stopping the suite from destroying the repo's root linter configs; innerallow/have_receivedexpectations are unaffected.Full suite: 321 examples, 0 failures; line coverage 94.24%, branch 84.73%. RuboCop clean on all changed files. The four root linter configs now survive a full
rspecrun.Types of changes
Checklist