Skip to content

Backend: Provide components as helpers to test other components

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Context

Feedback from https://gitlab.com/gitlab-com/marketing/developer-relations/dev-evangelism/de-tmm-meta/-/issues/230#note_1628630841

  1. The curl/API token method feels complicated to read. Maybe we can hide this in a future component itself.
  2. The API_TOKEN seems can maybe replaced by a CI_JOB_TOKEN, since the job insights are publicly available. Need to test that - I do not want to use my full API token for component testing.
  3. CI/CD jobs will require a specific environment. For Rust, I needed to run cargo init with some sample code in the components repository.
    • This can clutter the directory structure.

    • Maybe an "environment" prefix or git submodule or git clone in CI/CD can be helpful for testing the component.

Problem

Make it easy to test components in GitLab during their development process. GitLab should provide components that users can leverage to simplify their testing process

Idea 1

include:
  - component: gitlab.com/gitlab-components/component-test@1.0
    inputs:
      component_path: templates/component-1.yml
      stage: test
  - component: gitlab.com/gitlab-components/component-test@1.0
    inputs:
      component_path: templates/component-2.yml
      stage: test

Idea 2

Create a component that does shell check for all script, before_script and after_script. Similar to https://docs.gitlab.com/ee/development/cicd/templates.html#syntax-guidelines

Idea 3

Create a component that creates a release automatically when a new tag is created. The component will add a create-release job that uses the release keyword: https://docs.gitlab.com/ee/ci/components/#release-a-component

Project to contribute to

We have started implementing https://gitlab.com/components/toolkit with some components that run specific tests. We can add more components (described above) to it.

Edited by 🤖 GitLab Bot 🤖