Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • rpmci rpmci
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linuxsupportlinuxsupport
  • rpmcirpmci
  • Merge requests
  • !15

Transition from only/except to rules

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Christos Arvanitis requested to merge carvanit/rpmci:feat/rules into rules Sep 10, 2021
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 5

This MR replaces only/except conditions with rules. This change enables rpmci users to define more specific conditions for job execution (e.g. set koji_scratch as auto job for protected branches and as manual job for feature branches, thus allowing koji specific variables to be protected).

Additionally:

From Gitlab Keyword Reference:

only and except are not being actively developed. rules is the preferred keyword to control when to add jobs to pipelines.

Rules offer more granularity and flexibility comparing to only/except. However, rules and only/except cannot be mixed:

rules replaces only/except and they can’t be used together in the same job. If you configure one job to use both keywords, the GitLab returns a key may not be used with rules error.

Rules are defined as YAML arrays so they cannot be merged (in case of extending jobs). However, there are workarounds for this:

  • Using native YAML anchors (https://stackoverflow.com/a/67012275)

Note: For testing, included yml files in rpm-ci.yml should be replaced with the corresponding ones for the feature branch instead of the master ones

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: feat/rules