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

[Feature] Support Resolving Extension Repo References #30

Open
iamnande opened this issue Sep 21, 2022 · 4 comments
Open

[Feature] Support Resolving Extension Repo References #30

iamnande opened this issue Sep 21, 2022 · 4 comments

Comments

@iamnande
Copy link

Howdy 👋🏻,

When referencing an v1alpha1.extension, using load(), that comes from an v1alpha1.extension_repo I am receiving:

loading extension env_args: no extension tiltfile found at /Users/iamnande/Library/Application Support/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions/env_args/Tiltfile

Example block that can produce the error:

## Extensions
v1alpha1.extension_repo('foo', url='https://github.com/iamnande/foo/tilt-extensions')
v1alpha1.extension(name='bar', repo_name='foo', repo_path='bar')
load('ext://bar', 'do_cool_thing')

It would be neat if it either didn't yell at me or if it resolved the extension.

Running tilt up in any form handles all the custom references just fine so no actual workflow is being impeded.

@nicksieger
Copy link
Member

I can think of a couple questions/issues here.

  1. For this to work reliably, I think we'd have to assume that you have Tilt already running with this Tiltfile. Then we can query Tilt's API for all registered extension_repos and extensions in order to resolve the file paths. Would that be ok?
  2. If Tilt isn't available, should the diagnostic be a warning instead of an error? Should we have a config setting to turn off errors or warnings about unknown or missing extensions?

@iamnande
Copy link
Author

I can think of a couple questions/issues here.

  1. For this to work reliably, I think we'd have to assume that you have Tilt already running with this Tiltfile. Then we can query Tilt's API for all registered extension_repos and extensions in order to resolve the file paths. Would that be ok?

I think this would definitely be reasonable. There's likely a few integrations required, not available in vsc, in order to effectively resolve the extensions.

  1. If Tilt isn't available, should the diagnostic be a warning instead of an error? Should we have a config setting to turn off errors or warnings about unknown or missing extensions?

A configuration to ignore these would be helpful or maybe extension_repos and extensions can be warnings by default?

@flamein
Copy link

flamein commented Sep 29, 2023

As a dirty workaround, you can symlink your extension in the tilt-dev repo /Users/$USER/Library/Application Support/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions

cd /Users/$USER/Library/Application Support/tilt-dev/tilt_modules/github.com/tilt-dev/tilt-extensions
ln -s ../../user/tilt-extensions/<extension>

Don't tell people I told you to do this :trollface:

@gayanper
Copy link

gayanper commented Jul 1, 2024

I would recommend we don't show errors for custom repos until a Tilt is running for this file. I assume the LS is parsing the file which might be able to figure out which entries are part of custom repositories by their names. That would work really neatly.

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

No branches or pull requests

4 participants