Skip to content

Release (2026-06-01) - #151

Merged
dan2k3k4 merged 24 commits into
prodfrom
dev
Jun 1, 2026
Merged

Release (2026-06-01)#151
dan2k3k4 merged 24 commits into
prodfrom
dev

Conversation

@github-actions

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

Copy link
Copy Markdown

Changes in this release:

3ce79ee chore(deps): bump actions/dependency-review-action from 4.9.0 to 5.0.0
b7e64d9 chore(deps-dev): bump axios from 1.15.2 to 1.16.0
f59c6ca chore: bump deps
faaf256 chore: remove purged status
9b2d337 Fix retry flow to re-enter deploy lifecycle
ef966b3 chore: delete instance button
3f51ea7 fix: order purge lifecycle ordinals
00c3f5c fix: address purge review feedback
182fbc1 feat: expose store.id on GET /store-apps/
2ac4b4e chore: add purge state
4430813 chore: add retry failed instance
c7d10fd fix: prevent stuck instances from blocking pre-warm pool refill
4867625 chore(deps): bump js-cookie from 3.0.5 to 3.0.7
675ec9e chore(deps): bump js-cookie from 3.0.5 to 3.0.7

Greptile Summary

This release introduces a full Lagoon project purge lifecycle — PENDING_PURGE → PURGE_RUNNING → REMOVED (soft-delete) — backed by a new ProcessProjectPurgeJob, DispatchProjectPurgeJobsCommand cron, LagoonProjectPurgeService, and a suite of Filament admin actions (delete instance, force full delete, retry purge). It also adds MarkStuckInstancesFailedCommand to detect instances stuck in intermediate statuses and a fix to the pre-warm pool count that excluded failed instances from the refill check.

  • Purge lifecycle: New columns (removed_at, purge_eligible_at, force_purge_requested_at, purge_attempts, purge_last_attempted_at, purge_failure_reason, deleted_at) are added via migration; the PolydockAppInstance model gains SoftDeletes and the new stagePurgeStatuses group.
  • Admin UX: Five new Filament header actions cover the full delete/retry/cancel-force-purge surface; the instances table now shows purged (soft-deleted) rows via a TrashedFilter.
  • Stuck-instance detection: MarkStuckInstancesFailedCommand covers the create/deploy/claim stages but leaves PURGE_RUNNING without automatic resolution.

Confidence Score: 3/5

The force-purge path can enter a rapid, unthrottled retry loop that will exhaust the attempt cap in minutes rather than days when Lagoon environments are still being torn down.

The interaction between ProcessProjectPurgeJob's StillHasEnvironments branch (which drops back to REMOVED) and the listener's REMOVED shortcut (which immediately re-dispatches PENDING_PURGE when force_purge_requested_at is set) defeats the poll-interval backoff. This is most likely to trigger in the common case where a forced delete is issued while environments exist — exactly the scenario the UI describes as normal. Everything else in the release — the dispatcher command, the purge service, the migration backfill, the stuck-instance command, and the API change — looks well-structured and safe.

app/Listeners/ProcessPolydockAppInstanceStatusChange.php and app/Jobs/ProcessPolydockAppInstanceJobs/Purge/ProcessProjectPurgeJob.php — the interaction between the REMOVED listener case and the StillHasEnvironments/Failed job results needs a backoff guard or a cleared force_purge flag before the drop-back-to-REMOVED.

Important Files Changed

Filename Overview
app/Listeners/ProcessPolydockAppInstanceStatusChange.php Adds PENDING_PURGE dispatch and a REMOVED shortcut for force-purge; the REMOVED case re-dispatches immediately when force_purge_requested_at is set, which bypasses the configured purge poll backoff and can cause rapid unthrottled retries.
app/Jobs/ProcessPolydockAppInstanceJobs/Purge/ProcessProjectPurgeJob.php New job that attempts full Lagoon project deletion; handles Purged, AlreadyGone, StillHasEnvironments, MissingProjectName, and Failed outcomes correctly, though the StillHasEnvironments path back to REMOVED can interact badly with the listener force-purge shortcut.
app/Console/Commands/DispatchProjectPurgeJobsCommand.php New cron command that picks REMOVED instances past their grace period and dispatches them to PENDING_PURGE; backoff and polling-cap logic look correct for the normal (non-force) path.
app/Console/Commands/MarkStuckInstancesFailedCommand.php New command for detecting instances stuck in intermediate statuses; correctly scoped to create/deploy/claim stages but leaves PURGE_RUNNING without automatic failure resolution.
app/Services/LagoonProjectPurgeService.php New service encapsulating Lagoon project deletion; handles empty, missing, error, and environment-present cases with clear return types and thorough logging.
app/Filament/Admin/Resources/PolydockAppInstanceResource/Pages/ViewPolydockAppInstance.php Adds retry-failed-instance, delete-instance, force-full-delete, retry-purge, and cancel-force-purge admin actions; visibility guards are consistent and the delete action correctly stages force_purge_requested_at before entering the remove pipeline.
app/Models/PolydockAppInstance.php Adds SoftDeletes trait, purge-related columns, stagePurgeStatuses, stageClaimStatuses, and unallocatedInProgressStatuses(); also stamps removed_at/purge_eligible_at on first REMOVED transition.
database/migrations/2026_05_27_000001_add_purge_fields_to_polydock_app_instances_table.php Adds purge columns and softDeletes; backfills existing REMOVED rows with removed_at/purge_eligible_at derived from updated_at.

Sequence Diagram

sequenceDiagram
    participant Admin
    participant Listener as StatusChange Listener
    participant Queue
    participant Job as ProcessProjectPurgeJob
    participant Lagoon

    Admin->>Listener: "setStatus(PENDING_PRE_REMOVE) + force_purge_requested_at=now"
    Note over Listener: Remove pipeline runs normally...
    Listener->>Queue: dispatch PreRemoveJob → RemoveJob → PostRemoveJob
    Queue->>Listener: setStatus(REMOVED)
    Listener->>Listener: "force_purge_requested_at != null?"
    Listener->>Listener: setStatus(PENDING_PURGE)
    Listener->>Queue: dispatch ProcessProjectPurgeJob

    Queue->>Job: handle()
    Job->>Job: setStatus(PURGE_RUNNING), purge_attempts++
    Job->>Lagoon: getProjectByName()
    Lagoon-->>Job: project with environments
    Job->>Lagoon: deleteProjectEnvironmentByName() x N
    Job->>Job: return StillHasEnvironments
    Job->>Listener: setStatus(REMOVED) triggers event
    Note over Listener,Job: force_purge_requested_at still set!
    Listener->>Listener: "force_purge_requested_at != null?"
    Listener->>Listener: setStatus(PENDING_PURGE) immediately
    Listener->>Queue: dispatch ProcessProjectPurgeJob AGAIN (no backoff)

    Note over Queue,Lagoon: Loop continues until environments gone OR purge_attempts >= maxAttempts

    alt Normal path via DispatchProjectPurgeJobsCommand
        Note over Listener: No force_purge_requested_at
        Job->>Job: setStatus(REMOVED) — no listener shortcut
        Note over Queue: Dispatcher cron waits purge_poll_interval_minutes
        Queue->>Job: dispatch with backoff
    end
Loading

Comments Outside Diff (1)

  1. app/Console/Commands/MarkStuckInstancesFailedCommand.php, line 175-178 (link)

    P2 PURGE_RUNNING instances are not covered by stuck-instance detection

    intermediateStatuses() delegates to unallocatedInProgressStatuses(), which only covers the NEW, create, deploy, and claim stages. PURGE_RUNNING is deliberately excluded from that list (it isn't pool-related), so any instance that gets stuck mid-purge will never be automatically transitioned to PURGE_FAILED by this command. There is no matching entry in resolveFailedStatus() either, so if PURGE_RUNNING were ever included it would throw a \LogicException. A stuck PURGE_RUNNING instance requires manual admin intervention or an explicit cron.

Reviews (1): Last reviewed commit: "chore(deps-dev): bump axios from 1.15.2 ..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

dependabot Bot and others added 22 commits May 21, 2026 22:57
Bumps [js-cookie](https://github.com/js-cookie/js-cookie) from 3.0.5 to 3.0.7.
- [Release notes](https://github.com/js-cookie/js-cookie/releases)
- [Commits](js-cookie/js-cookie@v3.0.5...v3.0.7)

---
updated-dependencies:
- dependency-name: js-cookie
  dependency-version: 3.0.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [js-cookie](https://github.com/js-cookie/js-cookie) from 3.0.5 to 3.0.7.
- [Release notes](https://github.com/js-cookie/js-cookie/releases)
- [Commits](js-cookie/js-cookie@v3.0.5...v3.0.7)

---
updated-dependencies:
- dependency-name: js-cookie
  dependency-version: 3.0.7
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Adds the parent store's auto-increment id to each store-app entry returned
by the authenticated /store-apps endpoint. The id is already exposed by
GET /regions/ (regions[].id) but consumers of /store-apps had no way to
identify the parent store other than by name. Adding it here lets clients
pin to a specific store without having to resolve names that may collide
or be renamed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps [axios](https://github.com/axios/axios) from 1.15.2 to 1.16.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.15.2...v1.16.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.16.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.9.0 to 5.0.0.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](actions/dependency-review-action@2031cfc...a1d282b)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Comment thread app/Listeners/ProcessPolydockAppInstanceStatusChange.php
@amazeeio amazeeio deleted a comment from Copilot AI Jun 1, 2026
@dan2k3k4
dan2k3k4 merged commit ed7f95b into prod Jun 1, 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.

3 participants