Open vlsi opened 4 years ago
@vlsi Would you be willing to provide a PR for this?
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.
Actually, the configParams
are converted into a sorted map: https://github.com/gradle/gradle/blob/e062ebdca9c7823c27af45c8d92975d340fee853/subprojects/core/src/main/java/org/gradle/caching/internal/services/BuildCacheControllerFactory.java#L161
So the order is not random at all. Does that mean we can close this issue?
Should it better preserve the order of the original arguments?
@vlsi Can you explain why you think order preserving would be better? What would you use this for?
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.
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.
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
: https://github.com/gradle/gradle/blob/07405078c1ebfadf0ae86d1fcfd734b151cfd5cf/subprojects/core/src/main/java/org/gradle/caching/internal/services/BuildCacheControllerFactory.java#L248Context
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