-
Notifications
You must be signed in to change notification settings - Fork 9
Re-apply the non-BISAC nonfiction reset a release later (PP-5129) #3737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dbernstein
wants to merge
5
commits into
main
Choose a base branch
from
bugfix/reapply-non-bisac-nonfiction-reset
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+76
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0aa516f
Re-apply the non-BISAC nonfiction reset a release later (PP-5129)
dbernstein 2cdeec2
Point the re-apply task at the startup task, not the migration
dbernstein 3b42a47
List the whole repair surface in the cleanup TODO
dbernstein c3ee934
Trim the docstring to what the release N task does not already say
dbernstein bef4f14
Re-date the task key and cover the real startup_tasks directory
dbernstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
startup_tasks/2026_10_02_reapply_non_bisac_nonfiction_reset.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| """Re-apply the non-BISAC nonfiction reset now that no old code is running. | ||
|
|
||
| Startup task ``2026_09_14_reclassify_non_bisac_nonfiction_subjects`` repaired | ||
| these subjects a release ago, but its reset was exposed to any old code still | ||
| live: hosting-playbook's ``helpers/migrate.yml`` recycles the web containers | ||
| after the migrate step, and does not govern Fargate deployments at all. Old | ||
| code reaching ``Subject.assign_to_genre`` consumes the reset and re-stamps | ||
| ``checked=True`` with the same wrong value; see that task's docstring for the | ||
| detail. A release later nothing old is running anywhere, so the same reset is | ||
| safe to apply again. | ||
|
|
||
| It recomputes which subjects the classifier disagrees with rather than | ||
| replaying a stored list, so if the first repair took this is a no-op. | ||
| Re-scoring is left to the nightly ``classify_unchecked_subjects``; the release | ||
| N task chained it only because it was racing old code. | ||
|
|
||
| This mirrors the null-audience repair, where ``2026_06_17`` re-ran what | ||
| ``2026_05_12`` had dispatched a release earlier. | ||
|
|
||
| TODO: Remove the whole repair once this has run on all deployments (PP-5129): | ||
| this task, the release N startup task, ``reset_non_bisac_nonfiction_subjects`` | ||
| with its script and bin wrapper, and | ||
| ``BISACClassifier.contradicts_stored_fiction``, whose only non-test caller is | ||
| that task.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import logging | ||
|
|
||
| from celery.canvas import Signature | ||
| from sqlalchemy.orm import Session | ||
|
|
||
| from palace.manager.celery.tasks.work import reset_non_bisac_nonfiction_subjects | ||
| from palace.manager.service.container import Services | ||
|
|
||
|
|
||
| def run(services: Services, session: Session, log: logging.Logger) -> Signature | None: | ||
| return reset_non_bisac_nonfiction_subjects.s() | ||
|
greptile-apps[bot] marked this conversation as resolved.
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.