test: extract PEM fixtures to resources and allowlist for gitleaks (crw-12394) - #363
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change centralizes TLS test certificates in classpath resources, updates tests to use shared fixtures, and adjusts Gitleaks configuration and ChangesTLS fixture and secret scanning cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR moves PEM fixtures into test resources and updates test loading plus scanner allowlisting; no actionable merge-blocking risk remains beyond normal checks. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
|
@vrubezhny, @azatsarynnyy: please review |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #363 +/- ##
==========================================
+ Coverage 0.00% 35.04% +35.04%
==========================================
Files 4 113 +109
Lines 26 4916 +4890
Branches 0 945 +945
==========================================
+ Hits 0 1723 +1723
- Misses 26 2941 +2915
- Partials 0 252 +252 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
abc6199 to
522da61
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 `@src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTestCertificates.kt`:
- Around line 25-30: Update readTlsResource to wrap the InputStream returned by
getResourceAsStream in use before calling readBytes, preserving the existing
UTF-8 conversion and missing-resource error. Apply the same resource-closing
pattern to the four helper calls in TlsConnectionProbeTestFixtures.kt.
🪄 Autofix
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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0673339e-c8dc-4d43-bc32-4d5723e9c477
⛔ Files ignored due to path filters (4)
src/test/resources/tls/ca-cert.pemis excluded by!**/*.pemsrc/test/resources/tls/client-key.pemis excluded by!**/*.pemsrc/test/resources/tls/ec-cert.pemis excluded by!**/*.pemsrc/test/resources/tls/normalization-cert.pemis excluded by!**/*.pem
📒 Files selected for processing (12)
.gitleaks.tomlsrc/main/kotlin/com/redhat/devtools/gateway/auth/tls/PemUtils.ktsrc/test/kotlin/com/redhat/devtools/gateway/auth/tls/CertificateSourceTest.ktsrc/test/kotlin/com/redhat/devtools/gateway/auth/tls/PemUtilsTest.ktsrc/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsConnectionProbeTestFixtures.ktsrc/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTestCertificates.ktsrc/test/kotlin/com/redhat/devtools/gateway/kubeconfig/BlockStyleFilePersisterTest.ktsrc/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigNamedUserTest.ktsrc/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUtilsTest.ktsrc/test/kotlin/com/redhat/devtools/gateway/openshift/ApiClientUtilsTest.ktsrc/test/kotlin/com/redhat/devtools/gateway/openshift/ClusterTest.ktsrc/test/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientBuilderTest.kt
💤 Files with no reviewable changes (2)
- src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigNamedUserTest.kt
- src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/BlockStyleFilePersisterTest.kt
…rw-12394) Move PEM certificates and private keys from inline Kotlin test strings into src/test/resources/tls/ and load them through TlsTestCertificates (readTlsResource, singleLine). Add .gitleaks.toml allowlist for that directory so secret scanners skip known test fixtures. Signed-off-by: Andre Dietisheim <adietish@redhat.com> Co-authored-by: Cursor <cursoragent@cursor.com>
522da61 to
4801f67
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
vrubezhny
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks!
fixes https://redhat.atlassian.net/browse/CRW-12394
Move PEM certificates and private keys from inline Kotlin test strings into src/test/resources/tls/ and load them through TlsTestCertificates (readTlsResource, singleLine). Add .gitleaks.toml allowlist for that directory so secret scanners skip known test fixtures.