-
Notifications
You must be signed in to change notification settings - Fork 69
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
Enable offline install of labs projects #2049
base: main
Are you sure you want to change the base?
Conversation
An authorized user can trigger integration tests manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
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.
lgtm
@@ -9,7 +9,7 @@ | |||
], | |||
"go.useLanguageServer": true, | |||
"gopls": { | |||
"formatting.gofumpt": true | |||
"formatting.gofumpt": true |
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.
Please revert.
@@ -15,15 +15,15 @@ import ( | |||
) | |||
|
|||
type installable interface { | |||
Install(ctx context.Context) error | |||
Install(ctx context.Context, offlineInstall bool) error |
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.
This should be a property on the installable, not a function argument.
} | ||
|
||
type devInstallation struct { | ||
*Project | ||
*cobra.Command | ||
} | ||
|
||
func (d *devInstallation) Install(ctx context.Context) error { | ||
func (d *devInstallation) Install(ctx context.Context, offlineInstall bool) error { |
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.
For example, not needed here.
@@ -54,7 +54,7 @@ func (d *devInstallation) Install(ctx context.Context) error { | |||
return d.Installer.runHook(d.Command) | |||
} | |||
|
|||
func NewInstaller(cmd *cobra.Command, name string) (installable, error) { | |||
func NewInstaller(cmd *cobra.Command, name string, offlineInstall bool) (installable, error) { |
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.
The bool should be a property on the installer
struct.
Changes
This PR makes changes to labs code base to allow for offline install of labs project (like UCX). by passing a flag --offline-install=true, the code will skip checking for project versions, and downloading code from github and instead will look from local installation folder. It is expected that the user will download and copy the code from other machine where it can install labs project and then run installation on the machine which has internet restriction.
Closes #1646
related to databrickslabs/ucx#3418
Tests
Added unit test case and tested.