Skip to content

Scheduled policies with agents do not create pipelines

Summary

It seems we skip the pipeline creation for scan_execution_policies with the type schedule using the agents property.

We create the pipelines iterating through the branches. However, the scan execution policies with the agents properties do not contain the branch information.

At the scheduled time RuleScheduleWorker starts as expected and calls the RuleScheduleService that finishes without creating the pipelines and without logging any error.

Steps to reproduce

  1. Create a new project
  2. Go to Secure > Policies
  3. Select new policy
  4. Click on new policy
  5. Select Scan execution policy
  6. Change to the yaml mode
  7. Create a policy like the one described here
  8. Click on configure with a merge request
  9. Click on merge
  10. Verify that no pipeline is created at the scheduled time.

Example Project

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by Marcos Rocha