-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Add lock jobs and improve job JSON schema validations #370
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
Conversation
stig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see the commits adding code and the tests for that code squashed together. I'm happy for the documentation and formatting changes being separate commits.
bc8386c to
e1af8aa
Compare
@stig I have squashed relevant code change commits together with their tests |
e1af8aa to
384021d
Compare
…s for release, no-op, approval, lock and unlock job types
384021d to
1af1dc8
Compare

Jira: https://circleci.atlassian.net/browse/PIPE-5266
Description
New job types
This PR adds support for two job types:
lockunlockImproved schema validation
While these job types are not explicitly explained in the docs, they are the underling job types that our serial group feature uses under the hood.
This MR also also adds improved validations for other job types that we already had:
approval/no-opjobs don't need any additional parameters to be validlock/unlockrequire akey:parameter to be specifiedreleasejobs require aplan_name:parameter to be specifiedOther changes
HACKING.mdto explain the difference between our schemas and when to update which oneImplementation details
To improve the experience of editing these schema.json files, I ran the default vscode JSON auto-formatter with 4 spaces on the
schemaandpublicschemafiles. This makes the diff hard to read, so this commit is where I actually add the new re-usable jobDefinition with all the new validations. I re-use this jobDefinition ref inside the jobs: section and the orbs: jobs: section.In order to add the complex JSON schema rules, I needed to use if/then/else syntax which was introduced in JSON schema draft-07. I bumped the version of
schema.json.How to validate
Following the steps in
HACKING.mdto run the language server extension in VScode would be the easiest way to verify it works in your editor!