Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Make pipeline status and issue status 1-to-1 mapping

天舟25db80524a04
diff --git a/frontend/src/miragejs/routes/issue.js b/frontend/src/miragejs/routes/issue.js
index 8fa565ac8a..08941dc737 100644
--- a/frontend/src/miragejs/routes/issue.js
+++ b/frontend/src/miragejs/routes/issue.js
@@ -295,24 +295,18 @@ export default function configureIssue(route) {
if (issue.pipelineId) {
const pipeline = schema.pipelines.find(issue.pipelineId);
- const taskList = schema.tasks.where({ pipelineId: pipeline.id }).models;
+ // Pipeline and issue status is 1-to-1 mapping, so we just change the pipeline status accordingly.
+ pipeline.update({
+ status: attrs.status,
+ });
+ const taskList = schema.tasks.where({ pipelineId: pipeline.id }).models;
if (attrs.status == "DONE") {
- if (pipeline.status != "DONE" || pipeline.status != "CANCELED") {
- return new Response(
- 404,
- {},
- {
- errors: `Can't resolve issue ${issue.name}. Pipeline is in ${pipeline.status} status`,
- }
- );
- }
-
// We check each of the task and its steps. Returns error if any of them is not finished.
for (let i = 0; i < taskList.length; i++) {
if (
- taskList[i].status != "DONE" ||
- taskList[i].status != "CANCELED" ||
+ taskList[i].status != "DONE" &&
+ taskList[i].status != "CANCELED" &&
taskList[i].status != "SKIPPED"
) {
return new Response(
@@ -331,8 +325,8 @@ export default function configureIssue(route) {
for (let j = 0; j < stepList.length; j++) {
if (
- stepList[j].status != "DONE" ||
- stepList[j].status != "CANCELED" ||
+ stepList[j].status != "DONE" &&
+ stepList[j].status != "CANCELED" &&
stepList[j].status != "SKIPPED"
) {
return new Response(
diff --git a/frontend/src/types/bytebase.ts b/frontend/src/types/bytebase.ts
index 9463263eb6..626ad016d7 100644
--- a/frontend/src/types/bytebase.ts
+++ b/frontend/src/types/bytebase.ts
@@ -1034,12 +1034,7 @@ export const ASSIGNEE_APPLICABLE_ACTION_LIST: Map<
Change prod database schema
*/
// Pipeline
-export type PipelineStatus =
- | "PENDING"
- | "RUNNING"
- | "DONE"
- | "FAILED"
- | "CANCELED";
+export type PipelineStatus = "OPEN" | "DONE" | "CANCELED";
export type Pipeline = {
id: PipelineId;