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

Retain pre-existing remote build cache config #680

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gabrielfeo
Copy link
Member

Retain pre-existing remote cache configuration when setting the cache path, by never replacing an existing cache. Also support using the Develocity connector and warn in case the build has a custom cache type, for which the script cannot set the cache path.

Closes #507

@gabrielfeo gabrielfeo force-pushed the gaf/support-authenticated-build-cache branch from af19e10 to 88de0b7 Compare November 12, 2024 20:16
@gabrielfeo
Copy link
Member Author

Hi! This is a suggested fix for that issue. If you decide to accept this, I've only tested it briefly, because I saw in other PRs that you have many workflows that can test it better.

@erichaagdev
Copy link
Member

Hi, @gabrielfeo. 👋

Thank you very much for your continued interest in improving the Develocity Build Validation Scripts.

What makes this more challenging is we must also continue to support the Gradle Enterprise plugin.

Prior to invoking the build, we call the Develocity API to query for several custom values in order to "recreate" the build as it was run in CI. This includes values like the repository, commit ID, branch, etc. You can see the full list here.

https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/17e8857bdbee720fe5ff4732f7f667d80fb94a03/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh#L162-L180

How I've always wanted to handle this is by updating the API call to return the configured remote build cache type. This is visible in a build scan and available in the Develocity API. The remote build cache can be configured accordingly from there. Unfortunately, the API client used by the scripts is closed source so this couldn't be implemented by an external contributor.

That being said, I will go ahead and leave this PR open to be discussed with the team.

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.

Build Validation Scripts do not retain GE-specific remote cache config
2 participants