Identifying the required Pull Request parameters from the SCM or CI
When reporting a Pull Request to SeaLights, the parameters required to configure the pull request BSID vary between the source control provider.
This article will help you to map the required parameters to their location within the few most common source control or CI providers:
Here is a table summarizing the most common variables in use in the relevant SCM section
Sealights PR Parameter | Jenkins GitHub Pull Request Builder variables | BitBucket env. variables | GitLab env. variables | Generic Git variables |
---|---|---|---|---|
pullRequestNumber |
|
|
|
|
latestCommit |
|
|
|
|
repoUrl |
|
|
|
|
targetBranch |
|
|
|
|
For latestCommit parameter, we’re highlighting the short version in the screenshots below but the long/entire SHA identifier needs to be used.
GitHub
If you’re using the GitHub Actions or the GitHub Pull Request Builder plugin for Jenkins, you can use the following mapping to variables suggested below
Sealights PR Parameter | GitHub Actions variables | GitHub PR Builder variables (Jenkins plugin) | Comment |
---|---|---|---|
pullRequestNumber |
|
|
|
latestCommit |
|
|
|
repoUrl |
|
| Something similar to: https://github.mycompany.com/myappjava/ if the pull request URL is |
targetBranch |
|
| This is the branch name itself and might need to have a prefix added (Like: "origin/") to match the branch that was provided to SeaLights when scanning the merged branch |
GitLab
Please notice GitLab refers to this capability as Merge Request (MR) and not as Pull Request (See GitLab documentation for more details).
Then, switching to the “Commits” tab:
More details for GitLab may be found in the official documentation: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
Using the GitLab plugin for Jenkins
If you’re using the GitLab plugin for Jenkins you can use the following mapping to environment variables provided by the plugin
Sealights PR Parameter | GitLab plugin variables | Comment |