ZEA-5097: allow specifying the dockerfile path#465
Conversation
5a79163 to
2311de7
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the Dockerfile support by migrating identifiers/packers to V2 interfaces, adding a configurable dockerfile.path option, cleaning up noisy errors, and extending test coverage for both dockerfile.name and dockerfile.path.
- Migrate existing
IdentifierandPackerimplementations to newIdentifierV2andV2interfaces via wrapper functions. - Introduce
dockerfile.pathin the schema and code to allow explicit Dockerfile file paths. - Remove redundant version error logs and add
ErrEmptyVersion; update relevant tests and schema.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| schema/zbpack.json | Added dockerfile.path schema, expanded descriptions/examples. |
| pkg/zeaburpack/packers.go | Converted SupportedPackers to return V2 packers, wrapping old packers. |
| pkg/zeaburpack/identifiers.go | Converted SupportedIdentifiers to return V2 identifiers. |
| internal/utils/version.go | Introduced ErrEmptyVersion, replaced error string with sentinel error. |
| internal/dockerfile/finder.go | New FindDockerfile implementing path/name resolution. |
| internal/dockerfile/plan.go | Refactored ReadDockerfile/GetMeta to use new finder and error wraps. |
| internal/dockerfile/identify.go | Updated Match to use FindDockerfile and handle NotExist vs other errors. |
Comments suppressed due to low confidence (1)
pkg/zeaburpack/packers.go:28
- [nitpick] To align with the wrapping style used for other packers (e.g.,
packer.WrapV2(dart.NewPacker())), consider wrappingdockerfile.NewPacker()withpacker.WrapV2or document thatNewPackeralready returns aV2implementation.
dockerfile.NewPacker(),
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the packer/identifier APIs to V2, adds support for explicitly specifying a Dockerfile path via dockerfile.path, refines version parsing to suppress empty-version spam, and adds corresponding tests.
- Introduce V2 interfaces for both packers and identifiers and wrap existing implementations.
- Implement
dockerfile.pathlookup ininternal/dockerfile/finder.goand update discovery logic. - Define
ErrEmptyVersionand adjust version parsing/logging to avoid spamming on empty input.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/dockerfile-test/path/zbpack.json | Add test config for explicit Dockerfile path |
| schema/zbpack.json | Document dockerfile.path and update name description |
| pkg/zeaburpack/packers.go | Change SupportedPackers to return V2 and wrap packers |
| pkg/zeaburpack/identifiers.go | Change SupportedIdentifiers to return IdentifierV2 |
| pkg/plan/plan.go | Migrate Planner to use IdentifierV2 |
| internal/utils/version.go | Introduce ErrEmptyVersion and refine error handling |
| internal/dockerfile/finder.go | New FindDockerfile with dockerfile.path support |
| internal/dockerfile/identify.go | Update identifier to use new finder and V2 interface |
| internal/dockerfile/plan.go | Refactor ReadDockerfile/Meta to use new finder context |
| internal/dockerfile/dockerfile.go | Update packer to implement V2 interface |
Comments suppressed due to low confidence (2)
pkg/zeaburpack/packers.go:22
- [nitpick] The comment refers to identifiers but this function returns packers; update it to "SupportedPackers returns all supported packers."
// SupportedPackers returns all supported identifiers
internal/utils/version.go:122
- [nitpick] Include the original constraint string in the log for better context, e.g.,
log.Printf("invalid version %q: %v", constraints, err).
log.Println("invalid version", err)
376c26c to
3bdecfa
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Implements advanced Dockerfile resolution and migrates packer/identifier APIs to V2.
- Introduce
dockerfile.pathin schema and tests, allowing explicit Dockerfile paths. - Refactor packer/identifier layers to V2 interfaces, wrapping existing implementations.
- Consolidate Dockerfile find/read logic into a new module, and suppress noisy “empty version” logs in version parsing.
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/dockerfile-test/path/zbpack.json | Add test config using dockerfile.path |
| tests/dockerfile-test/path/docker/test.Dockerfile | Sample Dockerfile for path-based tests |
| schema/zbpack.json | Add path property and update name description |
| pkg/zeaburpack/packers.go | Switch SupportedPackers to return packer.V2, wrap old types |
| pkg/zeaburpack/identifiers.go | Switch SupportedIdentifiers to return plan.IdentifierV2 |
| internal/dockerfile/finder.go | New FindDockerfile logic handling dockerfile.path/name |
| internal/dockerfile/dockerfile.go | Update Dockerfile packer to implement V2 interface |
| internal/utils/version.go | Introduce ErrEmptyVersion and remove spammy error logs |
Comments suppressed due to low confidence (3)
internal/dockerfile/dockerfile.go:17
- The comment for
NewPackerincorrectly mentions a Deno packer; update it to reference the Dockerfile packer.
// NewPacker returns a new Deno packer.
schema/zbpack.json:124
- [nitpick] The examples for
dockerfile.pathinclude leading slashes that imply absolute paths; clarify in the description whether paths are always relative to the project root.
"examples": ["Dockerfile", "/Dockerfile", "/docker/custom.Dockerfile"]
pkg/zeaburpack/identifiers.go:23
- Update the comment to note that this now returns
[]plan.IdentifierV2rather than the old[]plan.Identifierto match the new API signature.
// SupportedIdentifiers returns all supported identifiers
Description (required)
Match()dockerfile.pathto specify an explicit path (like `docker/frontend.Dockerfile)Related issues & labels (optional)