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

Update to gradle 8.0.2 #2520

Merged
merged 3 commits into from
Mar 9, 2023
Merged

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Mar 7, 2023

Description

Starting a draft pull request to understand required efforts for migration to gradle 8. Reference PR from core: opensearch-project/OpenSearch#5666

  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Maintenance

Issues Resolved

N/A

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Craig Perkins <[email protected]>
@peternied
Copy link
Member

The failing tasks come from the OpenSearch repo, seems like we should open an issue to resolve?

* What went wrong:
Some problems were found with the configuration of task ':validateMavenPom' (type 'PomValidationTask').
  - Gradle detected a problem with the following location: '/home/runner/work/security/security/build/distributions/opensearch-security-3.0.0.0.pom'.
    
    Reason: Task ':validateMavenPom' uses this output of task ':generatePomFileForPluginZipPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':generatePomFileForPluginZipPublication' as an input of ':validateMavenPom'.
      2. Declare an explicit dependency on ':generatePomFileForPluginZipPublication' from ':validateMavenPom' using Task#dependsOn.
      3. Declare an explicit dependency on ':generatePomFileForPluginZipPublication' from ':validateMavenPom' using Task#mustRunAfter.
    
    Please refer to https://docs.gradle.org/8.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/home/runner/work/security/security/build/distributions/opensearch-security-3.0.0.0.pom'.
    
    Reason: Task ':validateMavenPom' uses this output of task ':generatePomFileForNebulaPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':generatePomFileForNebulaPublication' as an input of ':validateMavenPom'.
      2. Declare an explicit dependency on ':generatePomFileForNebulaPublication' from ':validateMavenPom' using Task#dependsOn.
      3. Declare an explicit dependency on ':generatePomFileForNebulaPublication' from ':validateMavenPom' using Task#mustRunAfter.
    
    Please refer to https://docs.gradle.org/8.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Signed-off-by: Craig Perkins <[email protected]>
@cwperks cwperks marked this pull request as ready for review March 7, 2023 18:51
@cwperks cwperks added the backport 2.x backport to 2.x branch label Mar 7, 2023
@@ -206,7 +206,9 @@ opensearchplugin {
loggerUsageCheck.enabled = false

// No need to validate pom, as we do not upload to maven/sonatype
validateNebulaPom.enabled = false
tasks.matching {it.path in [":validateMavenPom", ":validateNebulaPom", ":validatePluginZipPom"]}.all { task ->
Copy link
Member

Choose a reason for hiding this comment

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

nice!

build.gradle Outdated
Comment on lines 209 to 211
tasks.matching {it.path in [":validateMavenPom", ":validateNebulaPom", ":validatePluginZipPom"]}.all { task ->
task.enabled = false
}
Copy link
Member

@peternied peternied Mar 7, 2023

Choose a reason for hiding this comment

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

Seems like we can keep running the validation by adding the dependency, verified on my local machine

Suggested change
tasks.matching {it.path in [":validateMavenPom", ":validateNebulaPom", ":validatePluginZipPom"]}.all { task ->
task.enabled = false
}
tasks.matching {it.path in [":validateMavenPom", ":validateNebulaPom", ":validatePluginZipPom"]}.all { task ->
task.dependsOn ':generatePomFileForNebulaPublication', ':generatePomFileForPluginZipPublication', ':generatePomFileForMavenPublication'
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

Please upgrade the bwc-test gradle version too

Signed-off-by: Craig Perkins <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Mar 8, 2023

Codecov Report

Merging #2520 (7ba64bb) into main (8d7b904) will decrease coverage by 0.06%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #2520      +/-   ##
============================================
- Coverage     61.27%   61.21%   -0.06%     
+ Complexity     3332     3328       -4     
============================================
  Files           260      260              
  Lines         18504    18504              
  Branches       3268     3268              
============================================
- Hits          11339    11328      -11     
- Misses         5571     5578       +7     
- Partials       1594     1598       +4     
Impacted Files Coverage Δ
...ecurity/configuration/StaticResourceException.java 0.00% <0.00%> (-25.00%) ⬇️
...urity/ssl/transport/SecuritySSLNettyTransport.java 62.36% <0.00%> (-4.31%) ⬇️
...nsearch/security/dlic/rest/api/AuditApiAction.java 64.58% <0.00%> (-4.17%) ⬇️
...earch/security/ssl/util/SSLConnectionTestUtil.java 93.18% <0.00%> (-2.28%) ⬇️
...search/security/transport/SecurityInterceptor.java 75.38% <0.00%> (-0.77%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

nicely done @cwperks !

@DarshitChanpura DarshitChanpura merged commit 1daff11 into opensearch-project:main Mar 9, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-2520-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1daff1180ba2a0f02b9d4e38ecb20937572b5bad
# Push it to GitHub
git push --set-upstream origin backport/backport-2520-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-2520-to-2.x.

@cwperks
Copy link
Member Author

cwperks commented Mar 9, 2023

I will create a manual backport for this.

MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Apr 20, 2023
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Maciej Mierzwa <[email protected]>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Apr 27, 2023
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Maciej Mierzwa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants