Skip to content

Commit 180b48c

Browse files
committed
[concourse] Add support for old_name Job attribute
See: #388
1 parent 10d1e62 commit 180b48c

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

headless-services/concourse-language-server/src/main/java/org/springframework/ide/vscode/concourse/PipelineYmlSchema.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ public PipelineYmlSchema(ConcourseModel models, GithubInfoProvider github) {
407407

408408
AbstractType job = f.ybean("Job");
409409
addProp(job, "name", jobNameDef).isPrimary(true);
410+
addProp(job, "old_name", t_ne_string);
410411
addProp(job, "plan", f.yseq(step)).isRequired(true);
411412
addProp(job, "serial", t_boolean);
412413
addProp(job, "build_logs_to_retain", t_pos_integer);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*Optional*. The old name of the job. If configured, the history of old job will be inherited to the new one. Once the
2+
pipeline is set, this field can be removed as the builds have been transfered.
3+
4+
This can be used to rename a job without losing its history, like so:
5+
6+
jobs:
7+
- name: new-name
8+
old_name: current-name
9+
plan: [get: 10m]
10+
11+
After the pipeline is set, because the builds have been inherited, the job can have the field removed:
12+
13+
jobs:
14+
- name: new-name
15+
plan: [get: 10m]
16+

headless-services/concourse-language-server/src/test/java/org/springframework/ide/vscode/concourse/ConcourseEditorTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3985,6 +3985,7 @@ public void gotoResourceTypeDefinition() throws Exception {
39853985
Editor editor = harness.newEditor(
39863986
"jobs:\n" +
39873987
" - name: job\n" +
3988+
" old_name: formerly-known-as\n" +
39883989
" serial: true\n" +
39893990
" build_logs_to_retain: 10\n" +
39903991
" serial_groups: []\n" +
@@ -4013,6 +4014,7 @@ public void gotoResourceTypeDefinition() throws Exception {
40134014
);
40144015
editor.assertProblems(/*NONE*/);
40154016
editor.assertHoverContains("name", "The name of the job");
4017+
editor.assertHoverContains("old_name", "history of old job will be inherited to the new one");
40164018
editor.assertHoverContains("serial", "execute one-by-one");
40174019
editor.assertHoverContains("build_logs_to_retain", "only the last specified number of builds");
40184020
editor.assertHoverContains("serial_groups", "referencing the same tags will be serialized");
@@ -4031,6 +4033,7 @@ public void gotoResourceTypeDefinition() throws Exception {
40314033
Editor editor = harness.newEditor(
40324034
"jobs:\n" +
40334035
" - name: job\n" +
4036+
" old_name: formerly-known-as\n" +
40344037
" serial: isSerial\n" +
40354038
" build_logs_to_retain: retainers\n" +
40364039
" serial_groups: no-list\n" +
@@ -4094,6 +4097,7 @@ public void gotoResourceTypeDefinition() throws Exception {
40944097
"ensure",
40954098
"interruptible",
40964099
"max_in_flight",
4100+
"old_name",
40974101
"on_abort",
40984102
"on_error",
40994103
"on_failure",

0 commit comments

Comments
 (0)