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

Added the Remote cache experiments for transforms script #1428

Merged
merged 10 commits into from
Sep 18, 2024

Conversation

ribafish
Copy link
Member

Based on this gist and discussed in the slack thread.

I can also remove the description on how to run the script with select transforms if that's what we want.

@ribafish ribafish requested a review from a team September 12, 2024 14:42
Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors

'shellcheck -a -x' returned error 1 finding the following syntactical issues:

----------

In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 43:
./gradlew $task -g $homeDir -Dscan.tag.remote-cache-experiment-init --no-configuration-cache -Ddevelocity.deprecation.muteWarnings=true -Dscan.uploadInBackground=false -Ddevelocity.url=$develocityUrl
          ^---^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
./gradlew "$task" -g $homeDir -Dscan.tag.remote-cache-experiment-init --no-configuration-cache -Ddevelocity.deprecation.muteWarnings=true -Dscan.uploadInBackground=false -Ddevelocity.url=$develocityUrl


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 80:
        ./gradlew $task -g $homeDir --no-configuration-cache -Ddevelocity.deprecation.muteWarnings=true -Dscan.uploadInBackground=false -Ddevelocity.url=$develocityUrl $args
                  ^---^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                                                                                                        ^---^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        ./gradlew "$task" -g $homeDir --no-configuration-cache -Ddevelocity.deprecation.muteWarnings=true -Dscan.uploadInBackground=false -Ddevelocity.url=$develocityUrl "$args"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors
shfmt checking is disabled.

Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors

'shellcheck -a -x' returned error 1 finding the following syntactical issues:

----------

In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 80:
        ./gradlew "$task" -g $homeDir --no-configuration-cache -Ddevelocity.deprecation.muteWarnings=true -Dscan.uploadInBackground=false -Ddevelocity.url=$develocityUrl $args
                                                                                                                                                                          ^---^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
        ./gradlew "$task" -g $homeDir --no-configuration-cache -Ddevelocity.deprecation.muteWarnings=true -Dscan.uploadInBackground=false -Ddevelocity.url=$develocityUrl "$args"

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors
shfmt checking is disabled.

Copy link
Member

@clayburn clayburn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one documentation nitpick. Please consider approved once you add that.

transforms-caching-experiment/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors

'shellcheck -a -x' returned error 1 finding the following syntactical issues:

----------

In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 8:
major=$(echo $gradleVersion | cut -d. -f1)
             ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
major=$(echo "$gradleVersion" | cut -d. -f1)


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 9:
minor=$(echo $gradleVersion | cut -d. -f2)
             ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
minor=$(echo "$gradleVersion" | cut -d. -f2)


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 12:
if [ $major -lt 8 ] || ([ $major -eq 8 ] && [ $minor -lt 9 ]); then
     ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                       ^-- SC2235 (style): Use { ..; } instead of (..) to avoid subshell overhead.
                          ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                              ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if [ "$major" -lt 8 ] || ([ "$major" -eq 8 ] && [ "$minor" -lt 9 ]); then


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 28:
mkdir -p $homeDir/caches/$gradleVersion/
                         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
mkdir -p $homeDir/caches/"$gradleVersion"/


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 30:
cp -r ~/.gradle/caches/$gradleVersion/generated-gradle-jars $homeDir/caches/$gradleVersion/
                       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                            ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cp -r ~/.gradle/caches/"$gradleVersion"/generated-gradle-jars $homeDir/caches/"$gradleVersion"/

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
  https://www.shellcheck.net/wiki/SC2235 -- Use { ..; } instead of (..) to av...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors
shfmt checking is disabled.

Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors

'shellcheck -a -x' returned error 1 finding the following syntactical issues:

----------

In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 8:
major=$(echo $gradleVersion | cut -d. -f1)
             ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
major=$(echo "$gradleVersion" | cut -d. -f1)


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 9:
minor=$(echo $gradleVersion | cut -d. -f2)
             ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
minor=$(echo "$gradleVersion" | cut -d. -f2)


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 12:
if [ $major -lt 8 ] || ([ $major -eq 8 ] && [ $minor -lt 9 ]); then
     ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                       ^-- SC2235 (style): Use { ..; } instead of (..) to avoid subshell overhead.
                          ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                              ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if [ "$major" -lt 8 ] || ([ "$major" -eq 8 ] && [ "$minor" -lt 9 ]); then


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 28:
mkdir -p $homeDir/caches/$gradleVersion/
                         ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
mkdir -p $homeDir/caches/"$gradleVersion"/


In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 30:
cp -r ~/.gradle/caches/$gradleVersion/generated-gradle-jars $homeDir/caches/$gradleVersion/
                       ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                            ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
cp -r ~/.gradle/caches/"$gradleVersion"/generated-gradle-jars $homeDir/caches/"$gradleVersion"/

For more information:
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
  https://www.shellcheck.net/wiki/SC2235 -- Use { ..; } instead of (..) to av...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors
shfmt checking is disabled.

Copy link
Contributor

sh-checker report

To get the full details, please check in the job output.

shellcheck errors

'shellcheck -a -x' returned error 1 finding the following syntactical issues:

----------

In transforms-caching-experiment/remote-cache-experiment-transforms.sh line 12:
if [ "$major" -lt 8 ] || ([ "$major" -eq 8 ] && [ "$minor" -lt 9 ]); then
                         ^-- SC2235 (style): Use { ..; } instead of (..) to avoid subshell overhead.

For more information:
  https://www.shellcheck.net/wiki/SC2235 -- Use { ..; } instead of (..) to av...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors
shfmt checking is disabled.

Copy link
Member

@erichaagdev erichaagdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Just a few more questions / nits.

transforms-caching-experiment/README.md Outdated Show resolved Hide resolved
transforms-caching-experiment/README.md Outdated Show resolved Hide resolved
transforms-caching-experiment/README.md Outdated Show resolved Hide resolved
transforms-caching-experiment/README.md Outdated Show resolved Hide resolved
transforms-caching-experiment/README.md Show resolved Hide resolved
ribafish and others added 2 commits September 16, 2024 13:21
Co-authored-by: Eric Haag <ehaag@gradle.com>
Signed-off-by: Gašper Kojek <gkojek@gradle.com>
Copy link
Member

@erichaagdev erichaagdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 more things.

transforms-caching-experiment/README.md Outdated Show resolved Hide resolved
…daemon java processes. This should be safer, while still working the same way in my tests
…ipt, as that's not needed anymore since we're running with --no-daemon
@ribafish ribafish merged commit f266fca into main Sep 18, 2024
2 checks passed
@ribafish ribafish deleted the gk/transformCachingExperiment branch September 18, 2024 06:57
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.

4 participants