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

🚧 Dev ➾ Handle installation of non-existent plugin #1692

Open
1 of 7 tasks
mweichert opened this issue Jan 3, 2023 · 0 comments
Open
1 of 7 tasks

🚧 Dev ➾ Handle installation of non-existent plugin #1692

mweichert opened this issue Jan 3, 2023 · 0 comments
Labels
dev-task Tasks for the Taqueria Dev Board
Milestone

Comments

@mweichert
Copy link
Collaborator

πŸ”— Epic|Feature Link

No response

πŸš₯ Definition of Done

  • 🎯 Planning and Design
  • 🏎️ Dev Implementation Complete
  • ♾️ PR Merged
  • πŸ† Product Acceptance

🧰 Work Description

When npm install fails as part of taq install, we don't capture or process the failure and just assume that the plugin was installed successfully.

For instance, if you run taq install thecatcameback we will assume that npm install completed successfully, and then try to read the package.json of the plugin to get its valid package name which fails and produces this error:

Could not read /Users/mweichert/Projects/test-project/node_modules/thecatcameback/package.json

The taq install thecatcameback task will return exit code 9, as this line will be triggered in our error response logic:

.with({ kind: 'E_READFILE' }, err => [9, err.msg])

βœ… To Do

We should check the status code of the npm install command and if non-zero, throw a new TaqError of kind 'E_INSTALL_PLUGINand then handle that in ourdisplayError` function in cli.ts.

We can then unskip this test in taqueria-cli-e2e-smoke-spec.ts:

test.skip('install a package that does not exist will  error', async () => {
		const { execute, cleanup, spawn } = await prepareEnvironment();
		const { waitForText } = await spawn('taq', 'init test-project --debug');
		await waitForText("Project taq'ified!");
		const { code } = await execute('taq', 'install acoupleofecadhamburgers -p foobar');
		expect(code).toBe(1);
		await cleanup();
	});

βš–οΈ Acceptance Criteria

✨ Functional:

  • Running taq install thecatcameback should return a exit code and display an appropriate error message
  • The install a package that does not exist will error test is unskipped and working

πŸ”­ Scope

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mweichert mweichert added the dev-task Tasks for the Taqueria Dev Board label Jan 3, 2023
@egarson egarson changed the title 🚧 Dev ➾ Handle installation of invalid plugin names 🚧 Dev ➾ Handle installation of non-existent plugin Jan 4, 2023
@egarson egarson added this to the M4 milestone Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-task Tasks for the Taqueria Dev Board
Projects
None yet
Development

No branches or pull requests

2 participants