После использования pronto в сочетании с Github в течение некоторого времени я попытался настроить его в сочетании с установкой Gitlab.
Сам поток CI работает просто отлично, но нет Никаких комментариев к запросу на слияние не добавлялось, как я ожидал. Похоже, что он ничего не делает с Gitlab, но сообщений об ошибках тоже нет.
Моя конфигурация (соответствующие части) выглядит следующим образом:
stages:
- security
.shared-variables: &shared-variables
PRONTO_GITLAB_API_ENDPOINT: "https://gitlab.example.com/api/v4"
PRONTO_PULL_REQUEST_ID: $CI_MERGE_REQUEST_IID
# PRONTO_GITLAB_API_PRIVATE_TOKEN is set from within GitLab
brakeman:
stage: security
only:
- merge_requests
variables:
<<: *shared-variables
BUNDLE_GEMFILE: Gemfile-pronto-brakeman
cache:
key: brakeman
paths:
- .gem
before_script:
- export PATH=$GEM_HOME/bin:$PATH
- |
cat > $BUNDLE_GEMFILE << EOF
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'pronto'
gem 'brakeman'
# TODO: change back once https://github.com/prontolabs/pronto-brakeman/pull/21 is merged & published
gem 'pronto-brakeman', github: 'zenom/pronto-brakeman'
EOF
- bundle install --jobs $(nproc)
script:
# this part of the pipeline only uses the brakeman runner
- bundle exec pronto run --exit-code -f gitlab_mr -r brakeman -c origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
bundle-audit:
stage: security
only:
- merge_requests
variables:
<<: *shared-variables
BUNDLE_GEMFILE=Gemfile-pronto-bundler_audit
before_script:
- export PATH=$GEM_HOME/bin:$PATH
- |
cat > $BUNDLE_GEMFILE << EOF
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
gem 'pronto'
# Latest changes haven't been published yet
gem 'bundler-audit', github: 'rubysec/bundler-audit'
gem 'pronto-bundler_audit'
EOF
- gem update --system
- bundle install --jobs $(nproc)
- bundle exec bundle-audit update
script:
# Note that bundler_audit is fixed to scan `Gemfile.lock`
- bundle exec pronto run --exit-code -f gitlab_mr -r bundler_audit -c origin/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME