gradle / gradle-enterprise-build-validation-scripts

Executable scripts to assist in validating that your Gradle and Maven builds are in an optimal state in terms of maximizing work avoidance when using Develocity.
https://gradle.com/develocity
Apache License 2.0
76 stars 23 forks source link

Receipt files should be named deterministicly #620

Open erichaagdev opened 1 month ago

erichaagdev commented 1 month ago

Currently, experiment receipt files are named <short_experiment_name>-<buld_tool>-<timestamp>.receipt.

I see little value in having such an elaborate naming scheme and it makes automation scenarios slightly more challenging.

Instead, the receipt files should be named consistently across all experiments and build tools, like experiment.receipt.

This would make finding the receipt file much easier. For example:

cat .data/01-validate-incremental-building/latest/experiment.receipt

Would always print the receipt for the most recent invocation of experiment 1.

If #619 were implemented, then:

cat .data/latest/experiment.receipt

Would always get you the receipt of the most recent invocation across all experiments.

erichaagdev commented 1 month ago

As a workaround, you can use * to get the receipt. For example::

cat .data/01-validate-incremental-building/latest/*.receipt

This will print the receipt for the most recent invocation of experiment 1.

This is the approach taken by the composite actions:

https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/507feefc46bd116db189e54b34d96b5793494e66/.github/actions/gradle/experiment-1/action.yml#L101

While a simple workaround, it may not be obvious to everyone.