Lage returns exit code 0 on failure in workspace-tools
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 816
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
When using lage without a master branch, it will fail, because workspace-tools can't find the hard coded master branch...
I have a fix for that, but this issue tracks the fact that lage exist with exit code 0 instead of a non-zero one causing validation pipelines to succeed in this step.
Hopefully failing later and not continuing thinking all is good :)
yarn run v1.22.10
$ lage build
info Lage task runner - let's make it
(node:24264) UnhandledPromiseRejectionWarning: Error: fatal: ambiguous argument 'origin/master...': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
at Object.getBranchChanges (D:\src\azure-devops-symbols\node_modules\workspace-tools\lib\git.js:126:15)
at Object.getChangedPackages (D:\src\azure-devops-symbols\node_modules\workspace-tools\lib\workspaces\getChangedPackages.js:33:23)
at Object.getWorkspace (D:\src\azure-devops-symbols\node_modules\lage\lib\workspace\getWorkspace.js:16:44)
at Object.run (D:\src\azure-devops-symbols\node_modules\lage\lib\command\run.js:14:38)
at Object.<anonymous> (D:\src\azure-devops-symbols\node_modules\lage\lib\index.js:28:19)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
(node:24264) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:24264) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Done in 0.96s.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported yarn run lage build failure in a workspace without a master branch. Start with lage/lib/index.js and lage/lib/command/run.js, following the rejection from workspace-tools/lib/git.js and getChangedPackages.js; done means the failed operation causes a non-zero process exit code instead of reporting success.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100