Do not attempt to run gitlab-advanced-sast for non-Ultimate projects

Summary

Currently gitlab-advanced-sast SAST job runs for anyone including the template and then fails during validation. We need to add a conditional to check the feature capability and prevent the job from running entirely.

Steps to reproduce

  1. Setup a non-Ultimate project
  2. Include SAST template in CI config
  3. Observe job failure for gitlab-advanced-sast: [FATA] [GitLab Advanced SAST] ▶ Error: Not authorized to run Gitlab Advanced SAST Analyzer

Example Project

What is the current bug behavior?

gitlab-advanced-sast run and fails for non-Ultimate projects

What is the expected correct behavior?

gitlab-advanced-sast should not run for non-Ultimate projects

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com

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

Include GITLAB_FEATURES check in job definition rules to prevent execution

Edited by Lucas Charles