Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create an initial documentation page for Dependabot #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oleg-nenashev
Copy link
Member

@oleg-nenashev oleg-nenashev commented Oct 8, 2020

Creates a minimum page with recommendations for Java/Maven plugins stack

Jenkins project repositories currently use the Github-native Dependabot and the deprecated standalone versions,
migration is pending.

This page documents jenkins-specific recommendations for using Dependabot in the Jenkins repositories.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This page documents jenkins-specific recommendations for using Dependabot in the Jenkins repositories.
This page documents Jenkins-specific recommendations for using Dependabot in the Jenkins repositories.

Comment on lines +7 to +8
Jenkins project repositories currently use the Github-native Dependabot and the deprecated standalone versions,
migration is pending.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Jenkins project repositories currently use the Github-native Dependabot and the deprecated standalone versions,
migration is pending.
Jenkins project repositories currently use the Github-native Dependabot and the deprecated standalone versions (migration is pending).


* Make sure that you do not disable Maven Enforcer Plugin when using Dependabot.
Otherwise there will be a high risk of unnoticed dependency and binary compatibility conflicts.
* It is **not recommended** to automatically update Jenkins core to the most recent versions, because it will prevent LTS users from using them.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh?

First of all, it would be fine to enable Dependabot on Jenkins core, so long as you picked an appropriate pattern: *.*.* or whatever the syntax is. (And even if you left the version to float freely to weeklies, this would not prevent LTS users from running your plugin—only the latest versions of your plugin, released after the last LTS branching point.)

But anyway, as far as I know it does not work; Dependabot does not grok that

<jenkins.version>2.176.3</jenkins.version>

is fixing the version of an artifact defined in a parent POM and is thus eligible for upgrade. It only looks for artifacts defined in the literal pom.xml as far as I understand it.

You say you can configure a filter to prevent Dependabot from upgrading Jenkins core, but the plugin example does not do so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I'd rather keep the config file smaller if this is something Dependabot does not do (anymore) I think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* It is **not recommended** to automatically update Jenkins core to the most recent versions, because it will prevent LTS users from using them.
See https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/[this page] for baseline selection recommendations.
You can configure a filter to prevent Dependabot from updating Jenkins core versions (see the examples)
* There is a https://github.com/jenkinsci/bom/[Plugin Bill of Materials] which defines versions for many most used plugins.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* There is a https://github.com/jenkinsci/bom/[Plugin Bill of Materials] which defines versions for many most used plugins.
* There is a https://github.com/jenkinsci/bom/[Plugin Bill of Materials] which defines versions for many plugins in common use as dependencies.

Comment on lines +29 to +30
* Be careful with library dependencies, especially for popular utility libraries.
Requiring recent versions may sometimes cause binary conflicts with other plugins and the core.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is threatening yet so vague as to be useless. If you are going to say anything, at least link to https://www.jenkins.io/doc/developer/plugin-development/dependencies-and-class-loading/#bundling-third-party-libraries

And the example link is to an obscure plugin that

  • Includes library dependencies like asm few plugins would use.
  • Is blocking updates to the jackson2-api plugin, as well as other plugins defined in the bom.

Better pick a different example.

Comment on lines +37 to +38
NOTE: More examples will be added when project migrate to a GitHub-native Dependabot implementation with a v2 configuration format
(`.github/dependabot.yml` files and configurations in GitHub project settings).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is worth holding off on docs until we have better, more typical examples.

The canonical example is far simpler: https://github.com/jenkinsci/archetypes/blob/3e5a8cc4f208c51203cac20b882ccfcba397c657/common-files/.github/dependabot.yml

Copy link

@MRamonLeon MRamonLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR will help many people to be up to date wrt dependencies. I would suggest to add two basic examples that may work for everyone as first step. A simple configuration:

/.github/dependabot.yml:

version: 2
updates:
  - package-ecosystem: "maven"
    directory: "/"
    schedule:
      interval: "weekly"

And the same for just take into account security updated. Although I don't know exactly if it works for maven projects. I've read it only works on other dependencies managers: https://dependabot.com/blog/security-updates-only/ It's a 2-years-old blog entry, but the java-maven integration is still marked as Beta. 🤷

@jglick
Copy link
Member

jglick commented Oct 12, 2020

just take into account security updated

GitHub automatically files Dependabot PRs for dependencies with published CVEs, whether you configure Dependabot or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants