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

BuildCacheServiceFactory.Describer should preserve the order of config values #14179

Open
vlsi opened this issue Aug 18, 2020 · 7 comments
Open

Comments

@vlsi
Copy link
Contributor

vlsi commented Aug 18, 2020

Expected Behavior

The order of elements should be preserved when calling org.gradle.caching.BuildCacheServiceFactory.Describer#config(String, String) multiple times.

Current Behavior

Gradle shuffles the items as the implementation is using HashMap:

Context

I need to configure multiple remote build caches for Gradle, and the order of the caches is important. Unfortunately, Gradle shuffles the values in Build Scan output which makes the analysis harder.

Your Environment

https://scans.gradle.com/s/ew2s77ylxhif2/performance/buildCache#remote-cache-configuration

@wolfs
Copy link
Member

wolfs commented Sep 1, 2020

@vlsi Would you be willing to provide a PR for this?

@vlsi
Copy link
Contributor Author

vlsi commented Sep 1, 2020

I think I can do that. I know you prefer end-to-end tests, however, I'm not sure I would be able to create one in this case.

@wolfs
Copy link
Member

wolfs commented Sep 1, 2020

Actually, the configParams are converted into a sorted map:

ImmutableSortedMap<String, String> config = ImmutableSortedMap.copyOf(describer.configParams);

So the order is not random at all. Does that mean we can close this issue?

@vlsi
Copy link
Contributor Author

vlsi commented Sep 1, 2020

Should it better preserve the order of the original arguments?

@ldaley
Copy link
Member

ldaley commented Sep 1, 2020

@vlsi Can you explain why you think order preserving would be better? What would you use this for?

@vlsi
Copy link
Contributor Author

vlsi commented Sep 1, 2020

My use case is to create a proxy build cache which is a build cache implementation that delegates the calls to multiple downstream build cache services.

The order of calls is important, so the users see which cache would be requested the first, and which one would be requested later.

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot removed the stale label Jun 2, 2022
@lptr lptr removed the @execution label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants