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

Log stdout and stderr from plugin installation and removal #1682

Merged
merged 8 commits into from
Nov 13, 2024

Conversation

emlys
Copy link
Member

@emlys emlys commented Nov 11, 2024

Description

Fixes #1673
Fixes #1665

Stdout and stderr from subprocesses involved in plugin install/uninstall are now logged. They continue to show up in the terminal in dev mode, and now also appear in the workbench log in dev and production mode. Plugin installation errors are no longer displayed in the UI, but a message is shown pointing to the workbench log.

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
  • Updated the user's guide (if needed)
  • Tested the Workbench UI (if relevant)

@emlys emlys requested a review from dcdenu4 November 11, 2024 19:55
@emlys emlys self-assigned this Nov 11, 2024
Copy link
Member

@dcdenu4 dcdenu4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @emlys ! The async chaining approach makes sense to me and reads okay too. I had one documentation question.

I'm also curious, now that this is asynchronous, is the user able to close out of the plugin modal while the process is running? I feel like a common thing might be for a user to want to continue working on other things while the plugin loads and get back to the main Workbench window. Nothing needed to address in this PR, just thinking ahead.

@@ -11,59 +11,98 @@ import { settingsStore } from './settingsStore';

const logger = getLogger(__filename.split('/').slice(-1)[0]);

function spawnWithLogging(cmd, args, options) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this function have a docstring above it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a docstring

@emlys
Copy link
Member Author

emlys commented Nov 12, 2024

@dcdenu4 it is possible to close the plugin modal and the plugin install keeps running in the background. There are probably some possible UX improvements to that situation but it does seem to work

@emlys emlys requested a review from dcdenu4 November 12, 2024 22:40
await spawnWithLogging(
'git',
['clone', '--depth', '1', '--no-checkout', pluginURL, tmpPluginDir]
).then(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emlys , forgive me for popping in here. I don't think we need the .then chaining now that we're using await and resolving the promise when the spawn process closes. I think you should just be able to do like this,

await spawnWithLoggin('git clone ...');
await spawnWithLogging('git checkout ...');
...

Copy link
Member

@dcdenu4 dcdenu4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @emlys, I'll add my approval since I'll be offline for most of today. But note @davemfish comment!

@emlys emlys requested a review from davemfish November 13, 2024 19:55
Copy link
Contributor

@davemfish davemfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@davemfish davemfish merged commit b7c7a14 into natcap:feature/plugins Nov 13, 2024
29 checks passed
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.

3 participants