Skip to content

[REFAC#276] main.go 헬퍼 메소드를 적합한 패키지로 이동 - #277

Merged
juhy0987 merged 4 commits into
mainfrom
refactor/#276/main-helpers-relocate
May 6, 2026
Merged

juhy0987 merged 4 commits into
mainfrom
refactor/#276/main-helpers-relocate

Conversation

@juhy0987

@juhy0987 juhy0987 commented May 6, 2026

Copy link
Copy Markdown
Member

연관 이슈


구현 내용

cmd/issuetracker/main.go (794 lines) 에서 main 책임 (DI / lifecycle 관리) 과 무관한 헬퍼 메소드 4개를 각 도메인 패키지로 이동.

시그니처 보존 + 로직 변경 0 — 순수 이동만.

이동 매핑

현재 위치 함수 이동 후 위치 / 명
main.go:667 buildLLMProvider pkg/llm/wiring/wiring.go BuildProvider
main.go:710 buildLLMGenerator internal/processor/parser/rule/llmgen/wiring.go Build
main.go:730 buildRefiner internal/processor/parser/rule/refiner/wiring.go Build
main.go:772 verifyParsingRulesSeeded internal/processor/parser/rule/seeded.go VerifySeeded

부가 개선

  • verifyParsingRulesSeeded 의 하드코딩 site 목록을 seededHostTargets package var 로 분리 — 추가 검증 / 외부화 작업 시 단일 지점.

main.go 영향

  • 794 lines → 650 lines (-144)
  • 미사용 imports 6개 제거 (fmt, prometheus, storage, llm, chain, policy)
  • pkg/llm/wiring import 1개 추가 (alias llmwiring)

CI / 머지 게이트 점검

CI 운영 규약Required Status Checks 단일 소스에 따라 작성합니다.

변경 영향 범위

  • 영향 패키지/모듈: cmd/issuetracker, pkg/llm/wiring (신규), internal/processor/parser/rule, internal/processor/parser/rule/llmgen, internal/processor/parser/rule/refiner
  • 위험도: Low — 시그니처 / 동작 변경 0, 패키지 이동만

Required Status Checks

  • 통과 확인 대상:
    • Commit Lint
    • PR Title Lint
    • Linked Issue Check
    • Build
    • Test
    • Lint

로컬 검증

  • make fmt 통과
  • make build 5개 binary 모두 통과
  • go test -race ./... 전체 통과
  • go vet ./... 통과

롤백 계획

본 PR 은 코드 이동만으로 동작 변경 없음. 단순 revert 만으로 즉시 롤백 가능.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Introduced modular wiring for LLM, LLM-generation, and refiner components to simplify startup assembly.
    • Removed several local builders in favor of public wiring entry points for cleaner initialization flow.
    • Improved modularity and separation of concerns across component startup.
  • Bug Fix

    • Centralized parsing-rule seed verification into a public readiness check to improve startup reliability.

main 의 책임 (DI / lifecycle 관리) 과 무관한 헬퍼 메소드를 각 도메인 패키지로
이동. 시그니처 보존 + 로직 변경 0 — 순수 이동.

이동 매핑:
- buildLLMProvider     → pkg/llm/wiring.BuildProvider
  (LLM provider 조립 — llmgen + refiner 공유, neutral 위치)
- buildLLMGenerator    → llmgen.Build
  (llmgen.New + Redis locker setup)
- buildRefiner         → refiner.Build
  (refiner.New + RefinementConfig 로딩)
- verifyParsingRulesSeeded → rule.VerifySeeded
  (하드코딩 site 목록 + parsing_rules 도메인 검증, seededHostTargets var 분리)

main.go 794 lines → 650 lines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 6, 2026 03:10
@juhy0987 juhy0987 added the refactor Code refactoring label May 6, 2026
@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@juhy0987 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 55 minutes and 2 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ead2d131-6a2b-4e93-851f-788620884d51

📥 Commits

Reviewing files that changed from the base of the PR and between 0836e96 and 72d1892.

📒 Files selected for processing (1)
  • internal/processor/parser/rule/refiner/wiring/wiring.go
📝 Walkthrough

Walkthrough

Replaces local builder/helpers in cmd/issuetracker/main.go with public wiring packages and a seed verifier: introduces pkg/llm/wiring.BuildProvider, internal/processor/parser/rule/llmgen/wiring.Build, internal/processor/parser/rule/refiner/wiring.Build, and internal/processor/parser/rule/VerifySeeded; updates imports and startup wiring accordingly.

Changes

Initialization & Wiring Refactor

Layer / File(s) Summary
New Wiring: provider assembly
pkg/llm/wiring/wiring.go
Adds BuildProvider(log *logger.Logger) llm.Provider to load LLM config, handle disabled/missing keys, construct an llm provider, wrap with policy.FixedOrder, and return a composed chain provider.
New Wiring: llmgen generator
internal/processor/parser/rule/llmgen/wiring/wiring.go
Adds Build(provider llm.Provider, repo storage.ParsingRuleRepository, resolver *rule.Resolver, redisClient *redis.Client, log *logger.Logger) (*llmgen.Generator, error) which short-circuits when provider is nil, constructs llmgen.Generator, and optionally wires a Redis inflight locker.
New Wiring: refiner
internal/processor/parser/rule/refiner/wiring/wiring.go
Adds Build(provider llm.Provider, rules storage.ParsingRuleRepository, samples storage.SampleURLRepository, resolver *rule.Resolver, metricsRegistry *prometheus.Registry, log *logger.Logger) (*refiner.Refiner, error) to load refinement config, optionally attach an LLM adapter, and construct the refiner or return (nil, nil) when disabled.
Seed verification extraction
internal/processor/parser/rule/seeded.go
Adds VerifySeeded(ctx context.Context, resolver *Resolver) error and a hardcoded seededHostTargets list; iterates entries and verifies corresponding active parsing rules exist via resolver.Resolve.
Main wiring updates
cmd/issuetracker/main.go
Replaces local builders and verifyParsingRulesSeeded calls with public wiring APIs (llmwiring.BuildProvider, llmgenwiring.Build, refinerwiring.Build, rule.VerifySeeded); updates imports and startup readiness checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement, refactor, cleanup

Poem

🐰 I hopped from main to tidy nests so fine,
Wiring bundled up in packages, aligned.
Seeds checked at dawn, providers set in line,
A cleaner startup, tiny rabbit's sign. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive The refiner wiring config error handling was changed from silent-disable to explicit error return (fmt.Errorf wrapper), which appears to be an intentional improvement noted in commit message but slightly exceeds pure refactoring scope. Clarify whether the refiner wiring error handling change is in scope for issue #276 or should be separated into a distinct improvement issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title references REFAC#276 and describes moving helper methods from main.go to appropriate packages, which aligns with the actual code changes shown in the changeset.
Linked Issues check ✅ Passed All four required functions have been moved to their designated packages with preserved signatures: buildLLMProvider→BuildProvider, buildLLMGenerator→Build, buildRefiner→Build, verifyParsingRulesSeeded→VerifySeeded. Seed data extracted to seededHostTargets variable. Build/test passing confirmed.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#276/main-helpers-relocate

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the main.go entry point by moving wiring and initialization logic for LLM providers, generators, and refiners into dedicated packages. This improves modularity by separating domain logic from infrastructure setup. Feedback from the review indicates that the new Build functions in the llmgen and refiner packages should return errors instead of calling log.Fatal to improve testability and reusability. Additionally, there is a recommendation to further decouple the refiner package from the configuration layer by moving its wiring logic to a separate package.

Comment thread internal/processor/parser/rule/llmgen/wiring.go Outdated
Comment thread internal/processor/parser/rule/refiner/wiring.go Outdated
@juhy0987 juhy0987 self-assigned this May 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

이 PR은 cmd/issuetracker/main.go에 있던 main 책임(DI/lifecycle)과 무관한 헬퍼 함수 4개를 각 도메인 패키지로 이동시켜, main.go를 슬림하게 유지하고 wiring 책임을 패키지 경계에 맞게 재배치합니다.

Changes:

  • LLM provider 조립 로직을 pkg/llm/wiring.BuildProvider로 이동
  • LLM generator/refiner 구성 로직을 각각 llmgen.Build, refiner.Build로 이동
  • parsing_rules seed 검증 로직을 rule.VerifySeeded로 이동하고 seed 타겟 목록을 package var로 분리

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/issuetracker/main.go 기존 헬퍼 호출부를 신규 wiring 함수들로 교체하고 불필요 import 제거
pkg/llm/wiring/wiring.go 환경변수/config 기반 LLM provider 구성 헬퍼(BuildProvider) 신설
internal/processor/parser/rule/llmgen/wiring.go LLM generator 구성 헬퍼(Build)를 llmgen 패키지로 이동
internal/processor/parser/rule/refiner/wiring.go Refiner 구성 헬퍼(Build)를 refiner 패키지로 이동
internal/processor/parser/rule/seeded.go parsing_rules seed 검증 헬퍼(VerifySeeded) 및 seed 타겟 목록 분리

Comment thread internal/processor/parser/rule/llmgen/wiring.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmd/issuetracker/main.go (1)

454-466: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update stale comments referencing the removed buildLLMGenerator.

Lines 456 and 463 still mention buildLLMGenerator, which no longer exists in this file (now llmgen.Build). Worth updating during this move so future readers don’t grep for a dead symbol.

Suggested wording
-  // 미지정 / gemini (기본) 일 때는 buildLLMGenerator 가 설정한 기본 LLM provider 추출.
+  // 미지정 / gemini (기본) 일 때는 llmgen.Build 가 설정한 기본 LLM provider 추출.
@@
-    // 기본 경로 — 분기 미발생 (Gemini 등 buildLLMGenerator 의 provider 사용).
+    // 기본 경로 — 분기 미발생 (Gemini 등 llmgen.Build 의 provider 사용).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/issuetracker/main.go` around lines 454 - 466, Update the stale comments
and log message that reference the removed symbol buildLLMGenerator to the new
API llmgen.Build so readers can find the correct symbol; locate the block around
the llmExtractor switch that mentions buildLLMGenerator and change those comment
text occurrences to reference llmgen.Build, and update any explanatory text in
the log.Warn call related to buildLLMGenerator to mention llmgen.Build (symbols
to inspect: buildLLMGenerator, llmgen.Build, llmGen, claudegen.ClaudeWorker, and
the log.Warn message).
🧹 Nitpick comments (2)
internal/processor/parser/rule/llmgen/wiring.go (1)

18-18: 💤 Low value

Wrap the Build signature for line-length and consistency.

Line 18 exceeds the 100-character guideline, and the sibling refiner.Build already uses a multi-line signature. Wrapping it here keeps both wiring entry points stylistically aligned.

Proposed formatting
-func Build(provider llm.Provider, repo storage.ParsingRuleRepository, resolver *rule.Resolver, redisClient *redis.Client, log *logger.Logger) *Generator {
+func Build(
+  provider llm.Provider,
+  repo storage.ParsingRuleRepository,
+  resolver *rule.Resolver,
+  redisClient *redis.Client,
+  log *logger.Logger,
+) *Generator {

As per coding guidelines: "Maximum line length of 100 characters in Go code".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/processor/parser/rule/llmgen/wiring.go` at line 18, The Build
function signature exceeds the 100-char limit; reformat the declaration for the
Generator constructor so parameters are on separate lines like the sibling
refiner.Build. Locate func Build(provider llm.Provider, repo
storage.ParsingRuleRepository, resolver *rule.Resolver, redisClient
*redis.Client, log *logger.Logger) *Generator and wrap the parameter list across
multiple lines (one or two params per line) while keeping the same parameter
types (llm.Provider, storage.ParsingRuleRepository, *rule.Resolver,
*redis.Client, *logger.Logger) and return type *Generator to maintain style and
line-length consistency.
internal/processor/parser/rule/refiner/wiring.go (1)

20-27: ⚡ Quick win

Consider grouping Build parameters into a Deps struct (follow-up).

Build takes 6 parameters, which exceeds the 5-parameter guideline. The PR is a pure move so I’m not asking you to change the signature here, but as a follow-up consider a Deps/Options struct (e.g., Deps{Provider, Rules, Samples, Resolver, MetricsRegistry, Log}) — this also makes future additions (new repos, additional registries) backward-compatible without ABI churn for cmd/* callers.

As per coding guidelines: "Functions must have maximum 5 parameters; use structs for multiple parameters in Go".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/processor/parser/rule/refiner/wiring.go` around lines 20 - 27, Build
currently accepts six positional parameters (provider, rules, samples, resolver,
metricsRegistry, log); refactor by introducing a Deps (or Options) struct
containing those fields (Provider llm.Provider, Rules
storage.ParsingRuleRepository, Samples storage.SampleURLRepository, Resolver
*rule.Resolver, MetricsRegistry *prometheus.Registry, Log *logger.Logger) and
change Build to accept a single Deps parameter (e.g., Build(deps Deps)
*Refiner); update all internal call sites (including cmd/* callers) to construct
and pass the Deps value, and consider adding a small NewDeps/WithDefaults helper
if needed to ease caller changes and avoid ABI churn in future.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@cmd/issuetracker/main.go`:
- Around line 454-466: Update the stale comments and log message that reference
the removed symbol buildLLMGenerator to the new API llmgen.Build so readers can
find the correct symbol; locate the block around the llmExtractor switch that
mentions buildLLMGenerator and change those comment text occurrences to
reference llmgen.Build, and update any explanatory text in the log.Warn call
related to buildLLMGenerator to mention llmgen.Build (symbols to inspect:
buildLLMGenerator, llmgen.Build, llmGen, claudegen.ClaudeWorker, and the
log.Warn message).

---

Nitpick comments:
In `@internal/processor/parser/rule/llmgen/wiring.go`:
- Line 18: The Build function signature exceeds the 100-char limit; reformat the
declaration for the Generator constructor so parameters are on separate lines
like the sibling refiner.Build. Locate func Build(provider llm.Provider, repo
storage.ParsingRuleRepository, resolver *rule.Resolver, redisClient
*redis.Client, log *logger.Logger) *Generator and wrap the parameter list across
multiple lines (one or two params per line) while keeping the same parameter
types (llm.Provider, storage.ParsingRuleRepository, *rule.Resolver,
*redis.Client, *logger.Logger) and return type *Generator to maintain style and
line-length consistency.

In `@internal/processor/parser/rule/refiner/wiring.go`:
- Around line 20-27: Build currently accepts six positional parameters
(provider, rules, samples, resolver, metricsRegistry, log); refactor by
introducing a Deps (or Options) struct containing those fields (Provider
llm.Provider, Rules storage.ParsingRuleRepository, Samples
storage.SampleURLRepository, Resolver *rule.Resolver, MetricsRegistry
*prometheus.Registry, Log *logger.Logger) and change Build to accept a single
Deps parameter (e.g., Build(deps Deps) *Refiner); update all internal call sites
(including cmd/* callers) to construct and pass the Deps value, and consider
adding a small NewDeps/WithDefaults helper if needed to ease caller changes and
avoid ABI churn in future.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 94754961-328b-49ac-aa8f-e0ef56111634

📥 Commits

Reviewing files that changed from the base of the PR and between a3d10aa and f539e76.

📒 Files selected for processing (5)
  • cmd/issuetracker/main.go
  • internal/processor/parser/rule/llmgen/wiring.go
  • internal/processor/parser/rule/refiner/wiring.go
  • internal/processor/parser/rule/seeded.go
  • pkg/llm/wiring/wiring.go

gemini-code-assist 2건 + Copilot 1건 리뷰 반영:

1. (gemini, llmgen.Build) 도메인 패키지에서 log.Fatal 호출 지양 — 라이브러리
   재사용 / 테스트 어렵게 함. 에러 반환 + main 이 Fatal 결정.
2. (gemini, refiner.Build) log.Fatal + pkg/config 직접 의존 — pkg/llm/wiring
   사례처럼 wiring sub-package 로 분리 권장.
3. (Copilot) llmgen.Build GoDoc 이 이전 buildLLMProvider (main 내부 헬퍼) 를
   참조 — 현재 구조 (pkg/llm/wiring.BuildProvider) 반영.

변경 사항:
- internal/processor/parser/rule/llmgen/wiring.go (same package)
  → internal/processor/parser/rule/llmgen/wiring/wiring.go (sub-package)
- internal/processor/parser/rule/refiner/wiring.go (same package)
  → internal/processor/parser/rule/refiner/wiring/wiring.go (sub-package)
- 두 Build 모두 시그니처 (..., error) 로 변경 — log.Fatal 제거, fmt.Errorf wrap
- main.go 호출부에서 에러 처리 (Fatal)
- llmgen wiring GoDoc 에 pkg/llm/wiring.BuildProvider 명시

이로써 도메인 패키지 (llmgen / refiner) 는 pkg/config 등 인프라 설정에
직접 의존하지 않으며, wiring 서브패키지가 그 결합을 흡수.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/processor/parser/rule/refiner/wiring/wiring.go`:
- Around line 36-39: The current logic treats failures from
config.LoadRefinement() as non-fatal by logging a warning and returning (nil,
nil); change this so a failed load returns the error instead of silently
disabling refinement: when config.LoadRefinement() returns an error, propagate
that error (return nil, err or a wrapped error) rather than returning (nil,
nil); keep returning (nil, nil) only for the explicit case where cfg.Enabled is
false (cfg.Enabled check), and ensure callers receive an error for malformed
config values.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 28f8f256-3faa-4c20-8655-5c336c127cbb

📥 Commits

Reviewing files that changed from the base of the PR and between f539e76 and 855832b.

📒 Files selected for processing (3)
  • cmd/issuetracker/main.go
  • internal/processor/parser/rule/llmgen/wiring/wiring.go
  • internal/processor/parser/rule/refiner/wiring/wiring.go

Comment thread internal/processor/parser/rule/refiner/wiring/wiring.go Outdated
CodeRabbit 리뷰 반영: refiner/wiring/wiring.go 의 config.LoadRefinement()
실패가 warn + (nil, nil) 로 silent disable → malformed env 값이 refiner 를
조용히 끄고 main 의 error-return 경로 우회.

(nil, nil) 은 explicit !cfg.Enabled 경로에 한정. config load 실패는
fmt.Errorf wrap 하여 명시적으로 에러 반환 — 호출자 (main) 가 Fatal 결정.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/processor/parser/rule/refiner/wiring/wiring.go (1)

28-35: ⚡ Quick win

Build has 6 parameters — exceeds the 5-parameter limit; consider an Options struct.

As per coding guidelines, Go functions must have a maximum of 5 parameters; when exceeded, parameters should be grouped into an Options/Config struct. Build accepts 6: provider, rules, samples, resolver, metricsRegistry, log.

♻️ Proposed refactor
+// Options holds the dependencies required to construct a refiner.Refiner.
+type Options struct {
+  Provider        llm.Provider
+  Rules           storage.ParsingRuleRepository
+  Samples         storage.SampleURLRepository
+  Resolver        *rule.Resolver
+  MetricsRegistry *prometheus.Registry
+  Log             *logger.Logger
+}
+
-func Build(
-  provider llm.Provider,
-  rules storage.ParsingRuleRepository,
-  samples storage.SampleURLRepository,
-  resolver *rule.Resolver,
-  metricsRegistry *prometheus.Registry,
-  log *logger.Logger,
-) (*refiner.Refiner, error) {
+func Build(opts Options) (*refiner.Refiner, error) {

Then update all internal references from provideropts.Provider, rulesopts.Rules, etc.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/processor/parser/rule/refiner/wiring/wiring.go` around lines 28 -
35, Build currently takes six parameters (provider, rules, samples, resolver,
metricsRegistry, log) which violates the 5-parameter rule; create a new
options/config struct (e.g., RefinerOptions) that contains fields Provider
llm.Provider, Rules storage.ParsingRuleRepository, Samples
storage.SampleURLRepository, Resolver *rule.Resolver, MetricsRegistry
*prometheus.Registry, Log *logger.Logger, change the Build signature to
Build(opts RefinerOptions) (*refiner.Refiner, error), update the function body
to reference opts.Provider, opts.Rules, etc., and then update all call sites
that invoke Build(...) to construct and pass a RefinerOptions value instead of
positional parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/processor/parser/rule/refiner/wiring/wiring.go`:
- Line 23: Update the stale GoDoc in
internal/processor/parser/rule/refiner/wiring/wiring.go: remove or change the
clause that claims "(nil, nil) 은 ... config load 실패 시" so the comment matches
current behavior (per PR `#277`) — i.e., document that (nil, nil) only indicates
refinement disabled (REINMENT_ENABLED=false) and that config load failures now
return (nil, error); locate the comment containing the literal "(nil, nil) 은 정밀화
비활성..." and adjust it to explicitly state the new return semantics.

---

Nitpick comments:
In `@internal/processor/parser/rule/refiner/wiring/wiring.go`:
- Around line 28-35: Build currently takes six parameters (provider, rules,
samples, resolver, metricsRegistry, log) which violates the 5-parameter rule;
create a new options/config struct (e.g., RefinerOptions) that contains fields
Provider llm.Provider, Rules storage.ParsingRuleRepository, Samples
storage.SampleURLRepository, Resolver *rule.Resolver, MetricsRegistry
*prometheus.Registry, Log *logger.Logger, change the Build signature to
Build(opts RefinerOptions) (*refiner.Refiner, error), update the function body
to reference opts.Provider, opts.Rules, etc., and then update all call sites
that invoke Build(...) to construct and pass a RefinerOptions value instead of
positional parameters.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 34048b12-c864-490b-accf-91cbe86490c3

📥 Commits

Reviewing files that changed from the base of the PR and between 855832b and 0836e96.

📒 Files selected for processing (1)
  • internal/processor/parser/rule/refiner/wiring/wiring.go

Comment thread internal/processor/parser/rule/refiner/wiring/wiring.go Outdated
CodeRabbit 리뷰 반영: 직전 commit 0836e96 으로 config load 실패가 (nil, error)
로 변경됐으나 GoDoc 이 여전히 (nil, nil) 로 표기. 현재 시그니처 반영.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@juhy0987
juhy0987 merged commit ec263ae into main May 6, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] cmd/issuetracker/main.go 헬퍼 메소드를 적합한 패키지로 이동

2 participants