-
Notifications
You must be signed in to change notification settings - Fork 310
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
tiltfile: use the extension api objects for file loading #5445
Conversation
most of this PR is:
(1) and (2) could probably be a separate PR; they just make less sense in isolation. |
119e28f
to
a27b2aa
Compare
Now, extensions are stored in xdg home instead of being vendored in tilt_modules. You can also change the default extension repo with: ``` v1alpha1.extension_repo(name='default', url='https://github.com/my-org/my-repo', ref='my-tag') ``` at the top of the tiltfile. This should address the following issues: #3188 #3787 #4707 #3426 #5336 #5171
a27b2aa
to
1904e8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few comments to consider
extStatus := e.extReconciler.ForceApply(ext, repoResolved) | ||
if extStatus.Error != "" { | ||
return "", fmt.Errorf("loading extension %s: %s", ext.Name, extStatus.Error) | ||
} else if extStatus.Path == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for else
here as well. it can collapse.
if ext.ObjectMeta.Annotations == nil { | ||
ext.ObjectMeta.Annotations = map[string]string{} | ||
} | ||
ext.ObjectMeta.Annotations[v1alpha1.AnnotationManagedBy] = "tiltfile.loader" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't matter much, but TIL:
func SetMetaDataAnnotation(obj *ObjectMeta, ann string, value string) { |
v1alpha1.extension_repo(name='default', url='file://%s/my-custom-repo') | ||
v1alpha1.extension(name='my-extension', repo_name='default', repo_path='my-custom-path') | ||
|
||
load("ext://my-extension", "printFoo") | ||
printFoo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
includes all the changes from tilt-dev/tilt#5445 on new extension download semantics
includes all the changes from tilt-dev/tilt#5445 on new extension download semantics
I got this output when
It looks like things worked anyway, but the output led me to believe it didn't. |
418f5d7
to
ba76352
Compare
ba76352
to
4f17eeb
Compare
@landism sent you a pr for the other issue! |
includes all the changes from tilt-dev/tilt#5445 on new extension download semantics
* docs: rewrite the extensions guide includes all the changes from tilt-dev/tilt#5445 on new extension download semantics * Update docs/extensions.md Co-authored-by: Nick Sieger <nicksieger@gmail.com> * Update docs/extensions.md Co-authored-by: Nick Sieger <nicksieger@gmail.com> Co-authored-by: Nick Sieger <nicksieger@gmail.com>
Hello @milas, @landism,
Please review the following commits I made in branch nicks/extension:
119e28f (2022-02-03 16:59:23 -0500)
tiltfile: use the extension api objects for file loading
Now, extensions are stored in xdg home instead of being vendored in tilt_modules.
You can also change the default extension repo with:
at the top of the tiltfile.
This should address the following issues:
#3188
#3787
#4707
#3426
#5336
#5171
Code review reminders, by giving a LGTM you attest that: