Keyword order in job templates
Problem/Motivation
Following from an initial conversation on Slack here is a suggestion for code improvement within the two template files, to re-order the keys/elements within each job to an agreed order. This will allow more easy comparison between jobs and/or to see which ones do not have a certain keyword.
Proposed resolution
Many of the jobs already follow a similar sequence of keywords, and from observation a common order is:
stage
image
extends
services
rules
needs
allow_failure ?
interruptible ?
variables
artifacts ?
before_script
script
after_script
This is only a first suggestion, we can adjust this if required.
There are lots of jobs that already follow this sequence:
- composer-base and all composer variants
- composer-lint
- all phpstan variants
- nightwatch, nightwatch max php & previous minor
- phpunit, phpunit max, & previous minor
- test-only changes
- environment check
- deprecation-warning-base
The other jobs should only need one or two keys moved to match this order.