Skip to content

Adds a first pass at a ci config danger rule

Sam Beckham requested to merge ci_danger into master

What does this MR do and why?

This MR adds a danger rule to warn people when they change CI rules, but don't update the schema to match the change. We use the schema to suggest and autocomplete in the pipeline editor and Web IDE, so keeping it up-to-date is important. This danger rule should help with that.

If any changes are made to the CI rules, but there's no change to the schema, the warning triggers.

Note: Currently, the message links to the schema itself. We'd like it to link to documentation that helps you with updating the schema but we don't have that just yet. It's being written and we'll update this rule when we have it.

Screenshots or screen recordings

Screenshot_2021-11-26_at_11.24.34 ci_danger

How to set up and validate locally

  1. Pull down this branch
  2. Make a commit that changes files in lib/gitlab/ci/config/entry/ or ee/lib/gitlab/ci/config/entry/
  3. Run the dangerbot locally with bin/rails danger_local, you should see the warning message
  4. Make a commit that changes the schema in app/assets/javascripts/editor/schema/ci.json
  5. Run dangerbot again bin/rails danger_local, the warning message should no-longer be there.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sam Beckham

Merge request reports