Repository navigation
[O2B-1515] Migrate to DONE status for all environments and remove deprecated DESTROYED - #2259
Merged
graduta merged 4 commits intoOct 20, 2026
Merged
Conversation
…o DONE Add a migration converting DESTROYED history items to DONE and update the seeders accordingly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
DONE is now the only terminal status: drop DESTROYED from the status enums, DTO validation, colours and SQL queries, and simplify the status history filter of GetAllEnvironmentsUseCase now that 'X' maps to a single status. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…status Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2259 +/- ##
==========================================
- Coverage 46.46% 46.44% -0.03%
==========================================
Files 1052 1053 +1
Lines 17358 17353 -5
Branches 3164 3161 -3
==========================================
- Hits 8066 8060 -6
- Misses 9292 9293 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
graduta
deleted the
improv/O2B-1515/migrate-to-DONE-status-for-all-BKP
branch
October 20, 2026 10:59
There was a problem hiding this comment.
🟡 Changes recommended
The migration must preserve historical update timestamps to avoid changing status ordering and filter results.
1 open issue
What changed in this PR
Standardizes completed environments on DONE, replacing deprecated DESTROYED across stored history, filtering, and display.
Changes:
- Adds a one-way migration converting historical statuses to
DONE. - Updates validation, status mappings, queries, and lost-environment handling.
- Aligns seed data and tests with the unified status.
| File | Description |
|---|---|
| test/public/Filters/urlToFilter.test.js | Expects DONE from URL filters. |
| test/public/Filters/filtersToUrl.test.js | Expects DONE in serialized filters. |
| test/public/eosReport/ecs-creation.test.js | Uses DONE report fixtures. |
| test/public/envs/overview.test.js | Updates status display and filtering tests. |
| test/public/envs/detailsPage.test.js | Expects DONE in environment details. |
| test/lib/usecases/environment/UpdateEnvironmentUseCase.test.js | Tests updates to DONE. |
| test/lib/server/services/statistics/StatisticsService.test.js | Updates history statistics expectations. |
| test/lib/server/services/eosReport/EosReportService.test.js | Uses DONE report fixtures. |
| test/lib/server/services/environmentHistoryItem/createEnvironmentHistoryItem.test.js | Tests creation with DONE. |
| test/lib/server/services/environment/getEnvironmentsInPeriod.test.js | Updates terminal-status assertions. |
| test/lib/server/services/environment/EnvironmentService.test.js | Updates validation error expectations. |
| lib/usecases/environment/GetAllEnvironmentsUseCase.js | Simplifies history filtering and trailing X handling. |
| lib/server/services/housekeeping/handleLostRunsAndEnvironments.js | Updates comment terminology. |
| lib/server/services/environment/transitionToErrorLostEnvironments.js | Excludes DONE environments from error transitions. |
| lib/server/services/environment/getEnvironmentsInPeriod.js | Removes deprecated status condition. |
| lib/public/views/Environments/ColoredEnvironmentStatusComponent.js | Removes deprecated color mapping. |
| lib/public/domain/enums/statusAcronym.mjs | Removes public DESTROYED acronym entry. |
| lib/domain/enums/StatusAcronyms.js | Removes server DESTROYED acronym entry. |
| lib/domain/dtos/CreateEnvironmentHistoryItemDto.js | Rejects deprecated status values. |
| lib/database/seeders/20230124105627-environment-history.js | Converts seeded history to DONE. |
| lib/database/seeders/20220412122043-environments.js | Updates fixture comments only. |
| lib/database/repositories/EnvironmentHistoryItemRepository.js | Uses DONE in history distribution queries. |
| lib/database/migrations/v1/20261019110000-environment-destroyed-status-to-done.js | Converts historical statuses with no-op rollback. |
Review effort: Balanced
| module.exports = { | ||
| up: async (queryInterface) => queryInterface.sequelize.query(` | ||
| UPDATE environments_history_items | ||
| SET status = 'DONE' |
4 tasks done
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.

I have a JIRA ticket
Notable changes for users:
DESTROYEDstatus are now shown asDONE;DESTROYEDis no longer available in the environments status filterNotable changes for developers:
DESTROYEDremoved from status enums (server and public), history item DTO validation, status colours and raw SQL queriesGetAllEnvironmentsUseCase: status history filter simplified, a trailingXnow only anchors the match to the end of the history (singleDONEstatus)transitionToErrorLostEnvironmentsnow also excludes environments alreadyDONEDONEAliEcsSynchronizerforwards the AliECS state as is, so an incomingDESTROYEDstate would now be rejected by validationChanges made to the database:
20261019110000-environment-destroyed-status-to-done:UPDATE environments_history_items SET status = 'DONE' WHERE status = 'DESTROYED'(downis a no-op as the conversion cannot be reverted)