fix: SchemaSpy 문서 생성 output 권한 실패 수정 - #101
Conversation
CI 러너(uid 1001)와 SchemaSpy 컨테이너의 java 유저(uid 1000)가 달라 마운트된 output 디렉터리에 쓰지 못해 "Unable to create directory /output/tables" 로 실패했다. run.sh 에서 output 생성 후 chmod 777 로 uid 의존성을 제거. 로컬에서 schemaspy 를 uid 1001 로 강제 실행해 CI 조건 재현 → 픽스 후 정상 생성 확인. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c26d9106d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # SchemaSpy 컨테이너는 'java'(uid 1000) 유저로 실행된다. CI 러너 등 호스트 uid 가 | ||
| # 다르면 마운트된 output 에 쓰지 못하므로(=Unable to create directory /output/tables) | ||
| # uid 의존성을 없애기 위해 쓰기 권한을 개방한다. | ||
| chmod 777 output |
There was a problem hiding this comment.
Make generated SchemaSpy files removable on reused workspaces
When ./schemaspy/run.sh gen runs on a host whose user is not the container's uid 1000 and the workspace is reused, this only opens the empty top-level output directory before SchemaSpy writes into it. SchemaSpy then creates nested directories such as output/tables as uid 1000 with its normal non-world-writable directory mode, so the next invocation fails at the earlier rm -rf output before it can reach this chmod. I checked chmod --help; recursive changes require -R, so a post-generation chmod/chown (or running the container as the host uid) is needed to actually remove the uid dependency across repeated runs.
Useful? React with 👍 / 👎.
문제
PR #100 머지 후 첫 prod 배포에서 SchemaSpy 문서 생성 단계가 실패:
continue-on-error로 배포 자체는 성공했으나 이미지에/schema문서가 누락됨.원인
SchemaSpy 컨테이너는
java유저(이미지 내 uid 1000)로 실행되는데, CI 러너 uid(1001)와 달라마운트된
output디렉터리에 쓰지 못함. (로컬은 uid 1000 우연 일치로 통과했었음)수정
run.sh에서output생성 후chmod 777로 uid 의존성 제거.검증
로컬에서
docker compose run --user 1001:1001 schemaspy로 CI 조건을 재현 →수정 후 exit 0, 15개 테이블 문서 정상 생성 확인.
🤖 Generated with Claude Code