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

feat: Just-in-time plugin installation #8482

Open
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

ReubenFrankel
Copy link
Contributor

@ReubenFrankel ReubenFrankel commented Apr 6, 2024

Implements just-in-time install for the following commands:

  • invoke
  • run
  • el/elt
  • test
  • config <plugin> test
  • select --list

Copy link

netlify bot commented Apr 6, 2024

Deploy Preview for meltano canceled.

Name Link
🔨 Latest commit ba9a469
🔍 Latest deploy log https://app.netlify.com/sites/meltano/deploys/66733bd00eedf80008ae3a41

Copy link

codecov bot commented Apr 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.06%. Comparing base (a396e3b) to head (ba9a469).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8482      +/-   ##
==========================================
+ Coverage   92.01%   92.06%   +0.05%     
==========================================
  Files         246      246              
  Lines       19380    19441      +61     
  Branches     3419     3436      +17     
==========================================
+ Hits        17833    17899      +66     
+ Misses       1271     1267       -4     
+ Partials      276      275       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ReubenFrankel
Copy link
Contributor Author

We probably want to suppress install progress to stdout from meltano.cli.utils.install_plugins here, or emit as logs to stderr... For invoke, this currently breaks the common tap/target debugging technique of

meltano invoke <tap> > tap.out
cat tap.out | meltano invoke <target>

@edgarrmondragon
Copy link
Collaborator

edgarrmondragon commented Apr 8, 2024

We probably want to suppress install progress to stdout from meltano.cli.utils.install_plugins here, or emit as logs to stderr... For invoke, this currently breaks the common tap/target debugging technique of

meltano invoke <tap> > tap.out
cat tap.out | meltano invoke <target>

Yeah, I'd be more than OK with starting to unify our output away from click.echo and into the logging framework.

@ReubenFrankel
Copy link
Contributor Author

ReubenFrankel commented Apr 15, 2024

Think I have covered all relevant commands here. Wondering if we want a new --no-install option for these (same convention as for meltano add) to opt-out of auto-install behaviour (e.g. for CI), or stick to the original proposal in #2089:

Interactive (TTY) experience

If a tty is available, we can simply ask the user if they'd like to auto-install the missing plugins.

Updated error message with hints

If a TTY is not available and --install is not specified, then the error message would be changed to something like:

ERROR: Plugin not installed. Please install with meltano install ... or rerun with meltano invoke --install ....

Why require confirmation / opt-in

Install operations are not always safe to run, and they can hide other issues in the invocation or installation, such as using the wrong plugin name or the wrong base image in a scheduled job. They could also trigger unnecessarily for a container-backed spec that doesn't require installation.

I haven't yet addressed install progress/status as logs, but the output is suppressed for meltano invoke for now.

@ReubenFrankel
Copy link
Contributor Author

ReubenFrankel commented Apr 28, 2024

Should this be added for select too?

@edgarrmondragon
Copy link
Collaborator

Should this be added for select too?

If it's opt-in, probably yes 👍

@ReubenFrankel ReubenFrankel marked this pull request as ready for review June 1, 2024 00:53
src/meltano/cli/select.py Outdated Show resolved Hide resolved
src/meltano/cli/select.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants