-
Notifications
You must be signed in to change notification settings - Fork 33
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 file download capabilities for GitHub and Gitlab providers #80
Conversation
Signed-off-by: Jose C Ordaz <josecordaz@gmail.com>
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.
Very nice!
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 have several questions which are mostly superficial.
I haven't looked at the meat of the PR.
gitprovider/types_repository.go
Outdated
// File contains high-level information about a file either add it to a commit or for content downloads | ||
type File struct { | ||
// Path is path where this file is located. | ||
// +required | ||
Path *string `json:"path"` | ||
|
||
// Name is path where this file is located. | ||
// | ||
Name *string `json:"name"` | ||
|
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.
Could you do this by adding a new struct rather than renaming the existing one and adding a field which is sometimes redundant?
gitprovider/types_repository.go
Outdated
// Path is path where this file is located. | ||
// +required | ||
Path *string `json:"path"` | ||
|
||
// Name is path where this file is located. | ||
// | ||
Name *string `json:"name"` |
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 Name
the last component of the path? If not, when would it differ?
go.mod
Outdated
@@ -9,7 +9,7 @@ require ( | |||
github.com/ktrysmt/go-bitbucket v0.6.2 | |||
github.com/onsi/ginkgo v1.14.0 | |||
github.com/onsi/gomega v1.10.1 | |||
github.com/xanzy/go-gitlab v0.33.0 | |||
github.com/xanzy/go-gitlab v0.43.0 |
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 change should go in its own commit, perhaps in its own PR.
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.
that is in master already, maybe I did something wrong when I ran git merge master
? or the squash ? 🤔
gitlab/client_repository_commit.go
Outdated
filePath := *file.Path | ||
fileContent := *file.Content | ||
commitActions = append(commitActions, &gitlab.CommitActionOptions{ | ||
Action: &fileAction, | ||
FilePath: &filePath, | ||
Content: &fileContent, |
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 change seems unmotivated by the description of the PR.
Is it caused by the version change?
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 add a description for this
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 rebase with upstream, as there are files in this PR that don't belong, like the CI changes from #82
…o download-files
Signed-off-by: Simon Howe <footless@gmail.com>
Signed-off-by: Simon Howe <footless@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #80 +/- ##
==========================================
+ Coverage 59.79% 59.90% +0.10%
==========================================
Files 77 80 +3
Lines 4052 4108 +56
==========================================
+ Hits 2423 2461 +38
- Misses 1117 1127 +10
- Partials 512 520 +8
Continue to review full report at Codecov.
|
Merge history might be a bit stale so lets make sure to Squash and merge this one? |
+1 as this would be really really useful for the current work being done to implement |
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
Thanks @josecordaz
Description
Added new .Files().Get(ctx,PATH,BRANCH) function to download files on Github and Gitlab
Test results
Github tests output:
Gitlab tests output:
Fix: #81