-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add endpoint for downloading a project #7291
Add endpoint for downloading a project #7291
Conversation
lib/scala/pkg/src/main/java/org/enso/pkg/archive/EnsoProjectArchive.java
Outdated
Show resolved
Hide resolved
lib/scala/pkg/src/main/java/org/enso/pkg/archive/CloseArchiveEntryException.java
Show resolved
Hide resolved
lib/scala/pkg/src/main/java/org/enso/pkg/archive/EnsoProjectArchiveException.java
Show resolved
Hide resolved
import org.enso.pkg.Package$; | ||
|
||
/** A file visitor that builds a tar archive out of visited files. */ | ||
public final class TarArchiveBuildingFileVisitor implements FileVisitor<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.
I'd expect this to be an implementation detail class and I'd keep it package private.
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.
Made package private
lib/scala/pkg/src/test/scala/org/enso/pkg/archive/EnsoProjectArchiveSpec.scala
Show resolved
Hide resolved
complete(StatusCodes.NotFound) | ||
case Success(Right(Some(archive))) => | ||
complete( | ||
HttpEntity( |
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.
Shouldn't we also write a test for this endpoint?
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 tricky logic is about the archive building. This one is pretty straightforward. I'll see if I can mock the project repository and add a test then
/** Error when trying to close an enso-project archive entry. */ | ||
public final class CloseArchiveEntryException extends EnsoProjectArchiveException { | ||
|
||
public CloseArchiveEntryException(IOException cause) { |
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.
If the class (and other similar cases) is only constructed in the same package, then you may want to have package private constructors.
Pull Request Description
close #7194
Changelog:
/projects/{project_id}/enso_project
HTTP endpoint returning an.enso-project
archive structure.enso-project
.tar.gz
archivepath
a required fieldImportant Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.