Skip to content

Release (2026-06-19)#181

Merged
dan2k3k4 merged 9 commits into
prodfrom
dev
Jun 22, 2026
Merged

Release (2026-06-19)#181
dan2k3k4 merged 9 commits into
prodfrom
dev

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

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 RemoveAppInstanceByName and RemoveAppInstancesByEmail into a single polydock:remove-instances command with unified filter options (--app, --email, --name, --uuid, --limit, --force-purge, --dry-run). It also introduces a BaseCommand base class with a sensitiveInputs() hook, wires up a CommandStarting listener in AppServiceProvider to log artisan invocations with PII redaction, and fixes unauthenticated requests to return 401 instead of redirecting guests to a non-existent login page.

  • New polydock:remove-instances command replaces two narrower commands; supports all previous filter combinations, a dry-run mode, force-purge timestamps, and a --limit for batch-capped operations.
  • Artisan argv redaction (AppServiceProvider) resolves sensitive flags and positional arguments by name via the command definition, with per-command override via sensitiveInputs(); all existing commands have been migrated to BaseCommand and assigned appropriate sensitiveInputs() lists.
  • Auth exception handling (bootstrap/app.php) returns a plain 401 JSON or text response rather than a 302 redirect to /login for 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-instances command 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 in AppServiceProvider is backed by three dedicated integration tests. All concrete commands have been migrated to BaseCommand, 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

Filename Overview
app/Console/Commands/RemoveAppInstances.php New unified polydock:remove-instances command consolidating RemoveAppInstanceByName and RemoveAppInstancesByEmail; minor null-chain and empty('0') edge cases noted.
app/Providers/AppServiceProvider.php Adds CommandStarting listener that logs artisan command argv to shared log context with redaction logic for sensitive options and positional arguments; exactSensitiveKeys narrowed to ['p'] addressing a previous false-positive concern.
app/Console/Commands/BaseCommand.php New abstract base class for all console commands exposing a sensitiveInputs() hook consumed by AppServiceProvider's redaction logic.
bootstrap/app.php Returns 401 (not a redirect) for unauthenticated requests by setting redirectGuestsTo to null and adding an AuthenticationException renderer.
tests/Feature/Console/Commands/RemoveAppInstancesTest.php Comprehensive feature tests for the new command covering all filter options, dry-run, force-purge, limit, partial/complete failure, and sensitive-input redaction.
tests/Feature/GeneralApplicationTest.php Tests for artisan command log context including redaction of sensitive options, positional arguments, and explicit sensitiveInputs() keys.
tests/Unit/Console/ConsoleCommandsTest.php Unit test that enforces all concrete console commands extend 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"]
Loading
%%{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"]
Loading

Reviews (3): Last reviewed commit: "chore: improve commands with a base comm..." | Re-trigger Greptile

Comment thread app/Providers/AppServiceProvider.php
Comment thread app/Providers/AppServiceProvider.php Outdated
Comment thread app/Console/Commands/RemoveAppInstances.php
@dan2k3k4 dan2k3k4 merged commit 831404e into prod Jun 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant