Skip to content
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

fix(api): duplication of same node name is now forbidden #4953

Merged
merged 3 commits into from
Feb 4, 2020

Conversation

bnjjj
Copy link
Contributor

@bnjjj bnjjj commented Feb 4, 2020

Signed-off-by: Benjamin Coenen 5719034+bnjjj@users.noreply.github.com

  1. Description
  2. Related issues
  3. About tests
  4. Mentions

@ovh/cds

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
nodeNames := make(map[string]struct{}, len(nodes))
for i := range nodes {
if _, ok := nodeNames[nodes[i].Name]; ok {
return sdk.ErrWorkflowNodeNameDuplicate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WithStack

sdk/error.go Outdated
@@ -382,6 +383,7 @@ var errorsAmericanEnglish = map[int]string{
ErrBadBrokerConfiguration.ID: "Cannot connect to the broker of your event integration. Check your configuration",
ErrInvalidJobRequirementNetworkAccess.ID: "Invalid job requirement: network requirement must contains ':'. Example: golang.org:http, golang.org:443",
ErrWorkflowAsCodeResync.ID: "You cannot resynchronize an as-code workflow",
ErrWorkflowNodeNameDuplicate.ID: "You cannot have same name for different pipeline nodes in your workflow",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove nodes

sdk/error.go Outdated
@@ -563,6 +565,7 @@ var errorsFrench = map[int]string{
ErrBadBrokerConfiguration.ID: "Impossible de se connecter à votre intégration de type évènement. Veuillez vérifier votre configuration",
ErrInvalidJobRequirementNetworkAccess.ID: "Pré-requis de job invalide: Le pré-requis network doit contenir un ':'. Exemple: golang.org:http, golang.org:443",
ErrWorkflowAsCodeResync.ID: "Impossible de resynchroniser un workflow en mode as-code",
ErrWorkflowNodeNameDuplicate.ID: "Vous ne pouvez pas avoir plusieurs fois le même nom de noeud de pipeline dans votre workflow",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noeud -> pipeline

Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@bnjjj bnjjj merged commit 38727ef into master Feb 4, 2020
@bnjjj bnjjj deleted the fix_duplicate_node_name branch February 18, 2020 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants