fix(api): v1alpha2 Hub 필드 유실 3건 추가 복원 + 전 타입 무손실 왕복 테스트 - #316
Merged
Conversation
#314 에서 ValkeyBackup/ValkeyRestore 의 유실 필드 2건을 고쳤으나, 그때는 "이미 테스트가 있던" Valkey/ValkeyCluster/BackupTarget 을 재검사하지 않았다. 필드 단위 수동 단언은 **빠뜨린 필드를 잡지 못한다** — 실제로 3건이 더 숨어 있었다: ValkeySpec.slowLog → Hub 에 SlowLogSpec 타입 자체가 없음 ValkeyClusterSpec.slowLog → 동일 ValkeyBackupTargetSpec.gcs → Hub 에 GCSSpec 계열 타입 없음 ValkeyBackupTargetSpec.azure → Hub 에 AzureSpec 계열 타입 없음 백업 target 이 GCS/Azure 면 **대상 자체가 사라진다**. 변환이 JSON byte-copy 라 대응 태그가 없으면 에러 없이 소실된다 (#314 와 동일 기전). 누락 타입·필드를 Hub 에 복원해 **5 타입 전 필드 패리티** 를 달성했다(순수 추가, 기존 CR 영향 0). 그리고 같은 실수가 재발하지 않도록 테스트를 필드 열거형에서 **전 필드 왕복 비교**로 바꾼다 — v1alpha1 객체를 JSON 으로 채워 왕복시킨 뒤 원본 JSON 과 완전 일치를 요구하므로, 앞으로 v1alpha1 에 필드가 추가되면 Hub 에 함께 넣지 않는 한 이 테스트가 막는다. verify: - 수정 전: 6 케이스 중 Valkey/ValkeyCluster/BackupTarget 왕복 불일치 검출 (FAIL) - 수정 후: 6/6 PASS - 필드 패리티 스캔: 5 타입 전부 "유실 필드 None" - make test 회귀 0 (총 41.5%) Signed-off-by: 태환 박 <phil@keiailab.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#314 는 절반이었습니다
#314 에서
ValkeyBackup/ValkeyRestore의 유실 필드 2건을 고쳤지만, 그때 "이미 테스트가 있던"Valkey/ValkeyCluster/BackupTarget은 재검사하지 않았습니다. 필드 단위 수동 단언은 빠뜨린 필드를 잡지 못합니다 — 실제로 3건이 더 숨어 있었습니다:ValkeySpec.slowLogSlowLogSpec타입 자체가 없음ValkeyClusterSpec.slowLogValkeyBackupTargetSpec.gcsGCSSpec계열 타입 없음ValkeyBackupTargetSpec.azureAzureSpec계열 타입 없음변환이 JSON byte-copy 라 대응 태그가 없으면 에러 없이 소실됩니다(#314 와 동일 기전).
수정
누락 타입·필드를 Hub 에 복원해 5 타입 전 필드 패리티를 달성했습니다(순수 추가, 기존 CR 영향 0).
재발 방지 — 테스트를 열거형에서 왕복 비교로
같은 실수(필드를 빠뜨림)가 반복되지 않도록 필드를 열거하지 않는 테스트를 넣었습니다. v1alpha1 객체를 JSON 으로 채워
ConvertTo→ConvertFrom왕복시킨 뒤 원본 JSON 과 완전 일치를 요구합니다. 앞으로 v1alpha1 에 필드가 추가되면 Hub 에 함께 넣지 않는 한 이 테스트가 막습니다.Verify (양방향 실증)
🤖 Generated with Claude Code
https://claude.ai/code/session_01QGCUdVQyTLSCiHoi5wiouH