Skip to content
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

Fix promise future dates #8367

Merged
merged 6 commits into from
Oct 13, 2023
Merged

Fix promise future dates #8367

merged 6 commits into from
Oct 13, 2023

Conversation

mekarpeles
Copy link
Member

@mekarpeles mekarpeles commented Oct 4, 2023

Closes #8351

The PR makes a statement that no created record from any source should have a future date.

Most records with future dates will fail to import because of the validation step. Records from sources that are exempt from validation, like bwb promise items, will have certain fields checked/pruned during the normalize stage.

Technical notes

All API imports (I'm not sure about /addbook though, which does have front-end validation) seemingly go through https://github.com/internetarchive/openlibrary/pull/8367/files#diff-2f9a6b1879442fc58af3064df91b70cd3138d6da15003d0d3127ecf05098386cL975-R997. Everything goes through validate unless (currently) it's a promise item, in which case validate is skipped. Everything should go through normalize after, including promise items.

TODO

@mekarpeles mekarpeles added the Priority: 1 Do this week, receiving emails, time sensitive, . [managed] label Oct 4, 2023
@mekarpeles mekarpeles added this to the Sprint 2023-10 milestone Oct 4, 2023
Copy link
Collaborator

@scottbarnes scottbarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the key for publish_date, added unit tests, and tested importing with a a current or past date, and a future date, in the local dev environment, and everything seems to be working as expected in terms of future dates being removed, and it not appearing to create any downstream errors (e.g. the Work and Edition page render properly with a deleted date).

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm ! Patch deploying since this is causing issues in the import pipeline for archive.org

@cdrini cdrini merged commit ed4b30b into master Oct 13, 2023
3 checks passed
@cdrini cdrini deleted the fix_promise_future_dates branch October 13, 2023 23:37
@cdrini cdrini added the Patch Deployed This PR has been deployed to production independently, outside of the regular deploy cycle. label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Patch Deployed This PR has been deployed to production independently, outside of the regular deploy cycle. Priority: 1 Do this week, receiving emails, time sensitive, . [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove invalidate dates from editions during create/edit (e.g. 9999)
3 participants