Conversation
…instances command
…instances command (#180)
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.
Changes in this release:
344537d feat(console): consolidate bulk-removal into unified polydock:remove-instances command
245b470 chore: log artisan cli
d5c3000 chore: return 404 for routes not found
Greptile Summary
This release consolidates
RemoveAppInstanceByNameandRemoveAppInstancesByEmailinto a singlepolydock:remove-instancescommand with unified filter options (--app,--email,--name,--uuid,--limit,--force-purge,--dry-run). It also introduces aBaseCommandbase class with asensitiveInputs()hook, wires up aCommandStartinglistener inAppServiceProviderto log artisan invocations with PII redaction, and fixes unauthenticated requests to return 401 instead of redirecting guests to a non-existent login page.polydock:remove-instancescommand replaces two narrower commands; supports all previous filter combinations, a dry-run mode, force-purge timestamps, and a--limitfor batch-capped operations.AppServiceProvider) resolves sensitive flags and positional arguments by name via the command definition, with per-command override viasensitiveInputs(); all existing commands have been migrated toBaseCommandand assigned appropriatesensitiveInputs()lists.bootstrap/app.php) returns a plain 401 JSON or text response rather than a 302 redirect to/loginfor API and non-API routes alike.Confidence Score: 5/5
Safe to merge; all changes are additive and well-tested, with no modifications to existing data-mutation paths.
The new
polydock:remove-instancescommand is thoroughly tested (13 feature tests covering all filter combinations, dry-run, force-purge, partial failure, and sensitive-input redaction). The artisan argv redaction logic inAppServiceProvideris backed by three dedicated integration tests. All concrete commands have been migrated toBaseCommand, enforced by a unit test. The two findings are edge-case defensive-coding issues that do not affect the core happy path.app/Console/Commands/RemoveAppInstances.php has two minor edge-case issues worth a second look before merge.
Important Files Changed
polydock:remove-instancescommand consolidatingRemoveAppInstanceByNameandRemoveAppInstancesByEmail; minor null-chain andempty('0')edge cases noted.CommandStartinglistener that logs artisan command argv to shared log context with redaction logic for sensitive options and positional arguments;exactSensitiveKeysnarrowed to['p']addressing a previous false-positive concern.sensitiveInputs()hook consumed byAppServiceProvider's redaction logic.redirectGuestsToto null and adding anAuthenticationExceptionrenderer.sensitiveInputs()keys.BaseCommand, providing a regression guard for the new inheritance requirement.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["artisan polydock:remove-instances"] --> B{At least one filter?} B -- No --> Z1["FAILURE: require filter"] B -- Yes --> C{--limit valid?} C -- Invalid --> Z2["FAILURE: bad limit"] C -- Valid/absent --> D["Build Eloquent query"] D --> E["Exclude already-removing statuses"] E --> F{instances found?} F -- None --> Z3["SUCCESS: nothing to do"] F -- Found --> G["Display table"] G --> H{--dry-run?} H -- Yes --> Z4["SUCCESS: no changes"] H -- No --> I{--force?} I -- No --> J["Confirm prompt"] J -- No --> Z5["SUCCESS: cancelled"] J -- Yes --> K["Mutate statuses"] I -- Yes --> K K --> L{--force-purge?} L -- Yes --> M["Set purge timestamps"] M --> N["setStatus PENDING_PRE_REMOVE"] L -- No --> N N --> O{errors?} O -- None --> Z6["SUCCESS"] O -- Some --> Z7["FAILURE"]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A["artisan polydock:remove-instances"] --> B{At least one filter?} B -- No --> Z1["FAILURE: require filter"] B -- Yes --> C{--limit valid?} C -- Invalid --> Z2["FAILURE: bad limit"] C -- Valid/absent --> D["Build Eloquent query"] D --> E["Exclude already-removing statuses"] E --> F{instances found?} F -- None --> Z3["SUCCESS: nothing to do"] F -- Found --> G["Display table"] G --> H{--dry-run?} H -- Yes --> Z4["SUCCESS: no changes"] H -- No --> I{--force?} I -- No --> J["Confirm prompt"] J -- No --> Z5["SUCCESS: cancelled"] J -- Yes --> K["Mutate statuses"] I -- Yes --> K K --> L{--force-purge?} L -- Yes --> M["Set purge timestamps"] M --> N["setStatus PENDING_PRE_REMOVE"] L -- No --> N N --> O{errors?} O -- None --> Z6["SUCCESS"] O -- Some --> Z7["FAILURE"]Reviews (3): Last reviewed commit: "chore: improve commands with a base comm..." | Re-trigger Greptile