Coder Social home page Coder Social logo

concourse-pipeline-jsonschema's Introduction

concourse-pipeline-jsonschema

License

Json Schema for Concourse Pipeline

why?

I developed cappyzawa/fly-lint.vim: Vim Plugin for fly.
This vim plugin executes format or lint via vim command.

I was using it, but I wanted completition as well as linter for the Concourse pipeline.

redhat-developer/yaml-language-server: Language Server for Yaml Files seemed to fulfill my hope.
This tool only needs Json Schema, so I created it for Concourse Pipeline.

Usage

redhat-developer/yaml-language-server: Language Server for Yaml Files should been installed.

There are clients for this lsp.

This json schema needs to be linked with the concourse pipeline file by the setting of lsp client.

yaml.schemas: {
  "https://raw.githubusercontent.com/cappyzawa/concourse-pipeline-jsonschema/master/concourse_jsonschema.json": "/pipeline.yml"
}

concourse-pipeline-jsonschema's People

Contributors

cappyzawa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sambacha

concourse-pipeline-jsonschema's Issues

Autogenerated inputs schema for puts cannot be satisfied by any document Concourse will accept

Per https://concourse-ci.org/put-step.html, inputs on a Put step may be the string "all", the string "detect", or a list of identifiers.

All three of these options result in Incorrect type. Expected "InputsConfig".

The schema expects the underlying Go structure to be provided; however, this Go structure is not in accordance with Concourse's documentation. As far as I can tell, for this particular type it is probably necessary to forego automatic generation and provide a definition by hand.

can't use plain array in `in_parallel`

When I validate a pipeline with in_parallel like this one:

jobs:
- name: job
  plan:
  - in_parallel:
    - get: a
    - get: b

Which should be valid according concourse docs:

Steps are either configured as a array or within a in_parallel_config schema.

I see .jobs[0].plan[0].in_parallel expected object got: array.


I took a look at the schema:

"InParallelConfig": {
	"properties": {
		"steps": {
			"items": {
				"$ref": "#/definitions/PlanConfig"
			},
			"type": "array"
		},
		"limit": {
			"type": "integer"
		},
		"fail_fast": {
			"type": "boolean"
		}
	},
	"additionalProperties": false,
	"type": "object"
},

and

"in_parallel": {
	"$schema": "http://json-schema.org/draft-04/schema#",
	"$ref": "#/definitions/InParallelConfig"
},

It is indeed wrong here.

Step schema generated with different properties

I noticed after configuring the schema with some pipelines a few warnings for properties inside the plan and other schemas. They are related to the Step definition, which should have the step schema from here: https://concourse-ci.org/jobs.html#schema.step

However, the following Step definition is generated:

        "Step": {
            "required": [
                "Config",
                "UnknownFields"
            ],
            "properties": {
                "Config": {
                    "additionalProperties": true
                },
                "UnknownFields": {
                    "patternProperties": {
                        ".*": {
                            "items": {
                                "type": "integer"
                            },
                            "type": "array"
                        }
                    },
                    "type": "object"
                }
            },
            "additionalProperties": false,
            "type": "object"
        },

I think it's because the Step struct is a special struct in application code (see https://github.com/concourse/concourse/blob/master/atc/steps.go#L12-L17).

Any idea on how to fix that? Maybe using the actual struct for each type (https://github.com/concourse/concourse/blob/master/atc/steps.go#L290-L371) instead the main one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.