All Projects → jenkinsci → bom

jenkinsci / bom

Licence: other
JENKINS-47498: allow plugin dependencies to be specified via BOM

Programming Languages

shell
77523 projects
java
68154 projects - #9 most used programming language
groovy
2714 projects

Projects that are alternatives of or similar to bom

Fabric8
fabric8 is an open source microservices platform based on Docker, Kubernetes and Jenkins
Stars: ✭ 1,783 (+6757.69%)
Mutual labels:  jenkins, developer-tools
Fabric8 Platform
Generates the distribution of the fabric8 microservices platform
Stars: ✭ 105 (+303.85%)
Mutual labels:  jenkins, developer-tools
TyStrings
strings file tool for iOS / macOS developers
Stars: ✭ 15 (-42.31%)
Mutual labels:  developer-tools
Mac-OS-Setup-Applications
👾 All I need to setup a new Mac and the applications I use everyday as a Web Developper
Stars: ✭ 96 (+269.23%)
Mutual labels:  developer-tools
api4jenkins
Python client library for Jenkins API
Stars: ✭ 43 (+65.38%)
Mutual labels:  jenkins
AutoBrew
AutoBrew: Homebrew deployments made easy
Stars: ✭ 71 (+173.08%)
Mutual labels:  developer-tools
jenkinsfile cookbook pipeline
Example Jenkinsfile and Explaination for Chef Cookbook Development
Stars: ✭ 36 (+38.46%)
Mutual labels:  jenkins
hellonode
A Hello World HTTP server in Node, with a Dockerfile and a Jenkinsfile
Stars: ✭ 51 (+96.15%)
Mutual labels:  jenkins
parameterized-trigger-plugin
Jenkins parameterized-trigger plugin
Stars: ✭ 63 (+142.31%)
Mutual labels:  jenkins
tbot
Automation/Testing tool for Embedded Linux Development
Stars: ✭ 54 (+107.69%)
Mutual labels:  developer-tools
mockify
Easy, configurable API mocking you can change on-the-fly
Stars: ✭ 83 (+219.23%)
Mutual labels:  developer-tools
pipeline-maven-plugin
Pipeline Maven Plugin
Stars: ✭ 50 (+92.31%)
Mutual labels:  jenkins
gitops-build-lib
Jenkins pipeline shared library for automating deployments via GitOps
Stars: ✭ 23 (-11.54%)
Mutual labels:  jenkins
wechat
WeChat for Jenkins (Jenkins 官方微信公众号)
Stars: ✭ 20 (-23.08%)
Mutual labels:  jenkins
job-dsl-playground
An app for debugging Groovy scripts using the Jenkins Job DSL
Stars: ✭ 84 (+223.08%)
Mutual labels:  jenkins
approveapi-go
A Go library for using ApproveAPI
Stars: ✭ 16 (-38.46%)
Mutual labels:  developer-tools
hubi
Humanitarian ubiquitous language helper
Stars: ✭ 17 (-34.62%)
Mutual labels:  developer-tools
rurality
开源运维平台设计及开发样例、CMS、RBAC、python开发教程、管理系统设计及开发样例、jenkinsfile(pipeline)/ansible使用教程,一切想到的,想不到的,应有尽有
Stars: ✭ 51 (+96.15%)
Mutual labels:  jenkins
jenkins pipeline
A lean Continuous Deployment, Testing and Integration Pipeline using CoreOS/Docker/Jenkins
Stars: ✭ 44 (+69.23%)
Mutual labels:  jenkins
evo-odas
Code Repository for the EVO-ODAS
Stars: ✭ 30 (+15.38%)
Mutual labels:  jenkins

Bill of Materials for Jenkins plugins

This repository implements a Maven BOM which can be used in a plugin POM to more easily manage dependencies on other common plugins. This is important because version management is a common annoyance. See JENKINS-47498 for the background.

If you are interested in a Bill of Materials for Jenkins core components, see this page.

Usage

After selecting your plugin’s LTS baseline:

<jenkins.version>2.289.3</jenkins.version>

just import the latest BOM from that line:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.jenkins.tools.bom</groupId>
            <artifactId>bom-2.289.x</artifactId>
            <version>…</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>

Now you can declare dependencies on many plugins without needing to specify a version:

<dependency>
    <groupId>org.jenkins-ci.plugins.workflow</groupId>
    <artifactId>workflow-cps</artifactId>
    <scope>test</scope>
</dependency>

You can always override a version managed by the BOM if you wish, but if you find the need to use a newer version, first try just updating the version in the BOM and cutting a new release of it.

When starting to use the BOM in an existing plugin, you may find that many existing dependencies do not need to be expressed at all and can be deleted, if they were added solely to satisfy the RequireUpperBoundDeps Enforcer rule or similar. Maven will automatically add transitive dependencies to your classpath, so you should only need to declare an explicit dependency on another plugin when:

  • You compile against it. (Use test scope if it is only used in tests.)
  • It is required to be present and not otherwise loaded transitively. (For example, workflow-basic-steps and workflow-durable-task-step are commonly required for tests which run Pipeline builds.)

The command

mvn dependency:analyze

can offer clues about unused plugin dependencies, though you must evaluate each carefully since it only understands Java binary dependencies (what is required for compilation, more or less).

Development

For people potentially working on the BOM itself, not just consuming it.

Updating a plugin

You can try just incrementing plugin versions in bom/pom.xml. If CI passes, great! Dependabot will try doing this as well.

In cases where two or more plugins must be updated as a unit (JENKINS-49651), file a PR changing the versions of both.

Adding a new plugin

Insert a new dependency in sorted order to bom-weekly/pom.xml. Make sure it is used (perhaps transitively) in sample-plugin/pom.xml. Ideally also update the sample plugin’s tests to actually exercise it, as a sanity check.

Avoid adding transitive dependencies to sample-plugin/pom.xml. It is supposed to look as much as possible like a real plugin, and a real plugin should only declare its direct dependencies and not its transitive dependencies.

You can also add a <classifier>tests</classifier> entry, for a plugin which specifies <no-test-jar>false</no-test-jar>. You should introduce a POM property so that the version is not repeated.

The build will enforce that all transitive plugin dependencies are also managed. If the build fails due to an unmanaged transitive plugin dependency, add it to bom-weekly/pom.xml.

PCT

The CI build tries running the Plugin Compatibility Tester (PCT) on the particular combination of plugins being managed by the BOM. This catches mutual incompatibilities between plugins (as revealed by their JenkinsRule tests) and the specified Jenkins LTS version.

If there is a PCT failure, fix it in the plugin with the failing test, and when that fix is released, try updating the BOM again.

To reproduce a PCT failure locally, use something like

PLUGINS=structs,mailer TEST=InjectedTest bash local-test.sh

optionally also passing

DOCKERIZED=true

to reproduce image-specific failures.

Note that to minimize build time, tests are run only on Linux, against JDK 8, and without Docker support. It is unusual but possible for cross-component incompatibilities to only be visible in more specialized environments (such as Windows).

LTS lines

A separate BOM artifact is available for the latest weekly, current LTS line and a few historical lines. BOMs should only specify plugin version overrides compared to the next-newer BOM. sample-plugin will use the weekly line by default, and get a new POM profile for the others. To get ahead of problems, prepare the draft PR for a line as soon as its baseline is announced.

The CI build (or just mvn test -P2.nnn.x) will fail if some managed plugins are too new for the LTS line. This script is a handy way to find the most recently released plugin version compatible with a given line, according to the jenkins-infra/update-center2. The UC currently maintains releases for the past 400 days so it is reasonable to retire BOMs for lines older than that.

Releasing

Automatic given JEP-229 when PRs matching certain label patterns are merged. For the common case that only lots of dependencies PRs have been merged, can be triggered manually from the Actions tab after a master build has succeeded.

Incrementals

This repository is integrated with “Incrementals” JEP-305:

  • Individual BOM builds, including from pull requests, are deployed and may be imported on an experimental basis by plugins. (The plugin’s POM must use the gitHubRepo property as shown in workflow-step-api-plugin #58.)
  • Pull requests to the BOM may specify incremental versions of plugins, including unmerged PRs. (These should be resolved to formal release versions before the PR is merged.)

Together these behaviors should make it easier to verify compatibility of code changes still under review.

GitHub tooling

This repository uses Dependabot to be notified automatically of available updates, mainly to plugins. (It is not currently possible for Jenkins core updates to be tracked this way.)

Release Drafter is also used to prepare changelogs for the releases page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].