NO-JIRA: Downloads: Ensure cleanup of the artifact folder on each startup#16681
NO-JIRA: Downloads: Ensure cleanup of the artifact folder on each startup#16681hongkailiu wants to merge 2 commits into
Conversation
|
@hongkailiu: This pull request explicitly references no 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe downloads config test now includes ChangesDownloads config cleanup test
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 12 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (12 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hongkailiu The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
e2bf0e1 to
c8d0b21
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@cmd/downloads/config/downloads_config_test.go`:
- Around line 321-326: The test setup in the oldDirs loop ignores the error from
os.WriteFile, which can make the fixture creation silently fail. Update the
downloads_config_test setup to check and handle the os.WriteFile return value,
using the existing test failure pattern in the same block so the cleanup
assertions only run after the leftover file is definitely created.
🪄 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: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 27f6f2d0-9bad-4a4d-a24d-19acd2cf77cb
📒 Files selected for processing (1)
cmd/downloads/config/downloads_config_test.go
Follow up openshift/console-operator#1176 The GoLang implementation uses a fixed folder name `defaultArtifactsDir` to store the files and cleans the folder up [1]. So it should not suffer the issue of accumulating the files over startups. An existing unit test ensures already the same `defaultArtifactsDir` is used [2]. Another existing unit test checks folders with the prefix `defaultArtifactsDir` are removed. We add the logic in the pull to this unit test to ensure that the files in `defaultArtifactsDir` from previous container are removed too in the new container after startup. [1]. https://github.com/openshift/console/blob/71f7e03bcfe04f9842f24a8f628660f8f2d4b892/cmd/downloads/config/downloads_config.go#L119-L122 [2]. https://github.com/openshift/console/blob/28f9ca40e41a5b221bcd562194fcc1ff930cc6f4/cmd/downloads/config/downloads_config_test.go#L266-L268
c8d0b21 to
b2a248c
Compare
|
@hongkailiu: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Downloads: Ensure cleanup of the artifact folder on each startup
Follow up openshift/console-operator#1176
The GoLang implementation uses a fixed folder name
defaultArtifactsDirto store the files and cleans the folder up [1]. So it should not suffer the issue of accumulating the files over startups.An existing unit test ensures already the same
defaultArtifactsDiris used [2].Another existing unit test checks folders with the prefix
defaultArtifactsDirare removed. We add the logic in the pull to this unit test to ensure that the files indefaultArtifactsDirfrom previous container are removed too in the new container after startup.[1].
console/cmd/downloads/config/downloads_config.go
Lines 119 to 122 in 71f7e03
[2].
console/cmd/downloads/config/downloads_config_test.go
Lines 266 to 268 in 28f9ca4
Analysis / Root cause:
Solution description:
Screenshots / screen recording:
Test setup:
Test cases:
Browser conformance:
Additional info:
Reviewers and assignees:
Summary by CodeRabbit
/tmp/artifacts*test*artifact-related temporary directories left by the test run.