Skip to content

Fix personalized feed test ID collision - #4071

Merged
koutst merged 1 commit into
mainfrom
codex/fix-personalized-feed-test-id-collision
Sep 3, 2026
Merged

Fix personalized feed test ID collision#4071
koutst merged 1 commit into
mainfrom
codex/fix-personalized-feed-test-id-collision

Conversation

@koutst

@koutst koutst commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Compare (content_type, id) pairs in test_personalized_feed_filters_only_papers instead of comparing bare IDs across the Paper and ResearchhubPost tables.
  • Assert the complete result is exactly the expected paper, preserving coverage that posts are excluded.
  • No production code changes.

Cause

Paper and post primary keys are generated independently and can overlap. In the failing CI run, both IDs were 132, so a correctly returned paper triggered assertNotIn(self.post.id, result_ids). The old assertion depended on test database sequence state.

Validation

  • Passed: Ruff lint and formatting checks for the changed file.
  • Passed: git diff --check.
  • Attempted the focused Django test; it could not start because this worktree lacks config_local/db.py (ImportError: cannot import name 'db' from 'config_local'). CI validation is still required.

@koutst
koutst requested a review from a team as a code owner September 3, 2026 18:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T18:34:31.534128Z 9854c54 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@koutst
koutst merged commit 9c11ae4 into main Sep 3, 2026
5 checks passed
@koutst
koutst deleted the codex/fix-personalized-feed-test-id-collision branch September 3, 2026 18:40
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.82%. Comparing base (139fa82) to head (9854c54).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4071   +/-   ##
=======================================
  Coverage   85.82%   85.82%           
=======================================
  Files         752      752           
  Lines       44002    44002           
=======================================
  Hits        37763    37763           
  Misses       6239     6239           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant