[REFAC#411] internal/publisher → internal/bus rename - #412
Conversation
…411) 메타 #385 (Publisher 통합) 완료 직후 패키지 명명 정정. 도입 시점에 \"publisher\" 로 명명됐던 hub 패키지가 Kafka I/O 단일 진입점 + PriorityResolver chain + IngestionLock/PipelineGuard + RetryScheduler 등 다중 책임을 가진 worker stage 간 중심 통로 (message bus) 로 진화. 본질 (역할) 을 드러내는 worker 명명으로 정정. ## 디렉토리 / 패키지 이동 - internal/publisher/ → internal/worker/ - test/internal/publisher/ → test/internal/worker/ - 모든 파일 package 선언 publisher → worker - 진입점 파일 publisher.go → worker.go (자체 doc 일관성) ## 호출처 alias internal/processor/fetcher/worker 와 같은 worker 이름이라 import 충돌. 호출처에서 \`bus\` alias 로 import: import bus \"issuetracker/internal/worker\" 선정 근거: message bus 패턴의 표준 어휘. 여러 stage 가 발행/구독하는 중심 통로 역할 직관적 표현. Kafka 도메인 고정 없이 의도적 추상화 방향 (Consumer/Message 별칭 등) 과 일관. ## 식별자 일괄 치환 publisher.X → bus.X (~25 호출처): - publisher.New / publisher.Publisher / publisher.Consumer / publisher.Message - publisher.RetryScheduler / publisher.NewRedisDelayedRetryScheduler / publisher.RetrySchedulerHolder - publisher.SeedPublisher / publisher.UpgradePublisher / publisher.JobPublisher (인터페이스) - publisher.CrawlTopic / publisher.NewCompositeResolver / publisher.ExplicitPriorityResolver - publisher.PriorityResolver / publisher.ErrPublishSkipped ## 검증 - go build ./internal/... ./cmd/... ./pkg/... ./test/... ./examples/... — pass - go test -race -count=1 -timeout=180s ./test/... — 전 패키지 통과 - gofmt clean Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (32)
📝 WalkthroughWalkthroughThis PR renames the ChangesWorker Package Rename and Core Abstractions
🎯 2 (Simple) | ⏱️ ~12 minutes Possibly Related PRs
Suggested Labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/fetcher/domain/search/handler.go`:
- Around line 36-37: Update the inline comment that currently mentions
bus.Publish to reflect the actual API being called (PublishChained); locate the
comment near the fanout description in handler.go and replace
"bus.Publish(crawlerName=host, TargetTypeArticle)" with
"bus.PublishChained(crawlerName=host, TargetTypeArticle)" (or similar wording
matching the PublishChained signature) so the comment accurately describes the
code path and function name.
In `@internal/processor/parser/worker/parser_worker.go`:
- Around line 9-10: Update the inaccurate comments that reference bus.Publish to
reflect the actual fanout API: replace mentions of "bus.Publish" with
"PublishChained" in the parser_worker.go comment blocks (specifically the block
describing Category/TargetTypeCategory and the comment at lines ~92-93). Ensure
the comment text shows the correct fanout path (e.g., rule.Parser.ParseLinks →
PublishChained (chained jobs)) and keep the Article path wording consistent with
the real pipeline names (rule.Parser.ParsePage → ConvertPage → content store +
publish normalized).
🪄 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: 526bf137-65e4-4373-a2ea-446cfa937da3
📒 Files selected for processing (32)
cmd/issuetracker/main.gocmd/processor/main.goexamples/kafka_pipeline/main.gointernal/processor/fetcher/domain/general/chain_handler.gointernal/processor/fetcher/domain/general/sources/registry.gointernal/processor/fetcher/domain/general/types.gointernal/processor/fetcher/domain/search/handler.gointernal/processor/fetcher/rule/upgrader.gointernal/processor/fetcher/worker/manager.gointernal/processor/fetcher/worker/pool.gointernal/processor/parser/worker/parser_worker.gointernal/processor/validate/worker.gointernal/scheduler/scheduler.gointernal/scheduler/throttle.gointernal/worker/chain.gointernal/worker/guard.gointernal/worker/resolver.gointernal/worker/retry.gointernal/worker/seed.gointernal/worker/upgrade.gointernal/worker/worker.gotest/internal/processor/fetcher/domain/general/chain_handler_chromedp_routing_test.gotest/internal/processor/fetcher/domain/general/chain_handler_reparse_propagation_test.gotest/internal/processor/fetcher/worker/pool_retry_scheduler_test.gotest/internal/processor/fetcher/worker/pool_test.gotest/internal/processor/parser/worker/helpers_test.gotest/internal/processor/validate/worker_test.gotest/internal/worker/publisher_gate_test.gotest/internal/worker/publisher_ingestion_lock_test.gotest/internal/worker/retry_test.gotest/internal/worker/seed_test.gotest/internal/worker/upgrade_test.go
There was a problem hiding this comment.
Code Review
This pull request renames the internal/publisher package to internal/worker and adopts the bus alias throughout the codebase to prevent naming collisions with the fetcher worker. The review feedback focuses on ensuring that documentation and code examples within comments consistently use the bus alias instead of the raw package name worker to maintain clarity and alignment with the new architectural naming convention.
이전 commit 의 worker 명명이 internal/processor/fetcher/worker 와 충돌해 모든 호출처에서 bus alias 필수. alias 없이 패키지 이름 자체를 bus 로 변경 → 호출처 import 가 자연스럽게 정렬됨. ## 변경 - internal/worker/ → internal/bus/, package worker → package bus - test/internal/worker/ → test/internal/bus/, package worker_test → package bus_test - 진입점 file 이름 worker.go 는 그대로 유지 (패키지 hub 의미 — bus.go 도 가능했으나 추가 rename 비용 회피) - 호출처 import 갱신: - 구: import bus \"issuetracker/internal/worker\" (alias 필요) - 신: import \"issuetracker/internal/bus\" (alias 불필요, 패키지명 = bus) - test/internal/bus 내부 SUT 참조 worker.X → bus.X 일괄 치환 ## 검증 - go build ./internal/... ./cmd/... ./pkg/... ./test/... ./examples/... — pass - go test -race -count=1 -timeout=180s ./test/... — 전 패키지 통과 - gofmt clean Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…일관성 (CodeRabbit + gemini) 리뷰 피드백 9건 반영 (전부 doc comment 정정): ## CodeRabbit Minor (2건) - parser_worker.go / search/handler.go: 주석의 \"bus.Publish (chained jobs)\" 가 실제 API 명 (PublishChained) 과 불일치. PublishChained 로 정정. ## gemini Medium (7건) 주석 내 worker.X / publisher.X prefix 를 모두 bus.X 로 통일 — PR 의 alias 표준화 일관: - internal/bus/worker.go: pub := bus.New(producer, resolver, log) - internal/bus/resolver.go: composite := bus.NewCompositeResolver(...) / bus.ExplicitPriorityResolver - internal/bus/seed.go: errors.Is(err, bus.ErrPublishSkipped) / bus.Publisher - internal/bus/upgrade.go: defensive nil check (bus.New 가 log 검증 안 하므로 caller 보호) - internal/processor/fetcher/domain/general/types.go: bus.Publisher 가 본 인터페이스를 구현 - internal/processor/fetcher/rule/upgrader.go: upgradePub bus.UpgradePublisher 구현 / API / 동작 무변경 — 순수 doc 정정. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
연관 이슈
Closes #411
구현 내용
메타 #385 (Publisher 통합) 완료 직후 패키지 명명 정정. 도입 시점에 "publisher" 로 명명됐던 hub 패키지가 Kafka I/O 단일 진입점 + PriorityResolver chain + IngestionLock/PipelineGuard + RetryScheduler 등 다중 책임을 갖는 worker stage 간 중심 통로 (message bus) 로 진화함에 따라 명명 정정.
디렉토리 / 패키지 이동
package publisher→package workerpublisher.go→worker.go(자체 doc 일관성)호출처 import alias
internal/processor/fetcher/worker와 같은worker이름이라 import 충돌. 호출처에서busalias 로 import:bus단어 선정 근거: message bus 패턴의 표준 어휘. 여러 stage (fetcher / parser / validate) 가 발행/구독하는 중심 통로 역할을 직관적으로 표현. Kafka 도메인 고정 없이 의도적 추상화 방향 (Consumer/Message 별칭 등) 과 일관.식별자 일괄 치환 (~25 호출처)
publisher.X→bus.X:New,PublisherConsumer,MessageRetryScheduler,NewKafkaImmediateRetryScheduler,NewRedisDelayedRetryScheduler,RetrySchedulerHolder,RedisRetrySchedulerConfig,DefaultRedisRetrySchedulerConfigSeedPublisher,UpgradePublisher,JobPublisherCrawlTopic,NewCompositeResolver,ExplicitPriorityResolver,SourcePriorityResolver,RuleBasedPriorityResolver,PriorityResolverErrPublishSkippedCI / 머지 게이트 점검
gofmt -l internal/ cmd/ test/ pkg/ examples/— cleango build ./internal/... ./cmd/... ./pkg/... ./test/... ./examples/...— passgo test -race -count=1 -timeout=180s ./test/...— 전 패키지 통과[REFAC#411][REFAC]:prefix + 한국어변경 영향 범위 + 위험도
후속
롤백 계획
PR revert 시 32 파일 동시 원복 — 디렉토리 / 패키지 / 호출처 모두 동시에 publisher 로 복귀.
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes