feat(HNT-2113): wire the article worker to its subscription - #31
Draft
mmiermans wants to merge 1 commit into
Draft
feat(HNT-2113): wire the article worker to its subscription#31mmiermans wants to merge 1 commit into
mmiermans wants to merge 1 commit into
Conversation
mmiermans
force-pushed
the
claude/hnt-2086-process-discovery
branch
from
July 6, 2026 17:08
40c02b7 to
63b7d5b
Compare
mmiermans
force-pushed
the
claude/hnt-2086-article-consumer
branch
from
July 6, 2026 17:08
e0754cb to
c66cc03
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
HNT-2113
Wire the article worker to its Pub/Sub subscription so
crawl-articlejobs are consumed, validated at the boundary, and handed toprocessArticlewith Sentry context and per-message metrics attached. This is a thin wiring slice. Most of its added lines are an emulator integration test that drives the full path against Pub/Sub and Redis with Zyte stubbed.It builds on the Redis-guarded article step, the
pubsubpackage, the crawl-message validators, and the worker message helpers and config, with Sentry from HNT-2589 as baseline. See docs/ARCHITECTURE.md in #14 for where this consumer fits the article flow.Implementation decisions
validateCrawlArticleMessageas the subscriber'svalidatehookpubsubclient nacks a failed validate and routes it to the error handler under a distinctvalidation-errorkind, so a malformed poison payload is told apart from a transient handler failure in the logs and Sentry and never reachesprocessArticle. This is the boundary validation HNT-2487 calls for.worker_role,has_corpus_item, andcorpus_topicare tags;url,crawl_id,source_url, andenqueued_atare contexthas_corpus_itemlets triage separate live-article from discovered-article failures at a glance, andcorpus_topicis named so it is not mistaken for the Pub/Sub topic.