-
Notifications
You must be signed in to change notification settings - Fork 428
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
feat(api,ui): add labels to categorize workflows #3278
Conversation
close #3193 Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
engine/api/project.go
Outdated
if errTx != nil { | ||
return sdk.WrapError(errTx, "putProjectLabelsHandler> Cannot create transaction") | ||
} | ||
defer tx.Rollback() |
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.
Error return value of tx.Rollback
is not checked
engine/api/workflow.go
Outdated
if errTx != nil { | ||
return sdk.WrapError(errTx, "postWorkflowLabelHandler> Cannot create new transaction") | ||
} | ||
defer tx.Rollback() |
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.
Error return value of tx.Rollback
is not checked
engine/api/workflow/dao_label.go
Outdated
|
||
"github.com/go-gorp/gorp" | ||
"github.com/lib/pq" | ||
"github.com/ovh/cds/engine/api/database" |
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.
need empty line
engine/sql/125_workflow_label.sql
Outdated
@@ -0,0 +1,21 @@ | |||
-- +migrate Up | |||
CREATE TABLE IF NOT EXISTS workflow_label ( |
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.
project_label lay be a better choice
sdk/workflow.go
Outdated
} | ||
label.Color = "#" + hex.EncodeToString(bytes) | ||
} else { | ||
if !regexp.MustCompile(`^#\w{3,8}$`).Match([]byte(label.Color)) { |
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.
regexp.MustCompile(^#\w{3,8}$
) . must be done once
@@ -0,0 +1,3 @@ | |||
.labels-edit { |
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.
remove ?
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.
No I prefer keep this format even if it's empty
close #3193 Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
close Categorize workflows #3193
Unit tests
cc @blaryjp
@ovh/cds