Concourse: Hover Docs for Resource attributes
This commit is contained in:
@@ -165,6 +165,7 @@ public class PipelineYmlSchema implements YamlSchema {
|
||||
prop(resource, "name", resourceNameDef);
|
||||
prop(resource, "type", t_resource_type_name);
|
||||
prop(resource, "source", t_any);
|
||||
prop(resource, "check_every", t_duration);
|
||||
|
||||
YBeanType job = f.ybean("Job");
|
||||
prop(job, "name", jobNameDef);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
*Optional. Default 1m.* The interval on which to check for new versions of the resource. Acceptable interval options are defined by the [time.ParseDuration function](https://golang.org/pkg/time/#ParseDuration).
|
||||
@@ -0,0 +1 @@
|
||||
*Required.* The name of the resource. This should be short and simple. This name will be referenced by [build plans](https://concourse.ci/build-plans.html) of jobs in the pipeline.
|
||||
@@ -0,0 +1,7 @@
|
||||
*Optional.* The location of the resource. This varies by resource type, and is a black box to Concourse; it is blindly passed to the resource at runtime.
|
||||
|
||||
To use `git` as an example, the source may contain the repo URI, the branch of the repo to track, and a private key to use when pushing/pulling.
|
||||
|
||||
By convention, documentation for each resource type's configuration is in each implementation's `README`.
|
||||
|
||||
You can find the source for the resource types provided with Concourse at the [Concourse GitHub organization](https://github.com/concourse?query=-resource).
|
||||
@@ -0,0 +1,3 @@
|
||||
*Required.* The type of the resource. Each worker advertises a mapping of `resource-type -> container-image; type` corresponds to the key in the map.
|
||||
|
||||
To see what resource types your deployment supports, check the status of your worker pool via the `/api/v1/workers` API endpoint.
|
||||
@@ -663,6 +663,22 @@ public class PipelineYamlEditorTest {
|
||||
editor.assertHoverContains("source", 2, "The location of the resource type's resource");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resourceAttributeHovers() throws Exception {
|
||||
Editor editor = harness.newEditor(
|
||||
"resources:\n" +
|
||||
"- name: sts4\n" +
|
||||
" type: git\n" +
|
||||
" check_every: 5m\n" +
|
||||
" source:\n" +
|
||||
" repository: https://github.com/spring-projects/sts4\n"
|
||||
);
|
||||
|
||||
editor.assertHoverContains("name", "The name of the resource");
|
||||
editor.assertHoverContains("type", "The type of the resource. Each worker advertises");
|
||||
editor.assertHoverContains("source", 2, "The location of the resource");
|
||||
editor.assertHoverContains("check_every", "The interval on which to check for new versions");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user