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

Add support for SHA256 in PackageFile #1902

Merged
merged 2 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ func (s PackageTag) String() string {
//
// GitLab API docs: https://docs.gitlab.com/ee/api/packages.html
type PackageFile struct {
ID int `json:"id"`
PackageID int `json:"package_id"`
CreatedAt *time.Time `json:"created_at"`
FileName string `json:"file_name"`
Size int `json:"size"`
FileMD5 string `json:"file_md5"`
FileSHA1 string `json:"file_sha1"`
Pipeline *[]Pipeline `json:"pipelines"`
ID int `json:"id"`
PackageID int `json:"package_id"`
CreatedAt *time.Time `json:"created_at"`
FileName string `json:"file_name"`
Size int `json:"size"`
FileMD5 string `json:"file_md5"`
FileSHA1 string `json:"file_sha1"`
FileSHA256 string `json:"file_sha256"`
Pipeline *[]Pipeline `json:"pipelines"`
}

func (s PackageFile) String() string {
Expand Down
13 changes: 7 additions & 6 deletions packages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,13 @@ func TestPackagesService_ListPackageFiles(t *testing.T) {
})

want := []*PackageFile{{
ID: 25,
PackageID: 4,
FileName: "my-app-1.5-20181107.152550-1.jar",
Size: 2421,
FileMD5: "58e6a45a629910c6ff99145a688971ac",
FileSHA1: "ebd193463d3915d7e22219f52740056dfd26cbfe",
ID: 25,
PackageID: 4,
FileName: "my-app-1.5-20181107.152550-1.jar",
Size: 2421,
FileMD5: "58e6a45a629910c6ff99145a688971ac",
FileSHA1: "ebd193463d3915d7e22219f52740056dfd26cbfe",
FileSHA256: "a903393463d3915d7e22219f52740056dfd26cbfeff321b",
}}

ps, resp, err := client.Packages.ListPackageFiles(3, 4, nil)
Expand Down
Loading