H1 reslice: quarantine-safe primitive feed status - #42
Conversation
Co-Authored-By: Codex <noreply@openai.com>
🤖 Codex PR Review🚫 Merge blocked: 1 serious issue(s) found in high-risk files 🚫 Blocking IssuesThese issues must be fixed before this PR can be merged: 1. 🟠 [HIGH] Logic in
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 771f7d13d4
ℹ️ 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".
| item_count=0, | ||
| error=f"{type(exc).__name__}: {exc}", | ||
| ) | ||
| error_code = exc.code if isinstance(exc, (FeedXmlError, PrimitiveStatusError)) else "fetch_failed" |
There was a problem hiding this comment.
Avoid reading .code from FeedXmlError
When a feed returns malformed or oversized XML, parse_feed_items raises FeedXmlError, but that class does not define a code attribute. This line therefore raises AttributeError before the failed feed record is appended or --continue-on-feed-error can take effect, so the RSS Source Pipeline's fetch step can still abort on expected XML producer-boundary failures instead of writing the sanitized status.
Useful? React with 👍 / 👎.
| ) | ||
| return rows | ||
|
|
||
| return ("atom", rows) if include_kind else rows |
There was a problem hiding this comment.
Preserve RSS kind for empty feeds
For an RSS document with a channel but zero <item> entries, the new quarantine path reaches this Atom return because rss_items is empty. That records kind: "atom" for quarantined RSS feeds in source_fetch_status.json, so the producer status misclassifies the feed type exactly in the zero-entry scenario this change adds.
Useful? React with 👍 / 👎.
| if any(item["state"] == "failed" for item in feed_records): | ||
| raise RuntimeError("all configured RSS/Atom feeds failed") |
There was a problem hiding this comment.
Don't fail mixed quarantine status as all failed
When --continue-on-feed-error is used by the RSS Source Pipeline and all non-failing feeds are merely quarantined with zero entries, this branch still raises if any other feed failed because there are no accepted feeds. That is not the same as all configured feeds failing, and it aborts before writing the empty CSV even though the all-zero quarantine case just above is intended to complete with status.
Useful? React with 👍 / 👎.
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94786ebd11
ℹ️ 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".
| ) | ||
| return rows | ||
|
|
||
| return ("atom", rows) if include_kind else rows |
There was a problem hiding this comment.
Classify unsupported XML as unknown or failed
When a feed URL returns well-formed XML that is not an Atom feed (for example an XHTML/XML error page or another unsupported root), atom_entries is empty and this unconditional return labels it as kind: "atom" with zero rows. fetch_rss_sources then records a quarantined zero_entries feed instead of an unknown/failed feed, which can mask a bad source and let an all-empty run complete without tripping the failed-feed guard.
Useful? React with 👍 / 👎.
Scope
Fresh reslice from
origin/main@294e30b8eed36f070299b1dc01d34955fb262918; PR #41 is closed evidence and was not reused.PrimitiveRowand canonicalpert.feed_primitives.v1status.Non-scope
No workflow, publish, QAR, weekly artifact, permissions, or automation changes. No legacy fallback.
Verification
uv sync --locked --extra testpasseduv run pytest -q— 128 passedpython3 -m compileall -q src scripts testspassedgit diff --checkpassedruffunavailableW0-B remains deferred until this fresh H1 reslice merges and post-main CI succeeds.