🐛 Fix mta-801 golden manifest diff mismatch for ocp - #740
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
💤 Files with no reviewable changes (5)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughOpenShift-aware golden selection and semantic comparison were added to MTA-801. Redis OpenShift export fixtures and output goldens now cover workload, storage, networking, certificates, identities, registry secrets, and RBAC resources. Simple nginx output goldens now reflect generated Route hosts and removed generated resources. ChangesOpenShift Redis golden manifests
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant MTA801Test
participant KubectlSrc
participant GoldenDirectory
participant YAMLComparator
MTA801Test->>KubectlSrc: Detect OpenShift
MTA801Test->>GoldenDirectory: Select platform-specific goldens
MTA801Test->>YAMLComparator: Compare normalized manifests
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 3
🤖 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
`@e2e-tests/golden-manifests-ocp/redis/export/resources/redis/PersistentVolumeClaim__v1_redis_redis-data.yaml`:
- Around line 7-9: Normalize the OpenShift Redis export fixtures to remove
cluster-specific defaults: in
e2e-tests/golden-manifests-ocp/redis/export/resources/redis/PersistentVolumeClaim__v1_redis_redis-data.yaml:7-9,
remove volume.kubernetes.io/selected-node and avoid AWS-specific storage
provisioner values; in
e2e-tests/golden-manifests-ocp/redis/export/resources/redis/Service__v1_redis_redis.yaml:40-42,
remove spec.ipFamilies and spec.ipFamilyPolicy or align them with the generic
golden set’s single-stack baseline.
In
`@e2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_builder-dockercfg-lgfpb.yaml`:
- Around line 2-3: Remove the captured OpenShift registry credentials from the
three `.dockercfg` payloads: replace the values in
e2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_builder-dockercfg-lgfpb.yaml
lines 2-3, Secret__v1_redis_default-dockercfg-jpgs2.yaml lines 2-3, and
Secret__v1_redis_deployer-dockercfg-vf8ll.yaml lines 2-3 with consistent invalid
synthetic or redacted authentication values, and rotate any credentials sourced
from the real cluster.
In `@e2e-tests/tests/tier0/mta_801_stateful_migration_test.go`:
- Around line 84-85: Update the comparator assignment in the stateful migration
test so OpenShift output goldens use an output-specific comparator with strict
file-set semantics, rather than
CompareDirectoryYAMLSemanticsExportAllowOptionalOCPOutputDefaults. Preserve
OCP-specific normalization only if provided through a dedicated output
comparator.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3a7eacf4-3ca3-4152-9699-579330b50e92
📒 Files selected for processing (26)
e2e-tests/golden-manifests-ocp/redis/export/resources/redis/ConfigMap__v1_redis_kube-root-ca.crt.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ConfigMap__v1_redis_openshift-service-ca.crt.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Deployment_apps_v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/EndpointSlice_discovery.k8s.io_v1_redis_redis-r8vds.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Endpoints__v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/PersistentVolumeClaim__v1_redis_redis-data.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ReplicaSet_apps_v1_redis_redis-6b9f4c765d.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:deployers.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:image-builders.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:image-pullers.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:deployers.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:image-builders.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:image-pullers.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_builder-dockercfg-lgfpb.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_default-dockercfg-jpgs2.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_deployer-dockercfg-vf8ll.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_builder.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_default.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_deployer.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Service__v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/output/output.yamle2e-tests/golden-manifests-ocp/redis/output/resources/redis/Deployment_apps_v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/output/resources/redis/Secret__v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/output/resources/redis/Service__v1_redis_redis.yamle2e-tests/tests/tier0/mta_801_stateful_migration_test.go
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
1fd864d to
0a0a106
Compare
…dressing coderabbit comments Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
|
Tested on ocp clusters passed. |
|
/rfr |
|
The test logic changes (platform detection, normalization, OCP golden dir) are well-structured.
The OCP golden manifests include 7 real CA certificates from what appears to be a live OCP cluster These are CA public certificates (not private keys), so they're not secret material — but they are
In the test: The output stage is using the Export-flavored comparison function
Beyond certificates, the golden files contain:
These are all handled by normalizeUnstableFields stripping them at comparison time — which is
The RemapNamespaceInYAML function was re-indented from spaces to tabs. This is correct Go
if kind == "PersistentVolumeClaim" { if kind == "Service" { Each new if block returns early. This is consistent with the existing pattern (every kind block |
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
@istein1 Thanks for the detailed review. I addressed the two highest-priority concerns:
For the remaining points:
Given that, I’d prefer to keep this PR focused on the correctness fixes above and leave the remaining items as optional follow-up cleanup. |
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 `@e2e-tests/utils/utils.go`:
- Around line 773-780: The PersistentVolumeClaim branch in normalizeWithPath
leaves an empty metadata.annotations map after removing ignored annotations.
After the three deletes in the PVC filtering logic, remove the annotations field
when the resulting map is empty, preserving it when other annotations remain.
Add a regression test covering ignored annotations present on only one side of
the comparison.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 13cba94b-ae82-428b-b7b1-0daf834438af
📒 Files selected for processing (29)
e2e-tests/golden-manifests-ocp/redis/export/resources/redis/ConfigMap__v1_redis_kube-root-ca.crt.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ConfigMap__v1_redis_openshift-service-ca.crt.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Deployment_apps_v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/EndpointSlice_discovery.k8s.io_v1_redis_redis-r8vds.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Endpoints__v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/PersistentVolumeClaim__v1_redis_redis-data.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ReplicaSet_apps_v1_redis_redis-6b9f4c765d.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:deployers.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:image-builders.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:image-pullers.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:deployers.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:image-builders.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:image-pullers.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_builder-dockercfg-lgfpb.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_default-dockercfg-jpgs2.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_deployer-dockercfg-vf8ll.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Secret__v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_builder.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_default.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_deployer.yamle2e-tests/golden-manifests-ocp/redis/export/resources/redis/Service__v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/output/output.yamle2e-tests/golden-manifests-ocp/redis/output/resources/redis/Deployment_apps_v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/output/resources/redis/Secret__v1_redis_redis.yamle2e-tests/golden-manifests-ocp/redis/output/resources/redis/Service__v1_redis_redis.yamle2e-tests/tests/tier0/mta_801_stateful_migration_test.goe2e-tests/tests/tier0/mta_817_stateless_migration_test.goe2e-tests/utils/utils.goe2e-tests/utils/utils_test.go
🚧 Files skipped from review as they are similar to previous changes (15)
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:image-builders.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:deployers.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/Endpoints__v1_redis_redis.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/PersistentVolumeClaim__v1_redis_redis-data.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/EndpointSlice_discovery.k8s.io_v1_redis_redis-r8vds.yaml
- e2e-tests/golden-manifests-ocp/redis/output/resources/redis/Service__v1_redis_redis.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:deployers.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/Service__v1_redis_redis.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_builder.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_deployer.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:image-pullers.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_authorization.openshift.io_v1_redis_system:image-pullers.yaml
- e2e-tests/tests/tier0/mta_801_stateful_migration_test.go
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/ServiceAccount__v1_redis_default.yaml
- e2e-tests/golden-manifests-ocp/redis/export/resources/redis/RoleBinding_rbac.authorization.k8s.io_v1_redis_system:image-builders.yaml
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
Signed-off-by: M Sajid Mansoori <mmansoor@redhat.com>
Summary by CodeRabbit