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

Fail workflow at the first colcon list if a bad package name is specified #486

Merged

Conversation

emersonknapp
Copy link
Contributor

@emersonknapp emersonknapp commented Dec 30, 2020

Fixes #364

By adding the -o pipefail option to all bash commands, we can intercept failures properly, as in the following case when a bad package name is provided. This causes the workflow to exit at this point, rather than waiting all the way until colcon build

		await execBashCommand(
			`diff --new-line-format="" --unchanged-line-format="" <(colcon list -p) <(colcon list --packages-up-to ${packageNameList.join(
				" "
			)} -p) | xargs rm -rf`,
			undefined,
			options
		);

@emersonknapp emersonknapp force-pushed the emersonknapp/fail-immediately-on-command-failure branch from f5c5aab to 5b02e82 Compare December 30, 2020 02:05
@codecov
Copy link

codecov bot commented Dec 30, 2020

Codecov Report

Merging #486 (d26ce20) into master (c3241c6) will decrease coverage by 1.80%.
The diff coverage is 7.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #486      +/-   ##
==========================================
- Coverage   37.85%   36.05%   -1.81%     
==========================================
  Files           1        1              
  Lines         140      147       +7     
  Branches       29       29              
==========================================
  Hits           53       53              
- Misses         87       94       +7     
Impacted Files Coverage Δ
src/action-ros-ci.ts 36.05% <7.14%> (-1.81%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3241c6...d26ce20. Read the comment docs.

@emersonknapp emersonknapp changed the title Fail whole workflow immediately on bash command failure (e.g. colcon list) Fail executed bash command pipes when one command fails Dec 31, 2020
@emersonknapp emersonknapp force-pushed the emersonknapp/fail-immediately-on-command-failure branch 2 times, most recently from d7352f2 to 7ccd0ff Compare December 31, 2020 00:38
@emersonknapp emersonknapp changed the title Fail executed bash command pipes when one command fails Fail workflow at the first colcon list if a bad package name is specified Dec 31, 2020
@emersonknapp emersonknapp force-pushed the emersonknapp/fail-immediately-on-command-failure branch from 2988f82 to 8e956e0 Compare December 31, 2020 22:33
@emersonknapp emersonknapp marked this pull request as ready for review January 2, 2021 04:51
@emersonknapp emersonknapp requested a review from a team as a code owner January 2, 2021 04:51
@emersonknapp emersonknapp requested review from thomas-moulard and jaisontj and removed request for a team January 2, 2021 04:51
@emersonknapp emersonknapp force-pushed the emersonknapp/fail-immediately-on-command-failure branch from 4f2e39d to c3241c6 Compare January 4, 2021 18:40
… a bad package name was specified

Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp emersonknapp reopened this Jan 4, 2021
@emersonknapp emersonknapp force-pushed the emersonknapp/fail-immediately-on-command-failure branch from a8b9e2a to dfb447d Compare January 4, 2021 20:02
Signed-off-by: Emerson Knapp <eknapp@amazon.com>
@emersonknapp emersonknapp merged commit c2e4245 into master Jan 4, 2021
@emersonknapp emersonknapp deleted the emersonknapp/fail-immediately-on-command-failure branch January 4, 2021 21:49
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.

Failure of colcon list does not stop the action
1 participant