...
The pull request job needs to run the SeaLights build scan and test listener for the test stages you want the analysis on.
These results will be compared to the latest build you reported to SeaLights for the branch you are merging the Pull Request to.
Pull Request parameters explanation as seen on a local BitBucket implementation
You can easily identify the relevant values to pass to the Build Scanner based on the illustration below.
Generating a session ID
Note |
---|
The difference between the pull request job and standard jobs is in how the session ID is created using Pull Request specific parameters. |
Generating a session ID
You create the Pull Request build session ID by using the SeaLights Java Build Scanner (See: Downloading the java agent files) with the prConfig option:
...
Info |
---|
The packages included and excluded should be exactly the same as what was defined to SeaLights for the merged branch so that the compared results will be the same |
Pull Request parameters as seen on a Bitbucket page
You can easily identify the relevant values to pass to the Build Scanner based on the illustration below.
Pull Request parameters mapping with Bitbucket Environment variables
Bitbucket provides a set of default variables that are available for builds, and can be used in scripts. These variables are detailed in the official Bitbucket documentation.
Sealights PR Parameter | BitBucket Env. Variable | Comment |
---|---|---|
pullRequestNumber | BITBUCKET_PR_ID | |
latestCommit | BITBUCKET_COMMIT | |
repoUrl | BITBUCKET_REPO_SLUG | |
targetBranch | BITBUCKET_PR_DESTINATION_BRANCH | 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 |
Sample of Results on the BitBucket Pull Request page
...