Repository navigation
fix: 게임 빌드 웹훅을 업로드 중인 빌드에만 반영한다 - #152
Merged
Merged
Conversation
완료 웹훅이 빌드의 현재 상태를 보지 않아, 다시 보내거나 늦게 도착한 웹훅이 보관된 옛 빌드를 다시 활성화하거나(현재 빌드는 보관됨), 활성 빌드를 FAILED로 내릴 수 있었다. - 상태 전이 규칙을 GameBuild에 둔다: ACTIVE·FAILED 반영은 PROCESSING에서만, 아니면 409. 같은 결과의 재전송(ACTIVE->ACTIVE, FAILED->FAILED)은 아무것도 바꾸지 않고 204. - 같은 빌드에 대한 동시 웹훅이 엇갈리지 않게 빌드 행을 잠그고 읽는다.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit details
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 |
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.
요약
홈페이지 서버의 완료 웹훅(
POST /v1/games/builds/{id}/webhook)이 빌드의 현재 상태를 보지 않고 결과를 덮어썼다. 그래서:변경
GameBuild.applyActive/markFailed)에 둔다.PROCESSING)인 빌드에서만 한다. 그 밖의 상태면409 GAME_BUILD_INVALID_STATE(이미 있던 "이 상태의 빌드에는 처리할 수 없습니다").PENDING/PROCESSING/FAILED→PROCESSING)은 그대로라, 실패한 빌드는 지금처럼 토큰을 다시 받아 재업로드할 수 있다.findByIdForUpdate로 빌드 행을 잠그고 읽는다.남은 위험
"게임당 활성 빌드 1개"는 여전히 애플리케이션이 지킨다. 한 게임의 서로 다른 두 빌드가 동시에 활성화되면 둘 다 ACTIVE로 남을 수 있다(관리자가 빌드를 하나씩 올리므로 현실적으로 드묾). 정석은
game_build (game_id) WHERE status = 'ACTIVE'부분 유니크 인덱스인데, 운영 데이터에 이미 중복이 있으면 마이그레이션이 실패해 앱이 뜨지 않으므로 운영 DB를 확인할 수 있을 때 따로 넣는다.테스트
AdminGameBuildIntegrationTest에 4건 추가 — 모두 수정 전 코드에서 실패함을 확인했다.로컬 전체
./gradlew test: 544건 중 543 통과, 1 스킵.