Add support for a job-level `run` keyword
The `gitlab-ci.yml` file must allow the `run` keyword under jobs. A following issue: https://gitlab.com/gitlab-org/gitlab/-/issues/440488+s will add validation (e.g. in the pipeline editor). When this issue is complete, I would expect to type `run:` into the pipeline editor and it would be happy (no errors). I would not expect for the content under `run` to be [validated by the schema](https://gitlab.com/gitlab-org/gitlab/-/issues/440488), [stored in the database](https://gitlab.com/gitlab-org/gitlab/-/issues/440489), or [passed to runner](https://gitlab.com/gitlab-org/gitlab/-/issues/440490). Those issues come next. Here are the parts of [the epic](https://gitlab.com/groups/gitlab-org/-/epics/11846) which are relevant to this issue: ## Goals > 2. User can use CI Steps in their `.gitlab-ci.yml` with a first-class syntax `run:`. ## Design > #### .gitlab-ci.yml > > User would create the following `.gitlab-ci.yml` that would allow to use steps in existing CI workflows: > > ```yaml > hello-world: > image: registry.gitlab.com/gitlab-org/step-runner:latest > run: > - step: ./path/to/local/step-name.yml > - step: gitlab.com/josephburnett/component-hello-steppy@master > inputs: > hello: world > ``` ## Approach > * The `GitLab Rails` would bundle the JSON schema validation in a source code. > * The `GitLab Rails` would not parse the `run:`, only validate... ## Related Work | Group | Issue Link | | ------ | ------ | | ~backend | https://gitlab.com/gitlab-org/gitlab/-/issues/453957+ | | ~backend | :point_left: You are here | ## Contraint (from [discussion](https://gitlab.com/groups/gitlab-org/-/epics/11846#note_1772630819)) > Yes, we would consume json schema, and validate the entry: > > ```ruby > validates :run, json_schema: { > base_directory: "lib/gitlab/ci/config/entry/schemas/step_runner", > detail_errors: true, > filename: "steps", > hash_conversion: true > }, allow_nil: true > ``` > > No `Entry` classes. > > Rails would not do anything else with it, it would be forbidden to perform any transformation of the payload. It would be required to pass it as-is to Runner. So, we would serialize the `run` into `ci_builds_metadata`.
issue