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

[BUG] CI doesn't fail anymore if gradlew build fails #60

Closed
rursprung opened this issue Sep 11, 2023 · 3 comments · Fixed by #76
Closed

[BUG] CI doesn't fail anymore if gradlew build fails #60

rursprung opened this issue Sep 11, 2023 · 3 comments · Fixed by #76
Labels
bug Something isn't working

Comments

@rursprung
Copy link
Contributor

rursprung commented Sep 11, 2023

What is the bug?

if gradlew build fails, the CI still happily continues and doesn't fail the build.

How can one reproduce the bug?

cause e.g. the javadoc task to fail. as a real-world example see the windows build of aparo/opensearch-analysis-ik#25: https://github.com/aparo/opensearch-analysis-ik/actions/runs/6143965464/job/16668432218?pr=25

What is the expected behavior?

if gradlew build fails the CI must fail

What is your host/environment?

n/a

Do you have any screenshots?

n/a

Do you have any additional context?

this was introduced in #31 by @prudhvigodithi. the problem is that there's another command coming after it, but the two are not joined by && and no other mechanism is employed to cause the script to fail whenever any single step fails (e.g. using set -e):

./gradlew build
# Generated by 'opensearch.pluginzip' custom gradle plugin
./gradlew publishPluginZipPublicationToZipStagingRepository

the simplest option however would probably be to just run ./gradlew build publishPluginZipPublicationToZipStagingRepository

(and why is check not called in the CI?)

@dblock
Copy link
Member

dblock commented Jun 6, 2024

[Triage -- attendees 1, 2, 3, 4, 5, 6, 7]

@rursprung Is this still an issue?

@dblock dblock removed the untriaged label Jun 6, 2024
@dblock
Copy link
Member

dblock commented Jun 6, 2024

@reta says it's fixed

@dblock dblock closed this as completed Jun 6, 2024
@rursprung
Copy link
Contributor Author

i doubt that it's fixed - the CI script hasn't changed, so if the first command fails the second will still be executed and the CI step success then only depends on that.

rursprung added a commit to rursprung/opensearch-plugin-template-java that referenced this issue Jun 11, 2024
right now `./gradlew build` could fail but the script would still go on
(because neither `set -e` is set nor `&&` is used to run both commands
together).

the easiest solution is to just run both gradle target in one go as one
anyway depends on the other - there's no need to start gradle twice.
this will also make the runs ever so slightly faster.

fixes opensearch-project#60

Signed-off-by: Ralph Ursprung <[email protected]>
rursprung added a commit to rursprung/opensearch-plugin-template-java that referenced this issue Jun 11, 2024
right now `./gradlew build` could fail but the script would still go on
(because neither `set -e` is set nor `&&` is used to run both commands
together).

the easiest solution is to just run both gradle target in one go as one
anyway depends on the other - there's no need to start gradle twice.
this will also make the runs ever so slightly faster.

fixes opensearch-project#60

Signed-off-by: Ralph Ursprung <[email protected]>
rursprung added a commit to rursprung/opensearch-plugin-template-java that referenced this issue Jun 11, 2024
right now `./gradlew build` could fail but the script would still go on
(because neither `set -e` is set nor `&&` is used to run both commands
together).

running it in two steps gives more visibilty to which step is failing.
note that `publishPluginZipPublicationToZipStagingRepository` is tested
explicitly to ensure that this step works as it has previously failed.

fixes opensearch-project#60

Signed-off-by: Ralph Ursprung <[email protected]>
rursprung added a commit to rursprung/opensearch-plugin-template-java that referenced this issue Jun 11, 2024
right now `./gradlew build` could fail but the script would still go on
(because neither `set -e` is set nor `&&` is used to run both commands
together).

running it in two steps gives more visibilty to which step is failing.
note that `publishPluginZipPublicationToZipStagingRepository` is tested
explicitly to ensure that this step works as it has previously failed.

fixes opensearch-project#60

Signed-off-by: Ralph Ursprung <[email protected]>
rursprung added a commit to rursprung/opensearch-plugin-template-java that referenced this issue Jun 11, 2024
right now `./gradlew build` could fail but the script would still go on
(because neither `set -e` is set nor `&&` is used to run both commands
together).

running it in two steps gives more visibilty to which step is failing.
note that `publishPluginZipPublicationToZipStagingRepository` is tested
explicitly to ensure that this step works as it has previously failed.

fixes opensearch-project#60

Signed-off-by: Ralph Ursprung <[email protected]>
rursprung added a commit to rursprung/opensearch-plugin-template-java that referenced this issue Jun 11, 2024
right now `./gradlew build` could fail but the script would still go on
(because neither `set -e` is set nor `&&` is used to run both commands
together).

running it in two steps gives more visibilty to which step is failing.
note that `publishPluginZipPublicationToZipStagingRepository` is tested
explicitly to ensure that this step works as it has previously failed.

fixes opensearch-project#60

Signed-off-by: Ralph Ursprung <[email protected]>
rursprung added a commit to rursprung/opensearch-plugin-template-java that referenced this issue Jun 11, 2024
right now `./gradlew build` could fail but the script would still go on
(because neither `set -e` is set nor `&&` is used to run both commands
together).

running it in two steps gives more visibilty to which step is failing.
note that `publishPluginZipPublicationToZipStagingRepository` is tested
explicitly to ensure that this step works as it has previously failed.

fixes opensearch-project#60

Signed-off-by: Ralph Ursprung <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants