NO-ISSUE: test MCC proxy. Refactor TC 52373 proxy test. - #6355
Conversation
|
Skipping CI for Draft Pull Request. |
|
@sergiordlr: This pull request references Jira Issue OCPBUGS-92811, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. 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. |
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
WalkthroughThis PR adds spec retrieval and aggregated cleanup helpers. It updates extended privileged tests to restore proxy state safely, validate proxy propagation and degraded conditions, and use the cleanup helper during scale tests. ChangesExtended Privileged Test Updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (13 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 |
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 `@test/extended-priv/mco_machineconfigpool.go`:
- Around line 140-147: Redact sensitive proxy details in
test/extended-priv/mco_machineconfigpool.go lines 140-147 by changing the
capture and restore logs to report only that the configuration was captured or
restored, without logging proxyInitialConfig. In test/extended-priv/util.go
lines 327-331, update SafeCleanup to redact sensitive values before logging or
embedding collected assertion failures in the final message.
🪄 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: Pro Plus
Run ID: f85f94e3-fc73-40af-a704-de9dc84962d0
📒 Files selected for processing (3)
test/extended-priv/mco_machineconfigpool.gotest/extended-priv/resource.gotest/extended-priv/util.go
| proxyInitialConfig := proxy.GetSpecOrFail() | ||
| logger.Infof("Initial proxy configuration: %s", proxyInitialConfig) | ||
| logger.Infof("OK!\n") | ||
|
|
||
| wmcp := NewMachineConfigPool(oc.AsAdmin(), MachineConfigPoolWorker) | ||
| mmcp := NewMachineConfigPool(oc.AsAdmin(), MachineConfigPoolMaster) | ||
|
|
||
| defer func() { | ||
| defer SafeCleanup(func() { | ||
| logger.Infof("Start TC defer block") | ||
|
|
||
| logger.Infof("Restore original proxy config %s", proxyInitialConfig) |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Remove or redact sensitive cleanup output.
proxyInitialConfig can contain HTTP proxy credentials. Lines 141 and 147 write it directly to CI logs. SafeCleanup also writes collected assertion text without redaction. A failed proxy restore can then report the same sensitive configuration.
test/extended-priv/mco_machineconfigpool.go#L140-L147: Log that the proxy configuration was captured or restored. Do not log the full specification.test/extended-priv/util.go#L327-L331: Redact sensitive values before logging or including collected failures in the final assertion message.
As per coding guidelines, flag logging that may expose passwords, tokens, API keys, PII, session IDs, internal hostnames, or customer data.
📍 Affects 2 files
test/extended-priv/mco_machineconfigpool.go#L140-L147(this comment)test/extended-priv/util.go#L327-L331
🤖 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 `@test/extended-priv/mco_machineconfigpool.go` around lines 140 - 147, Redact
sensitive proxy details in test/extended-priv/mco_machineconfigpool.go lines
140-147 by changing the capture and restore logs to report only that the
configuration was captured or restored, without logging proxyInitialConfig. In
test/extended-priv/util.go lines 327-331, update SafeCleanup to redact sensitive
values before logging or embedding collected assertion failures in the final
message.
Source: Coding guidelines
59d4c60 to
44cb8f4
Compare
Manual execution logs/verified by @sergiordlr |
|
@sergiordlr: This PR has been marked as verified by 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. |
|
@sergiordlr: all tests passed! 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. |
|
@sergiordlr: 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. |
|
/jira refresh |
|
@sergiordlr: 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. |
|
Pipeline controller notification No second-stage tests were triggered for this PR. This can happen when:
Use |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: isabella-janssen, sergiordlr 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 |
- What I did
Proxy test OCP-52373 has been modified with the following changes:
An instruction reporting a test failure in a deferred section will stop the execution of this deferred section. Having several deferred sections is a solution, but sometimes we have a single big deferred section. In order to make sure that those scenarios fully execute all the instructions even if a failure happens we created the SafeCleanup function.
In the future we should refactor the pause function to make it return an error instead of directly failing the test case.
- How to verify it
Test should pass
Summary by CodeRabbit