-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitClone.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
|
||
FileOutputStream out = new FileOutputStream(zipFile.toAbsolutePath().toString()); | ||
git.archive().setTree(repo.resolve("HEAD")).setFormat("zip").setOutputStream(out).call(); | ||
|
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.
- Should the size be evaluated before?
- Should
repo.resolve("HEAD")
be parameterized and allow to be set by the dev?
SetTree - Set the tag, commit, or tree object to produce an archive for
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.
at this stage I do not think that it's needed, instead adding more complex can I create a followup issue?
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.
sure.
40786b4
to
8a1cd7a
Compare
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitUtils.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchive.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitArchiveTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitArchiveTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitCloneTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitCloneTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitCloneTest.java
Outdated
Show resolved
Hide resolved
c380520
to
f70f783
Compare
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitUtils.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitUtils.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitArchiveTaskTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitArchiveTaskTest.java
Outdated
Show resolved
Hide resolved
@gciavarrini regarding the try in test, is that ok? If I have a test that does assertDoesNotTrhow, if I use the try inside it, it will not fail, no? Is it a valid test? Regarding the multiple error types in the catch, At the end I would like to send a valid message to the user, is not the same as an IOException (File not found) than the Transport(Cannot connect, server without connection) and the InvalidRemote(can be invalid credentials) I do not really like all these chain exceptions for multiple functions, but the style is what it is. |
1c77f71
to
16883d1
Compare
@gciavarrini @masayag @pkliczewski @RichardW98 all the comments are now addressed; please review again and share your thoughts there. |
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
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitCloneTaskTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitArchiveTask.java
Outdated
Show resolved
Hide resolved
return new DefaultWorkReport(WorkStatus.FAILED, workContext, e); | ||
} | ||
catch (TransportException e) { | ||
return new DefaultWorkReport(WorkStatus.FAILED, workContext, |
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.
perhaps include the error message as well, if not logging the exception with DEBUG level.
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'll go with log, a error that said, cannot connect to 129.34.23.29 it's nothing that the user needs to know.
} | ||
catch (InvalidRemoteException e) { | ||
return new DefaultWorkReport(WorkStatus.FAILED, workContext, | ||
new Exception("Remote repository " + gitUri + " is not available")); |
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.
perhaps include the error message as well?
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'll go with log message as well, the error messages for these exceptions are developer-friendly, not user-friendly.
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitCloneTask.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitUtils.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitArchiveTaskTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitCloneTask.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitCloneTask.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitCloneTask.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitCloneTaskTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/test/java/com/redhat/parodos/tasks/git/GitArchiveTaskTest.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitUtils.java
Outdated
Show resolved
Hide resolved
prebuilt-tasks/src/main/java/com/redhat/parodos/tasks/git/GitCloneTask.java
Outdated
Show resolved
Hide resolved
6a53f26
to
24fc1d4
Compare
This commit addressed a new way to clone and archive git repositories inside Parodos. The main objective for these tasks is to implement work on top of Move2kube. Signed-off-by: Eloy Coto <eloy.coto@acalustra.com>
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gciavarrini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This commit addressed a new way to clone and archive git repositories inside Parodos.
The main objective for these tasks is to implement work on top of Move2kube.