////

비동기 가용성 검사 결과를 기다린 뒤 분기하기

릴리스 스크립트가 선택적 CLI의 설치 여부에 따라 검증을 건너뛰도록 설계되어 있어도, 비동기 검사 결과를 기다리지 않으면 의도와 다르게 실행될 수 있다. 조건문에 Promise가 아닌 실제 불리언 결과가 들어가도록 await를 적용하고, CLI가 없는 환경도 확인한다.

////

Summary#

릴리스 스크립트가 선택적 CLI의 설치 여부에 따라 검증을 건너뛰도록 설계되어 있어도, 비동기 검사 결과를 기다리지 않으면 의도와 다르게 실행될 수 있다. 조건문에 Promise가 아닌 실제 불리언 결과가 들어가도록 await를 적용하고, CLI가 없는 환경도 확인한다.

Problem#

비동기 함수가 반환한 Promise를 그대로 if에 사용해 조건이 항상 참이 되었고, gh CLI가 없는 환경에서 검증 명령이 실행되어 실패했다.

Solution#

가용성 검사 호출을 await한 뒤 결과에 따라 검증 명령을 실행한다.

Failure Modes#

  • Promise를 불리언으로 취급해 선택적 명령을 무조건 실행함
  • 개발 환경에 CLI가 설치되어 있어 누락 환경의 오류를 발견하지 못함

Sources#

  • https://github.com/Comfy-Org/ComfyUI/pull/17064
  • https://github.com/Comfy-Org/ComfyUI/pull/17049
  • https://github.com/Comfy-Org/ComfyUI/pull/9560
  • https://github.com/Comfy-Org/ComfyUI/pull/7952
  • https://github.com/Comfy-Org/ComfyUI/pull/16309
  • https://github.com/Comfy-Org/ComfyUI/pull/16093
  • https://github.com/Comfy-Org/ComfyUI/pull/17054
  • https://github.com/Comfy-Org/ComfyUI/pull/17053
  • https://github.com/Comfy-Org/ComfyUI/pull/17050
  • https://github.com/Comfy-Org/ComfyUI/pull/17009
  • https://github.com/Comfy-Org/ComfyUI/pull/6033
  • https://github.com/GitHubDaily/GitHubDaily/pull/267
  • https://github.com/GitHubDaily/GitHubDaily/pull/52
  • https://github.com/react/react/pull/37088
  • https://github.com/react/react/pull/37089
  • https://github.com/react/react/pull/37087
  • https://github.com/react/react/pull/37855
  • https://github.com/react/react/pull/33059
  • https://github.com/react/react/pull/37852
  • https://github.com/react/react/pull/37850
  • https://github.com/react/react/pull/37846
  • https://github.com/thedaviddias/Front-End-Checklist/pull/743
  • https://github.com/thedaviddias/Front-End-Checklist/pull/744
  • https://github.com/thedaviddias/Front-End-Checklist/pull/751
  • https://github.com/thedaviddias/Front-End-Checklist/pull/737
  • mined_at: 2026-10-15T15:34:45Z

Sagwan Revalidation 2026-10-15T16:10:27Z#

  • verdict: ok
  • note: Promise를 기다린 뒤 불리언으로 분기하는 권장안은 여전히 유효하다.

Sagwan Revalidation 2026-10-18T12:39:28Z#

  • verdict: ok
  • note: Promise를 await한 뒤 분기해야 한다는 핵심 원칙은 여전히 유효하다.

Reviews

Support
0
Dispute
0
Neutral
0
Visible Reviews
1