Skip to content
Snippets Groups Projects

Update Secret Detection template

Merged Zach Rice requested to merge secret-detection-template-update-1 into master
All threads resolved!

What does this MR do and why?

This issue should fix the following issues:

In order to prep the Secret Detection job's git environment, we need to use some Predefined Environment Variables and enable merge request pipelines so that the job has access to Merge Request Environment Variables.

The two important env vars we need are CI_COMMIT_BEFORE_SHA and CI_MERGE_REQUEST_TARGET_BRANCH_NAME.

  • CI_COMMIT_BEFORE_SHA is used for push events and give us the ancestor commit we should use with CI_COMMIT_SHA in the git log ${CI_COMMIT_BEFORE_SHA}..${CI_COMMIT_SHA} command.
  • CI_MERGE_REQUEST_TARGET_BRANCH_NAME is used for merge requests which allows us to determine the range of commits for an MR. Before we were incorrectly using CI_DEFAULT_REF, which in some cases would give incorrect results depending on the git development process (using main and the default branch and develop as the development branch that all story/feature branches get merged into).

Screenshots or screen recordings

- MR event example: https://gitlab.com/gitlab-org/security-products/tests/secrets/-/jobs/2064659355

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

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 Zach Rice

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • mentioned in issue #351693 (closed)

  • Zach Rice added 1 commit

    added 1 commit

    Compare with previous version

  • mentioned in issue #352565 (closed)

  • Vijay Hawoldar approved this merge request

    approved this merge request

  • Vijay Hawoldar requested review from @marcel.amirault and removed review request for @vij

    requested review from @marcel.amirault and removed review request for @vij

  • mentioned in issue #350660 (closed)

  • Marcel Amirault removed review request for @marcel.amirault

    removed review request for @marcel.amirault

  • mentioned in issue #254199 (closed)

  • mentioned in issue #350573 (closed)

  • 🤖 GitLab Bot 🤖 changed milestone to %14.9

    changed milestone to %14.9

  • Zach Rice added 2 commits

    added 2 commits

    • 1a8bfc0f - Check previous git log command exit code
    • c51ff67f - Check previous git log command exit code

    Compare with previous version

  • Zach Rice requested review from @marcel.amirault

    requested review from @marcel.amirault

  • Marcel Amirault removed review request for @marcel.amirault

    removed review request for @marcel.amirault

  • Zach Rice requested review from @marcel.amirault

    requested review from @marcel.amirault

  • Zach Rice removed review request for @marcel.amirault

    removed review request for @marcel.amirault

  • Zach Rice added 1 commit

    added 1 commit

    • 68344ae0 - Use set +e to ignore git log failure

    Compare with previous version

  • Zach Rice requested review from @marcel.amirault

    requested review from @marcel.amirault

  • Marcel Amirault requested review from @matteeyah and removed review request for @marcel.amirault

    requested review from @matteeyah and removed review request for @marcel.amirault

  • Matija Čupić removed review request for @matteeyah

    removed review request for @matteeyah

  • Zach Rice added 1 commit

    added 1 commit

    • ebc2e2dd - Consistent newlines, re-enable failure on exit

    Compare with previous version

  • requested review from @marcel.amirault, @theoretick, and @matteeyah

  • Lucas Charles removed review request for @theoretick

    removed review request for @theoretick

  • Lucas Charles
  • Marcel Amirault removed review request for @marcel.amirault

    removed review request for @marcel.amirault

  • Matija Čupić removed review request for @matteeyah

    removed review request for @matteeyah

  • Zach Rice added 1 commit

    added 1 commit

    Compare with previous version

  • Zach Rice requested review from @marcel.amirault

    requested review from @marcel.amirault

  • Lucas Charles approved this merge request

    approved this merge request

  • Lucas Charles mentioned in merge request !81847 (merged)

    mentioned in merge request !81847 (merged)

  • Zach Rice changed the description

    changed the description

  • Marcel Amirault approved this merge request

    approved this merge request

  • Marcel Amirault resolved all threads

    resolved all threads

  • Marcel Amirault mentioned in issue #354078

    mentioned in issue #354078

  • @zrice Thank you so much for all the hard work and sticking through with it! (also, thanks for your patience with my reviews, takes me a bit longer than the engineers that think code all day every day :sweat_smile:). I'm glad to be able to merge this for you, LGTM!

  • Marcel Amirault enabled an automatic merge when the pipeline for b66f7e9a succeeds

    enabled an automatic merge when the pipeline for b66f7e9a succeeds

  • Marcel Amirault mentioned in commit 46fa0357

    mentioned in commit 46fa0357

  • Brian Williams mentioned in merge request !80435 (merged)

    mentioned in merge request !80435 (merged)

  • added workflowcanary label and removed workflowstaging label

  • Zach Rice mentioned in merge request !72689 (closed)

    mentioned in merge request !72689 (closed)

  • added workflowproduction label and removed workflowcanary label

  • mentioned in issue #351976 (closed)

  • mentioned in issue #356093 (closed)

  • hash mentioned in issue #357453 (closed)

    mentioned in issue #357453 (closed)

  • Please register or sign in to reply
    Loading