-
Notifications
You must be signed in to change notification settings - Fork 286
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
Process project.toml for app source metadata #1231
Conversation
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
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.
Thanks for helping us out with this 🙏🏾
Let's please not have these types of files as part of the PR (internal/registry/registry468683854
).
I made this issue about removing these artifacts after the tests run: #1228
Signed-off-by: haimantika mitra <[email protected]>
…he needs of the issue Signed-off-by: haimantika mitra <[email protected]>
…go.mod and go.sum files Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: Javier Romero <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
project/project.go
Outdated
func (d *Descriptor) ProjectMetadata() platform.ProjectMetadata { | ||
return platform.ProjectMetadata{} | ||
} | ||
|
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.
As much as I like it, these lines won't be needed in your final implementation, correct?
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.
Nope, we can do without. Maybe I can comment this out,
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 something isn't necessary, we delete it, not comment out. 😁
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 a few change requests but overall the feature looks great!
Also, it looks like there's a minor conflict with build.go
. We'll want to resolve that so we can run all the tests on GitHub.
acceptance/acceptance_test.go
Outdated
@@ -901,6 +904,9 @@ func testAcceptance( | |||
t.Log("sets the run image metadata") | |||
assertImage.HasLabelWithData(repoName, "io.buildpacks.lifecycle.metadata", fmt.Sprintf(`"stack":{"runImage":{"image":"%s","mirrors":["%s"]}}}`, runImage, runImageMirror)) | |||
|
|||
t.Log("sets the source metadata") | |||
assertImage.HasLabelWithData(repoName, "io.buildpacks.project.metadata", fmt.Sprintf(`{"project-metadata":{"source":{"type":"%s","version":{"declared":"%s"},"metadata":{"url":"%s"}}}`, Type, version, metadata)) |
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.
assertImage.HasLabelWithData(repoName, "io.buildpacks.project.metadata", fmt.Sprintf(`{"project-metadata":{"source":{"type":"%s","version":{"declared":"%s"},"metadata":{"url":"%s"}}}`, Type, version, metadata)) | |
assertImage.HasLabelWithData(repoName, "io.buildpacks.project.metadata", `{"project-metadata":{"source":{"type":"project","version":{"declared":"1.0.2"},"metadata":{"url":"https://github.com/buildpacks/pack"}}}`) |
@@ -0,0 +1,3 @@ | |||
[project] | |||
version = "1.0.2" | |||
source-url = "https://github.com/buildpacks/pack" |
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.
source-url = "https://github.com/buildpacks/pack" | |
source-url = "https://github.com/buildpacks/pack" | |
I hate this but we should have a new line character at the end of each file. See https://unix.stackexchange.com/q/18743
@@ -19,6 +19,8 @@ import ( | |||
"github.com/pkg/errors" | |||
ignore "github.com/sabhiram/go-gitignore" | |||
|
|||
"github.com/buildpacks/lifecycle/platform" |
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.
Import Groups
Imports should be grouped into the following:
- Standard library
- External libraries
- Local packages
internal/build/container_ops.go
Outdated
// func createReader(src, dst string, uid, gid int, includeRoot bool, fileFilter func(string) bool) (io.ReadCloser, error) { | ||
// fi, err := os.Stat(src) | ||
// if err != nil { | ||
// return nil, err | ||
// } | ||
|
||
// if fi.IsDir() { | ||
// var mode int64 = -1 | ||
// if runtime.GOOS == "windows" { | ||
// mode = 0777 | ||
// } | ||
|
||
// return archive.ReadDirAsTar(src, dst, uid, gid, mode, false, includeRoot, fileFilter), nil | ||
// } | ||
|
||
// return archive.ReadZipAsTar(src, dst, uid, gid, -1, false, fileFilter), nil | ||
// } | ||
|
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.
We don't want to commit unused code
// func createReader(src, dst string, uid, gid int, includeRoot bool, fileFilter func(string) bool) (io.ReadCloser, error) { | |
// fi, err := os.Stat(src) | |
// if err != nil { | |
// return nil, err | |
// } | |
// if fi.IsDir() { | |
// var mode int64 = -1 | |
// if runtime.GOOS == "windows" { | |
// mode = 0777 | |
// } | |
// return archive.ReadDirAsTar(src, dst, uid, gid, mode, false, includeRoot, fileFilter), nil | |
// } | |
// return archive.ReadZipAsTar(src, dst, uid, gid, -1, false, fileFilter), nil | |
// } |
internal/build/container_ops.go
Outdated
@@ -15,6 +15,8 @@ import ( | |||
"github.com/docker/docker/client" | |||
"github.com/pkg/errors" | |||
|
|||
"github.com/buildpacks/lifecycle/platform" |
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.
See "Import Groups"
@@ -20,6 +20,8 @@ import ( | |||
"github.com/sclevine/spec" | |||
"github.com/sclevine/spec/report" | |||
|
|||
"github.com/buildpacks/lifecycle/platform" |
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.
See "Import Groups"
project.toml
Outdated
@@ -0,0 +1,3 @@ | |||
[project] | |||
version = "1.0.2" | |||
source-url = "https://github.com/buildpacks/pack" |
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.
nit: "New line" character missing at end of file
project/project.go
Outdated
@@ -5,8 +5,10 @@ import ( | |||
"path/filepath" | |||
|
|||
"github.com/BurntSushi/toml" | |||
//"github.com/docker/docker/api/types/versions" |
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.
//"github.com/docker/docker/api/types/versions" |
project/project.go
Outdated
func (d *Descriptor) ProjectMetadata() platform.ProjectMetadata { | ||
return platform.ProjectMetadata{} | ||
} | ||
|
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 something isn't necessary, we delete it, not comment out. 😁
Co-authored-by: Javier Romero <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
fcbe322
to
7f390eb
Compare
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Signed-off-by: haimantika mitra <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1231 +/- ##
==========================================
- Coverage 80.99% 79.88% -1.10%
==========================================
Files 140 140
Lines 8534 8568 +34
==========================================
- Hits 6911 6844 -67
- Misses 1184 1284 +100
- Partials 439 440 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
Summary
Resolves #1138