typegoose / typegoose/mongodb-memory-server
Why do postinstall scripts exit with code 0 on failure?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.8k
- Forks
- 191
- Avg merge
- 4h 25m
- Merged PRs (30d)
- 10
Description
Versions
- NodeJS: 14.15.1
- mongodb-memory-server-*: 6.9.3
- mongodb: 4.4.1
- mongoose: 5.11.15
- system: MacOS
package: mongodb-memory-server
What is your question?
In the postinstall script in mongodb-memory-server, there are a few failure conditions that result in an exit code of 0, for example:
- https://github.com/nodkz/mongodb-memory-server/blob/master/packages/mongodb-memory-server/postinstall.js#L23
- https://github.com/nodkz/mongodb-memory-server/blob/master/packages/mongodb-memory-server/postinstall.js#L54
- https://github.com/nodkz/mongodb-memory-server/blob/master/packages/mongodb-memory-server/postinstall.js#L57
I see related discussion here: https://github.com/nodkz/mongodb-memory-server/issues/131
IMO, the postinstall should not exit with code 0 when the script fails to do what the consumer expects. Presumably, consumers are using the mongodb-memory-server package because they want the postinstall step to happen; if they didn't care about that, then they would use mongodb-memory-server-core, instead. If the postinstall fails, they should be notified with a non-zero exit code; if they don't like that behavior, they can opt for the core package, or we can offer them another way to opt out of that behavior.
What was the reasoning behind exiting with code 0 for failure cases?
Contributor guide
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
Read packages/mongodb-memory-server/postinstall.js at the linked failure cases, then review the discussion in issue 131 and this issue's comments to understand the intended exit behavior. This needs an agreed outcome before implementation; done should include verified postinstall behavior for each failure condition.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100