Skip to content

Add additional variables for Jenkins #2263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oscarhearsawho
Copy link

@oscarhearsawho oscarhearsawho commented Aug 1, 2025

As a result of the Linear FS-2764, we identified that customers using a Jenkins & Bitbucket combo meal may need to include these additional variables in their Jenkins Pipeline:

  • SEMGREP_REPO_NAME
  • SEMGREP_REPO_URL
  • SEMGREP_COMMIT

Specifically the commit one, without this PR comments were failing for the customer, due to a piece of logic we have in renderer.py that requires the repo_name, pr_id and commit to be able to post comments.

The definitions I've added (and the location of the addition) might need tweaking, definitely not a final version here.

Copy link

netlify bot commented Aug 1, 2025

Don't forget to add /docs at the end of the deploy preview site URL!

Name Link
🔨 Latest commit 2594b0e
🔍 Latest deploy log https://app.netlify.com/projects/semgrep-docs-prod/deploys/688ce7789523b5000842d4ce
😎 Deploy Preview https://deploy-preview-2263--semgrep-docs-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@armchairlinguist
Copy link
Collaborator

armchairlinguist commented Aug 1, 2025

I think we need to make this change in more places, and provide more context on when and how to set which variables, so I'd advise we don't accept this PR as written but do use it as a foundation to improve here. Thanks for your contributions, Oscar!

@@ -65,7 +65,11 @@ pipeline {

:::note
- Ensure that you have defined a `SEMGREP_APP_TOKEN` as a credential in Jenkins.
- The variable SEMGREP_BASELINE_REF must be set to the main branch, in the example: `origin/master`.
- The variable `SEMGREP_BASELINE_REF` must be set to the main branch, in the example: `origin/master`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The variable `SEMGREP_BASELINE_REF` must be set to the main branch, in the example: `origin/master`.
- Ensure that you have defined the variable `SEMGREP_BASELINE_REF` and set its value to the name of the main branch, such as `origin/master`.

@@ -65,7 +65,11 @@ pipeline {

:::note
- Ensure that you have defined a `SEMGREP_APP_TOKEN` as a credential in Jenkins.
- The variable SEMGREP_BASELINE_REF must be set to the main branch, in the example: `origin/master`.
- The variable `SEMGREP_BASELINE_REF` must be set to the main branch, in the example: `origin/master`.
- You may need to set additional variables, depending on your environment configuration, such as;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- You may need to set additional variables, depending on your environment configuration, such as;
- You may need to set additional variables, depending on your environment configuration, such as:

- The variable SEMGREP_BASELINE_REF must be set to the main branch, in the example: `origin/master`.
- The variable `SEMGREP_BASELINE_REF` must be set to the main branch, in the example: `origin/master`.
- You may need to set additional variables, depending on your environment configuration, such as;
- `SEMGREP_REPO_NAME` -> An exact, case-sensitive match, to the repository name in Bitbucket
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `SEMGREP_REPO_NAME` -> An exact, case-sensitive match, to the repository name in Bitbucket
- `SEMGREP_REPO_NAME`: The Bitbucket repository name. This value is case sensitive.

- The variable `SEMGREP_BASELINE_REF` must be set to the main branch, in the example: `origin/master`.
- You may need to set additional variables, depending on your environment configuration, such as;
- `SEMGREP_REPO_NAME` -> An exact, case-sensitive match, to the repository name in Bitbucket
- `SEMGREP_REPO_URL` -> The web link to your repository (not the `.git` one)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `SEMGREP_REPO_URL` -> The web link to your repository (not the `.git` one)
- `SEMGREP_REPO_URL`: The web link to your repository (_not_ the `.git` URL).

- You may need to set additional variables, depending on your environment configuration, such as;
- `SEMGREP_REPO_NAME` -> An exact, case-sensitive match, to the repository name in Bitbucket
- `SEMGREP_REPO_URL` -> The web link to your repository (not the `.git` one)
- `SEMGREP_COMMIT` -> Specifically for PRs / diff scans, set this to the HEAD commit of the PR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `SEMGREP_COMMIT` -> Specifically for PRs / diff scans, set this to the HEAD commit of the PR
- `SEMGREP_COMMIT`: The HEAD commit of the pull request. This variable is specifically used for diff-aware scans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants