Validate CI/CD job image reference format
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=199796) </details> <!--IssueSummary end--> ### Problem to solve When using Kubernetes executor runners (and possibly other types), jobs that specify an image with a invalid reference format (e.g. `node:10:16.0` instead of `node:10.16.0`) end up with a `runner_system_failure` build failure reason. This is misleading as the issue is generally not a systemic issue with the runners/host system, but a mistake in the project's `.gitlab-ci.yml`. Kubernetes event associated with this type of mistake: ``` 60m Warning InspectFailed pod/runner-5u6znvzc-project-923-concurrent-3mlvtj Failed to apply default image tag "node:10:16.0": couldn't parse image reference "node:10:16.0": invalid reference format ``` ### Intended users * [Sasha (Software Developer)](https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/#sasha-software-developer) * [Devon (DevOps Engineer)](https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/#devon-devops-engineer) ### Further details <!-- Include use cases, benefits, and/or goals (contributes to our vision?) --> Sasha makes a simple typo when specifying an image in `.gitlab-ci.yml`, but is able to understand the mistake right away based on clear, specific feedback from CI linting and/or job log, without needing to ask Devon for help. Devon can use `runner_system_failure` as an operational health indicator for runners they maintain, with less false positives due to non-systemic issues. ### Proposal Proposing to validate the format of the image reference explicitly (possibly part of linting `.gitlab-ci.yml`, or at least sometime before actually attempting to run the job container), so that a more appropriate failure reason (image pull failure, invalid CI file) can be reported. <!-- How are we going to solve the problem? Try to include the user journey! https://about.gitlab.com/handbook/journeys/#user-journey --> ### Permissions and Security <!-- What permissions are required to perform the described actions? Are they consistent with the existing permissions as documented for users, groups, and projects as appropriate? Is the proposed behavior consistent between the UI, API, and other access methods (e.g. email replies)?--> ### Documentation <!-- See the Feature Change Documentation Workflow https://docs.gitlab.com/ee/development/documentation/feature-change-workflow.html Add all known Documentation Requirements here, per https://docs.gitlab.com/ee/development/documentation/feature-change-workflow.html#documentation-requirements If this feature requires changing permissions, this document https://docs.gitlab.com/ee/user/permissions.html must be updated accordingly. --> ### Availability & Testing <!-- What risks does this change pose to our availability? How might it affect the quality of the product? What additional test coverage or changes to tests will be needed? Will it require cross-browser testing? Please list the test areas (unit, integration and end-to-end) that needs to be added or updated to ensure that this feature will work as intended. Please use the list below as guidance. * Unit test changes * Integration test changes * End-to-end test change See the test engineering planning process and reach out to your counterpart Software Engineer in Test for assistance: https://about.gitlab.com/handbook/engineering/quality/test-engineering/#test-planning --> ### What does success look like, and how can we measure that? <!-- Define both the success metrics and acceptance criteria. Note that success metrics indicate the desired business outcomes, while acceptance criteria indicate when the solution is working correctly. If there is no way to measure success, link to an issue that will implement a way to measure this. --> ### What is the type of buyer? <!-- Which leads to: in which enterprise tier should this feature go? See https://about.gitlab.com/handbook/product/pricing/#four-tiers --> ### Links / references
issue