Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Support Netlify Large Media #40

Open
calavera opened this issue Feb 26, 2019 · 6 comments
Open

Support Netlify Large Media #40

calavera opened this issue Feb 26, 2019 · 6 comments

Comments

@calavera
Copy link
Contributor

- Do you want to request a feature or report a bug?

There are a couple of things we need to add to support Netlify Large Media in the CLI.

- What is the current behavior?

We don't support Netlify LM

- What is the expected behavior?

When a site has LM enabled, we need to read information from LFS pointer files to add them to the deploy requests. This logic is already implemented in the Go client:

https://github.com/netlify/open-api/blob/master/go/porcelain/deploy.go#L512-L532

The original file size needs to be sent as a parameter when we upload a file:

https://github.com/netlify/open-api/blob/master/go/porcelain/deploy.go#L424-L431

There is a caveat to keep in mind in this implementation:

netlify/open-api@2af0664

Maybe @keiko713 can say more about that special hashed key.

@bcomnes
Copy link
Contributor

bcomnes commented Feb 26, 2019

We did a code walkthrough together the other day. I think we can get this added fairly soon. I'll take a stab at it when I have time.

@keiko713
Copy link
Contributor

I need to go and ask for Keiko Sept 2018.

@keiko713
Copy link
Contributor

actually what do I need to do here? is there any specific question?

@bcomnes
Copy link
Contributor

bcomnes commented Feb 27, 2019

@keiko713 there is, but we can maybe pair and talk about it when I (or whoever does this) needs the information and form a specific question.

@bcomnes
Copy link
Contributor

bcomnes commented May 2, 2019

Ok, catching up on this.

A few caveats/edge cases:

  • The buildbot clones the LFS backed repo down, without the LFS media swapped in place for the file pointers.
  • A build process then moves those pointer file (names the same as the actual large files) into a build directory.
  • The go-client deploy algorithm treats these pointer files slightly differently
  • When working locally with the CLI, it is presumed that your have the LFS client installed, and your pointer files are swapped out.
  • That means if you deploy from the CLI, any assets deployed can't take advantage of the transformation api
  • We should warn in the CLI when you deploy a site that has LFS enabled due to this subtle difference.
  • We should still handle LFS pointer files the sale way so that you could, in theory, use this to deploy the same way the go client does in the buildbot.

@bcomnes
Copy link
Contributor

bcomnes commented May 2, 2019

So solve the above mentioned edge case we would need to:

  • Swap LFS files during CLI deploys for LFS pointer files
  • Upload new assets that haven't made it into LFS storage

This would be challenging however. Other solutions might exist.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants