danger-js icon indicating copy to clipboard operation
danger-js copied to clipboard

Fix: Enable exception mode to skip scripts on first error

Open glensc opened this issue 4 years ago • 6 comments

Replaces https://github.com/danger/danger-js/pull/1254

Noticed that "danger:prepush" ran commands with ";" rather "&&" meaning the next command is still executed if the previous one failed. This resulted in very weird errors due to the previous step failure.

Now, aborts of first error:

➜ yarn danger:prepush
yarn run v1.22.17
$ set -e; yarn build:fast; yarn test:fixtures; node distribution/commands/danger.js local --base main --dangerfile dangerfile.lite.ts
$ tsc -p tsconfig.production.json
source/commands/ci/runner.ts:70:30 - error TS2339: Property 'publishCheck' does not exist on type 'SharedCLI'.
...
➜ 

glensc avatar Mar 18 '22 08:03 glensc

I'm wary about this breaking on Windows - have you tried it there? The CI doesn't look to be running any of these commands

orta avatar Mar 29 '22 15:03 orta

Using "; " separator is not new. Some scripts already used those. And I do not have any windows platform access.

glensc avatar Mar 29 '22 15:03 glensc

Same problem in other projects in this organization:

  • https://github.com/danger/peril/issues/502

glensc avatar May 03 '22 20:05 glensc

Ersetzt#1254

Es wurde bemerkt, dass "danger:prepush" Befehle mit ";" anstelle von "&&" ausführte, was bedeutet, dass der nächste Befehl immer noch ausgeführt wird, wenn der vorherige fehlgeschlagen ist. Dies führte zu sehr seltsamen Fehlern aufgrund des Fehlers des vorherigen Schritts.

Nun wird der erste Fehler abgebrochen:

➜ yarn danger:prepush
yarn run v1.22.17
$ set -e; yarn build:fast; yarn test:fixtures; node distribution/commands/danger.js local --base main --dangerfile dangerfile.lite.ts
$ tsc -p tsconfig.production.json
source/commands/ci/runner.ts:70:30 - error TS2339: Property 'publishCheck' does not exist on type 'SharedCLI'.
...
➜ 

Jimimaku avatar Nov 21 '22 23:11 Jimimaku

@Jimimaku English please.

glensc avatar Nov 21 '22 23:11 glensc

@glensc I believe @Jimimaku is using some sort of native application, or browser extension, and it's barfing all over the GitHub repo. I think that's literally a translation of your issue summary.

We may need to block Jimimaku from this repo if they don't stop polluting.

fbartho avatar Nov 21 '22 23:11 fbartho