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

[JENKINS-64881] Bump dependencies to avoid PCT failure #42

Merged
merged 4 commits into from
Feb 26, 2021

Conversation

MRamonLeon
Copy link
Contributor

See JENKINS-64881

This PR fixes a PCT failure (MsBuildBuilderTest#configRoundtrip) by updating HtmlUnit via updating the parent pom. We use the bom to better manage the dependencies.

In addition it improves the log printed in this method to know the root exception.

This also adds dependabot to the repository.

Copy link
Member

@batmat batmat left a comment

Choose a reason for hiding this comment

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

🎆

@batmat batmat requested a review from marshall777 February 16, 2021 13:03
@MRamonLeon
Copy link
Contributor Author

Optional reviewers: @rsandell @jtnord @olamy @bitwiseman @car-roll

Comment on lines +58 to +68
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.222.x</artifactId>
<version>24</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
Copy link
Member

Choose a reason for hiding this comment

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

given you only have 1 dependency here - do you really want this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, regardless of number of dependencies, using the bom will avoid future PCT version mismatch failures.

Copy link
Member

@jtnord jtnord Feb 17, 2021

Choose a reason for hiding this comment

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

can you explain that - as the BOM is not a plugin dependency (nor is htmlunit) and not shipped with a war so how is it updated and how will it help here?
credentials-binding-pom-before.xml and credentials-binding-pom-after.xml show the same version in the PCT unit tests so some pointers so I can understand this would be very helpful

Copy link
Contributor

Choose a reason for hiding this comment

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

@jtnord

Thought they were functionally different in some scenarios for enforcement of minimum upper bounds, but I was probably wrong. The last three commits in https://github.com/bitwiseman/github-branch-source-plugin/commits/dependencies/sample-1 show that the error is the same regardless of where the version is set.

Putting that aside, I would say that using the bom is considered best practice for all plugins we maintain. If someone comes along later and adds another dependency, the bom will already be there. Using the bom is more lines in this case, but it feels clearer.

Also, dependencyManagement is the best practice for ensuring specific version numbers for transitive dependencies (rather than depending on pom file and class loading ordering). I see the point that there is only one dependency, so this doesn't apply here, but again start with consistent best practices and stick with them.

Just my opinion.

@MRamonLeon MRamonLeon merged commit d5e34bd into jenkinsci:master Feb 26, 2021
@MRamonLeon MRamonLeon deleted the JENKINS-64881 branch February 26, 2021 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants