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 38 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 request for meltano pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 46707f0

Copy link

codecov bot commented Apr 6, 2024

Codecov Report

Attention: Patch coverage is 99.28058% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 91.86%. Comparing base (7129516) to head (46707f0).
Report is 3 commits behind head on main.

Files Patch % Lines
src/meltano/cli/select.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8482      +/-   ##
==========================================
+ Coverage   91.81%   91.86%   +0.05%     
==========================================
  Files         245      245              
  Lines       19296    19357      +61     
  Branches     2152     2156       +4     
==========================================
+ Hits        17717    17783      +66     
+ Misses       1306     1302       -4     
+ Partials      273      272       -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
@@ -85,7 +88,7 @@ async def select(
"""
try:
if flags["list"]:
await show(project, extractor, show_all=flags["all"])
await show(project, extractor, install_plugins, show_all=flags["all"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm happy to ignore missing coverage for this for now. We have an incoming test that'll cover this in #8518.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great! I was about to ask if you wanted a test 😅

Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
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