From 48fcde87e3cbbfc1f6bec2e1c4da830ea451a37b Mon Sep 17 00:00:00 2001 From: aboyko Date: Thu, 25 Jan 2024 13:44:16 -0500 Subject: [PATCH] [vscode-concourse] Add `team` attribute to `set_pipiline` step --- .../ide/vscode/concourse/PipelineYmlSchema.java | 3 ++- .../src/main/resources/desc/SetPipelineStep/team.md | 5 +++++ .../ide/vscode/concourse/ConcourseEditorTest.java | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 headless-services/concourse-language-server/src/main/resources/desc/SetPipelineStep/team.md diff --git a/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java b/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java index 39afbcd8a..d073922ea 100644 --- a/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java +++ b/headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2023 Pivotal, Inc. + * Copyright (c) 2016, 2024 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -406,6 +406,7 @@ public class PipelineYmlSchema implements YamlSchema { addProp(setPipelineStep, "instance_vars", t_params); addProp(setPipelineStep, "vars", t_params); addProp(setPipelineStep, "var_files", t_strings); + addProp(setPipelineStep, "team", t_ne_string); YBeanType loadVarStep = f.ybean("LoadVarStep"); addProp(loadVarStep, "load_var", t_identifier); diff --git a/headless-services/concourse-language-server/src/main/resources/desc/SetPipelineStep/team.md b/headless-services/concourse-language-server/src/main/resources/desc/SetPipelineStep/team.md new file mode 100644 index 000000000..67803311a --- /dev/null +++ b/headless-services/concourse-language-server/src/main/resources/desc/SetPipelineStep/team.md @@ -0,0 +1,5 @@ +*Optional* By default, the `set_pipeline` step sets the pipeline for the same **team** that is running the build. + +The `team` attribute can be used to specify another team. + +Only the `main` **team** is allowed to set another team's pipeline. Any `team` other than the `main` **team** using the team attribute will error, unless they reference their own team. \ No newline at end of file diff --git a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java index 71a922f57..98eb6708d 100644 --- a/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java +++ b/headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2023 Pivotal, Inc. + * Copyright (c) 2016, 2024 Pivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -672,6 +672,7 @@ public class ConcourseEditorTest { " var_files:\n" + " - my-repo/ci/dev.yml\n" + " vars:\n" + + " team: my-team\n" + " text: \"Hello World!\"\n" ); @@ -679,6 +680,7 @@ public class ConcourseEditorTest { editor.assertHoverContains("instance_vars", "A map of instance vars used to identify"); editor.assertHoverContains("var_files", "files that will be passed to the pipeline config in the same manner as the --load-vars-from flag"); editor.assertHoverContains("vars", 2, "A map of template variables to pass to the pipeline config."); + editor.assertHoverContains("team", "By default, the `set_pipeline` step sets the pipeline for the same **team** that is running the build"); } @Test