fix: do not push runs without seats to ecommerce in data loader #4474
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.
PROD-4171
In the courses data loader, we push to ecommerce if the run has an updated end date. This is primarily to push seat upgrade deadline changes (which depend on run end date) to ecommerce. However, in case a run is newly created and has no seats so far, a push to ecommerce will convince ecommerce that the run does not have any seats. Hence, even if we add seats to the draft version of the run, the Ecommerce Data loader might delete the seats from discovery if the seats have not been pushed to the non-draft version and ecommerce before the time that the ecomm loader runs.
This PR attempts to circumvent the above issue by only pushing a run to ecommerce in the courses data loader if it has a non-zero number of associated seats.