Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

Image Removed

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.

Image Added

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
pullRequestNumberBITBUCKET_PR_ID
latestCommitBITBUCKET_COMMIT
repoUrl BITBUCKET_REPO_SLUG
targetBranchBITBUCKET_PR_DESTINATION_BRANCHThis 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

...