DaleStudy / DaleStudy/github

refactor: 패턴 분석 코멘트도 학습 현황처럼 upsert(PATCH) 방식으로 전환

Open
#23 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Description

배경

현재 패턴 분석 코멘트 (handlers/tag-patterns.js)는 매 push마다
기존 봇 코멘트를 전부 DELETE한 뒤 새로 POST하는 방식으로 갱신됨.

반면 학습 현황 코멘트 (utils/learningComment.js upsertLearningStatusComment)는
marker로 기존 코멘트를 찾아 PATCH로 body만 업데이트하는 upsert 패턴을 사용 중.

#20 에서 synchronize 최적화가 들어가면서,
변경된 파일에 한정해서는 "기존 코멘트를 edit"하는 형태가 자연스러움.

제안

변경된 파일의 패턴 분석 코멘트를 delete + repost → PATCH (edit in place) 로 전환.

  • PR review 코멘트도 PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}로 body 수정 가능
  • 파일명(comment.path)을 키로 기존 봇 코멘트를 찾아 upsert
    • 존재하면 PATCH body
    • 없으면 POST (신규 파일)

기대 효과

  • delete → create로 인한 알림/웹훅 노이즈 제거
  • 학습 현황 코멘트와 일관된 upsert 패턴으로 코드 단순화
  • 코멘트 ID가 push 간에 안정적으로 유지됨 (영구 링크 가능)

참고

  • Learning status 참고 구현: utils/learningComment.js:232 upsertLearningStatusComment
  • Pattern tag 현재 구현: handlers/tag-patterns.js:75, 104-154
  • 관련 PR: #20

Trade-off (작은 이슈, blocker 아님)

PATCH는 commit_id를 바꾸지 않으므로, 원본 커밋이 history에서 멀어지면
GitHub UI가 "Outdated" 배지를 붙일 수 있음. subject_type: "file" 코멘트는
라인 코멘트보다 덜 aggressive하게 처리되는 편이라 실사용상 큰 문제 없을 것으로 예상.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with handlers/tag-patterns.js:75 and 104-154, then compare the marker-based implementation at utils/learningComment.js:232. Trace how existing bot comments are identified by comment.path and verify the GitHub review-comment PATCH and POST calls. Done means changed-file comments are edited in place when found and created only for new files, without delete-and-repost behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.