-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harmony 1996: Add 'empty-result' status to WorkItem class and work-items table #683
Open
indiejames
wants to merge
7
commits into
main
Choose a base branch
from
harmony-1996
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+228
−19
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d6038fa
HARMONY-1996: Add EMPTY_RESULT to WorkItemStatus
indiejames 8ccb9d3
HARMONY-1996: Add new db migration file missed on previous commit
indiejames 6ad13b8
HARMONY-1996: Change empty-result status to no-data
indiejames 4fe4a84
HARMONY-1996: Changes to tsconfig.json files to fix tsc errors
indiejames 8551b21
HARMONY-1996: Add work-item status 'warning' and substatus work items
indiejames 57ad87c
HARMONY-1996: Remove unnecessary semicolon
indiejames 48b513b
HARMONY-1996: Remove unneeded dB constraint and fix casing on model
indiejames File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
32 changes: 32 additions & 0 deletions
32
db/migrations/20250122190038_add_warning_status_and_sub_status_to_work_items.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = function (knex, Promise) { | ||
return knex.schema.raw(` | ||
ALTER TABLE "work_items" | ||
DROP CONSTRAINT "work_items_status_check", | ||
ADD CONSTRAINT "work_items_status_check" | ||
CHECK (status IN ('ready', 'queued', 'running', 'successful', 'failed', 'canceled', 'warning')), | ||
ADD COLUMN "sub_status" VARCHAR(255), | ||
ADD CONSTRAINT "work_items_sub_status_check" | ||
CHECK (sub_status IN (null, 'no-data')); | ||
CREATE INDEX work_items_sub_status ON work_items (sub_status) | ||
`); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return knex.schema.raw(` | ||
ALTER TABLE "work_items" | ||
DROP CONSTRAINT "work_items_sub_status_check", | ||
DROP COLUMN "sub_status"), | ||
DROP CONSTRAINT "work_items_status_check", | ||
ADD CONSTRAINT "work_items_status_check" | ||
CHECK (status IN ('ready', 'queued', 'running', 'successful', 'failed', 'canceled')) | ||
`); | ||
}; |
32 changes: 32 additions & 0 deletions
32
db/migrations/20250124155544_add_level_and_category_to_job_errors.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = function (knex, Promise) { | ||
return knex.schema.raw(` | ||
ALTER TABLE "job_errors" | ||
ADD COLUMN "level" VARCHAR(255) DEFAULT 'error' NOT NULL, | ||
ADD CONSTRAINT "job_errors_level_check" | ||
CHECK (level IN ('error', 'warning')), | ||
ADD COLUMN "category" VARCHAR(255) DEFAULT 'generic' NOT NULL; | ||
|
||
CREATE INDEX job_errors_level ON job_errors (level); | ||
CREATE INDEX job_errors_category ON job_errors (category) | ||
`); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return knex.schema.raw(` | ||
DROP INDEX job_errors_category; | ||
DROP_INDEX job_errors_level; | ||
ALTER TABLE "job_errors" | ||
DROP CONSTRAINT "job_errors_category_check", | ||
DROP COLUMN "category", | ||
DROP CONSTRAINT "job_errors_level_check", | ||
DROP COLUMN "level" | ||
`); | ||
}; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to drop
work_items_status_check
before adding it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question for the "down" migration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because there is already a constraint with that name. We can't update it, we have to drop it then add it.