TP2000-1639 new year envelope publishing failure #1375
Merged
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.
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:
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.--publish-now
and--publish-async
flags topublish_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.last_unpublished_envelope_id
tolast_published_envelope_id
to correctly give the intent of the function's action.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.Checklist