refactor: add JobStatus value object replacing raw string comparisons#3046
refactor: add JobStatus value object replacing raw string comparisons#3046eloycoto wants to merge 1 commit intoredhat-developer:mainfrom
Conversation
Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Replace a few raw string status checks across x2a-common, x2a-node, x2a-backend, and x2a frontend with a flyweight JobStatus class following the Phase pattern from PR redhat-developer#3002. - Add JobStatus class with predicates: isActive(), isFinished(), isPending(), isRunning(), isSuccess(), isError(), isCancelled() - Replace ['pending','running'].includes() with isActive() - Replace 3-way || chains with isFinished() - Keep raw strings for DB writes and API responses (data, not logic) Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3046 +/- ##
==========================================
+ Coverage 60.75% 60.78% +0.02%
==========================================
Files 2067 2068 +1
Lines 63769 63817 +48
Branches 16613 16619 +6
==========================================
+ Hits 38742 38790 +48
Misses 23783 23783
Partials 1244 1244
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|



Replace a few raw string status checks across x2a-common, x2a-node, x2a-backend, and x2a frontend with a flyweight JobStatus class following the Phase pattern from PR #3002.