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

Automatically perform wrapper validation check in setup-gradle #12

Closed
bigdaz opened this issue Jan 28, 2022 · 5 comments
Closed

Automatically perform wrapper validation check in setup-gradle #12

bigdaz opened this issue Jan 28, 2022 · 5 comments
Labels
Milestone

Comments

@bigdaz
Copy link
Member

bigdaz commented Jan 28, 2022

Currently, we recommend that users configure a separate workflow running the wrapper-validation-action to verify that the Gradle wrapper jar is not corrupted.

Doing this automatically for any workflow using setup-gradle and dependency-submission would increase coverage of wrapper validation and reduce the complexity for users adopting Gradle with GitHub actions. The functionality already exists with the validate-wrappers parameter: this issue is about enabling this by default.

Issues outstanding to allow this:

@bigdaz bigdaz added the enhancement New feature or request label Jan 28, 2022
@eygraber
Copy link

Is there any timeline on this happening?

@erichaagdev
Copy link
Member

Currently, we recommend that users configure a separate workflow running the wrapper-validation-action to verify that the Gradle wrapper jar is not corrupted.

I would recommend adding the Gradle wrapper validation check immediately after checkout in any workflow that may run a Gradle wrapper. This eliminates the risk of potentially running a bad wrapper at all in any workflow. For example:

name: Build
on: [ push, pull_request ]

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: gradle/wrapper-validation-action@v1
      - uses: gradle/gradle-build-action@v2
      - run: ./gradlew clean build

@JLLeitschuh
Copy link
Contributor

I think the biggest thing blocking this from happening is that currently Gradle doesn't publish wrapper SHAs for SNAPSHOT releases. As such, projects like gradle/gradle can't use the verification action because it is regularly using pre-release builds to build Gradle.

@bigdaz bigdaz transferred this issue from gradle/gradle-build-action Feb 1, 2024
@JLLeitschuh
Copy link
Contributor

@bigdaz this looks like it may be possible now that Gradle publishes snapshot checksums, right?

@bigdaz bigdaz changed the title Automatically perform wrapper validation check Automatically perform wrapper validation check in setup-gradle Feb 9, 2024
@leonard84
Copy link
Member

I think the biggest thing blocking this from happening is that currently Gradle doesn't publish wrapper SHAs for SNAPSHOT releases. As such, projects like gradle/gradle can't use the verification action because it is regularly using pre-release builds to build Gradle.

If they are still not published, this could easily be mitigated by introducing a switch to disable wrapper validation for SNAPSHOT versions or completely. However, having validation enabled by default would make everyone safer.

@bigdaz bigdaz self-assigned this Apr 11, 2024
@bigdaz bigdaz removed their assignment Apr 11, 2024
@bigdaz bigdaz self-assigned this Jul 19, 2024
@bigdaz bigdaz removed their assignment Jul 19, 2024
@bigdaz bigdaz added this to the v4.0.0 milestone Jul 22, 2024
bigdaz added a commit that referenced this issue Aug 1, 2024
- Add 'allow-snapshot-wrappers' input parameter
- Default 'validate-wrappers' to 'true'

Fixes #12
bigdaz added a commit that referenced this issue Aug 1, 2024
- Add 'allow-snapshot-wrappers' input parameter
- Default 'validate-wrappers' to 'true'

Fixes #12
bigdaz added a commit that referenced this issue Aug 1, 2024
- Add 'allow-snapshot-wrappers' input parameter
- Default 'validate-wrappers' to 'true'

Fixes #12
@bigdaz bigdaz closed this as completed in b644be6 Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants