WINC-1705: DNM [test] Add Windows container build test for Konflux - #4318
WINC-1705: DNM [test] Add Windows container build test for Konflux#4318mansikulkarni96 wants to merge 2 commits into
Conversation
|
Skipping CI for Draft Pull Request. |
📝 WalkthroughWalkthroughAdds a multi-stage Windows test container definition that cross-compiles a Go executable and packages it in a Windows host-process image. Adds a Tekton PipelineRun for pull requests targeting 🚥 Pre-merge checks | ✅ 20✅ Passed checks (20 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mansikulkarni96 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.tekton/windows-container-test-pull-request.yaml:
- Around line 41-43: Update the docker-build pipelineRef bundle in the Windows
container test configuration to use an immutable image digest instead of the
mutable :devel tag. Preserve the existing pipeline name and deliberately select
the resolved digest for the intended pipeline version.
In `@Containerfile.windows-test`:
- Line 30: Replace the USER directive selecting ContainerAdministrator with
ContainerUser for the Windows test container, preserving the existing test
behavior while avoiding unnecessary host-level privileges.
- Line 31: Add a Docker HEALTHCHECK instruction to the final image near the
ENTRYPOINT in Containerfile.windows-test, using a command that reliably verifies
the test executable/container is healthy; if this image cannot support a
meaningful health check, document the approved exception instead.
- Line 21: Update the base image declaration in the Windows test container
configuration to use an immutable digest instead of the v1.0.0 tag, and add the
repository-required documented policy exception for this Windows host-process
image because a UBI or distroless Red Hat base is not viable.
- Around line 11-15: Update the main.go generation command in the
Containerfile’s build step to use printf or a heredoc instead of single-quoted
echo, ensuring newline escapes become actual line breaks and the generated Go
source remains valid across shells.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 2f242e9b-5bf4-44d2-9b4a-65c93f3154bd
📒 Files selected for processing (2)
.tekton/windows-container-test-pull-request.yamlContainerfile.windows-test
| pipelineRef: | ||
| name: docker-build | ||
| bundle: quay.io/konflux-ci/tekton-catalog/pipeline-docker-build:devel |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Pin the remote pipeline bundle instead of using :devel.
A mutable development tag allows the PR’s build behavior and parameter contract to change without a repository change. Resolve and pin the bundle to an immutable digest, then update it deliberately when the pipeline version changes.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.tekton/windows-container-test-pull-request.yaml around lines 41 - 43,
Update the docker-build pipelineRef bundle in the Windows container test
configuration to use an immutable image digest instead of the mutable :devel
tag. Preserve the existing pipeline name and deliberately select the resolved
digest for the intended pipeline version.
| RUN echo 'package main\n\ | ||
| import "fmt"\n\ | ||
| func main() {\n\ | ||
| fmt.Println("Windows container test from Konflux")\n\ | ||
| }' > main.go |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Generate main.go with printf or a heredoc.
The single-quoted echo argument preserves \n literally, and escape handling varies by shell. This can generate invalid Go source and make the build fail at Line 18.
Proposed fix
-RUN echo 'package main\n\
-import "fmt"\n\
-func main() {\n\
- fmt.Println("Windows container test from Konflux")\n\
-}' > main.go
+RUN printf '%s\n' \
+ 'package main' \
+ 'import "fmt"' \
+ 'func main() {' \
+ ' fmt.Println("Windows container test from Konflux")' \
+ '}' > main.go📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| RUN echo 'package main\n\ | |
| import "fmt"\n\ | |
| func main() {\n\ | |
| fmt.Println("Windows container test from Konflux")\n\ | |
| }' > main.go | |
| RUN printf '%s\n' \ | |
| 'package main' \ | |
| 'import "fmt"' \ | |
| 'func main() {' \ | |
| ' fmt.Println("Windows container test from Konflux")' \ | |
| '}' > main.go |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@Containerfile.windows-test` around lines 11 - 15, Update the main.go
generation command in the Containerfile’s build step to use printf or a heredoc
instead of single-quoted echo, ensuring newline escapes become actual line
breaks and the generated Go source remains valid across shells.
46f4d99 to
052ff2a
Compare
052ff2a to
8278a8d
Compare
|
@mansikulkarni96: This pull request references WINC-1705 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Summary by CodeRabbit