Migrating Static Analyzers
Static analyzers executed on Bitbucket are deprecated as of app version 5.0.
For migration, follow the guide below to move onto the newer CI log based analysis.
Migration Example: PMD
Before app version 5.x, static analyzers were executed on Bitbucket.
Now, you have to execute them during your CI build:
Run PMD as part of your CI build.
Download and install PMD to use on your CI server. Or use a PMD plugin for your build system, like Maven or Gradle
Run the PMD as part of the build for every pull request. See the configuration for Bamboo.
The print the PMD results to the build log. Either by using the
--format xml
flag or by printing the report XML, likecat ./target/pmd.xml
Configure and enable the log analysis.
Ensure the log analysis reports the PMD warnings as you expect in your pull request as code insight annotations.
Disable the deprecated built-in PMD analyzer, as you get the results duplicated otherwise.
Migrate Other Analyzers
For analyzers not listed there, you can still use them if they support the
For other analyzers, tell us what you use. We will help you with the migration.
Reason for Deprecating Static Analyzers
The running static Analyzers on Bitbucket itself has inherent issues:
Bitbucket 8 changed its internal Git APIs to support Bitbucket Mesh. Supporting it would make the performance event more unpredictable, as the Git repos might be remote to where the analyzers run. On Bitbucket 8 the static analyzers are not supported anymore.
Bitbucket servers are not configured to run tools in the background. This results in issues like Bitbucket running out of disk space, due to checked-out working directories. Or Bitbucket being slow due to the extra work etc.
The CI server has better infrastructure to run analyzers than Bitbucket. The CI server is set up to run arbitrary builds, including analyzer steps. It has facilities to clean up disk space, is expected to have build tools installed, and it can distribute work across build agents.
Running Analyzers on Bitbucket is not compatible with a multi node Data Center setup. Multiple Bitbucket nodes would need to coordinate to run the analyzer only once and distribute the load between different nodes. The CI server already solves this issue.
Therefore, we decided that running the Analyzers on the CI system and showing the results in Bitbucket is the better way going forward.