-
Notifications
You must be signed in to change notification settings - Fork 360
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
import UI implementation #3352
import UI implementation #3352
Conversation
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.
Exciting feature!
Not done going over it yet, but going away for today so dropping my comments.
|
||
<Row className="pt-2 ml-2"> | ||
<DotIcon className="mr-1 mt-1"/> | ||
Or, click to <Button variant="link" onClick={onImport}>Import</Button> from the object store. |
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 the first one.
Also - regarding the "see the docs" one - it doesn't really make sense any more because it leads to the import docs page - so either rephrase the text it to make sense ("learn more bla bla") OR link to another page OR remove it.
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.
Done, combined then together. I think it is imported to reference other ways to import as well.
Still missing the "Test" button to check the connectivity to the import source. |
@johnnyaug Thanks for the great UX comments! |
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.
Sorry for the gradual review.
|
||
try { | ||
importBranchResp = await branches.get(repo.id, importBranch) | ||
} catch (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.
} catch (error){ | |
} catch (error){ |
I think we should verify that the error here is that the branch wasn't found.
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.
Right, the import can also fail if there are uncommitted changes for example.
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.
done
|
||
if (!reference || reference.type !== RefTypeBranch) return <></> | ||
|
||
const checkStorageNamespaceValidity = () => { |
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.
All the mentions "storage namespace" should be changed to something more meaningful.
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.
done
const importBranch = `_${reference.id}_imported`; | ||
const commitMsg = commitMsgRef.current.value; | ||
const sourceRefVal = sourceRef.current.value; | ||
const range_arr = [] |
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.
const range_arr = [] | |
const rangeArr = [] |
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.
done
</Button> | ||
<Button variant="success" disabled={importState.inProgress || !importState.isStorageNamespaceValid} onClick={() => { | ||
if (importState.inProgress) return; | ||
ingest() |
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.
Is this called ingest because import is a reserved keyword?
You can use "doImport"
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.
done
|
||
const UploadButton = ({ config, repo, reference, path, onDone, variant = "success", onClick, onHide, show = false}) => { | ||
const ImportButton = ({ config, repo, reference, path, onDone, onClick, variant = "success", onHide, show = false, enabled= false}) => { |
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.
const ImportButton = ({ config, repo, reference, path, onDone, onClick, variant = "success", onHide, show = false, enabled= false}) => { | |
const ImportButton = ({ config, repo, reference, path, onDone, onClick, variant = "success", onHide, show = false, enabled = false}) => { |
Please format everything (only lines you changed, if possible).
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.
done
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.
Played with it, looks amazing! Added some comments.
let prepend = `${destRef.current.value}`; | ||
let importBranchResp | ||
let sum = importState.numObj | ||
const importBranch = `_${reference.id}_imported`; |
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 might lead to a confusing behaviour. If I'm on the imported branch, let's say _main_imported
, I wouldn't expect to create another branch named __main_imported_imported
. Maybe check for the _
prefix and _imported
prefix, and just use the same branch if they match?
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.
done
webui/src/lib/api/index.js
Outdated
const requestURL = QueryString.stringifyUrl({url: `/repositories/${repoId}/branches/${branchId}/commits`, query: {source_metarange: source_metarange}}); | ||
const parsedURL = QueryString.exclude(requestURL, (name, value) => value === "", {parseNumbers: 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.
Nice one!
return ( | ||
<Container className="m-4 mb-5"> | ||
<h2 className="mt-2">To get started with this repository:</h2> | ||
|
||
<Row className="pt-2 ml-2"> | ||
<DotIcon className="mr-1 mt-1"/> | ||
<Button variant="link" onClick={onUpload}>Upload</Button> an object. | ||
<Button variant="link" onClick={onImport}>Import</Button> data from the object store. Or, see the <a href="https://docs.lakefs.io/setup/import.html" target="_blank" rel="noopener noreferrer">docs</a> for other ways to import data to your repository. |
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.
How hard would it be to replace the object store
from the actual object store name (e.g. S3, GCS, Azure) depending on the lakeFS type? I think it would make it much clearer.
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.
done
{(importState.inProgress) ? (<ImportProgress numObjects={importState.numObj} />) | ||
: ( <> | ||
<Alert variant="info"> | ||
Importing doesn't copy any data, it only create links to them in the lakeFS metadata. Don't worry, we will never make any changes to objects in the import source. |
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.
Importing doesn't copy any data, it only create links to them in the lakeFS metadata. Don't worry, we will never make any changes to objects in the import source. | |
Import doesn't copy the object. It only creates links to the objects in the lakeFS metadata layer. Don't worry, we will never change objects in the import source. |
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.
done
</Alert> | ||
<form> | ||
<Form.Group class='form-group'> | ||
<Form.Label><strong>Import source:</strong></Form.Label> |
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.
<Form.Label><strong>Import source:</strong></Form.Label> | |
<Form.Label><strong>Import from:</strong></Form.Label> |
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.
done
const destRef = useRef(null); | ||
const commitMsgRef = useRef(null); | ||
const storageType = config.blockstore_type | ||
const DEFAULT_BLOCKSTORE_VALIDITY_REGEX = new RegExp(`^s3://`); |
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.
Why? We support Azure and GCP too..
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.
@eden-ohana @itaiad200 did we test this feature on Azure and GCS?
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.
yes
|
||
try { | ||
importBranchResp = await branches.get(repo.id, importBranch) | ||
} catch (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.
Right, the import can also fail if there are uncommitted changes for example.
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.
Looking great!
closes #3137