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

TP2000-1639 new year envelope publishing failure #1375

Merged

Conversation

paulpepper-trade
Copy link
Collaborator

@paulpepper-trade paulpepper-trade commented Jan 7, 2025

TP2000-1639 new year envelope publishing failure

Why

Tamato is failing to publish new envelopes, beginning with this new year’s 25xxxx envelope ID naming pattern, to the tariffs-api service. This is because the last envelope of 2024 was rejected but was still being considered as the last published envelope.

What

This PR:

  • Makes a bare call to Tamato's publish_to_api Django management benign. Instead of performing a publishing action it now lists (with additional detail) the envelopes that are awaiting publishing to tariffs-api.
  • Adds the --publish-now and --publish-async flags to publish_to_api. The former now runs the publishing process in the context of the console session, allowing an engineer to immediately see logs. The latter performs the publishing action asynchronously.
  • Changes a function name from last_unpublished_envelope_id to last_published_envelope_id to correctly give the intent of the function's action.
  • Uses EnvelopeQuerySet.last_envelope_for_year() when filtering for the last published Envelope instance of the previous year. This prevents rejected envelopes being considered when getting that last published Envelope instance.
  • Updates the Celery Beat crontab setting to run the Crown Dependencies publishing process every two hours, night and day and every day.

Checklist

  • Requires migrations? No
  • Requires dependency updates? No

@paulpepper-trade paulpepper-trade requested a review from a team as a code owner January 7, 2025 17:28
@paulpepper-trade paulpepper-trade merged commit cc2a940 into master Jan 8, 2025
8 checks passed
@paulpepper-trade paulpepper-trade deleted the TP2000-1639--new-year-envelope-publishing-failure branch January 8, 2025 11:02
dalecannon pushed a commit that referenced this pull request Jan 10, 2025
* List by default, add flags for async and sync publishing

* Fix failing tests

* Correct function name. Call correct queryset filter.

* Set crontab to every two hours to publish to crown dependencies

* Correctly reference workbasket's envelope
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.

3 participants