SF-3655 Do not update the draft in Mongo when another draft has started#3595
SF-3655 Do not update the draft in Mongo when another draft has started#3595
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3595 +/- ##
==========================================
- Coverage 82.78% 82.78% -0.01%
==========================================
Files 610 610
Lines 37239 37249 +10
Branches 6100 6082 -18
==========================================
+ Hits 30830 30835 +5
- Misses 5481 5498 +17
+ Partials 928 916 -12 ☔ View full report in Codecov by Sentry. |
| if (project.TranslateConfig.DraftConfig.CurrentScriptureRange != currentScriptureRange) | ||
| string currentScriptureRange = GetDraftedScriptureRange(lastTranslationBuild); | ||
| if ( | ||
| !string.IsNullOrWhiteSpace(currentScriptureRange) |
There was a problem hiding this comment.
📌 That's interesting. What are you thinking with regard to currentScriptureRange possibly being null or whitespace?
There was a problem hiding this comment.
These will be older builds that did not use the scripture range format.
| string currentScriptureRange = GetDraftedScriptureRange(lastTranslationBuild); | ||
| if ( | ||
| !string.IsNullOrWhiteSpace(currentScriptureRange) | ||
| && project.TranslateConfig.DraftConfig.CurrentScriptureRange != currentScriptureRange |
There was a problem hiding this comment.
📌 Actually, how would this be possible? If ExecuteWebhookAsync happens, and we mark a build as completed and run RetrievePreTranslationStatusAsync (from ExecuteWebhookAsync), wouldn't we have updated project.TranslateConfig.DraftConfig.CurrentScriptureRange from that completed build? Are we doing this because maybe we might not have heard back from a webhook, and so here we tidy up in case we had never heard back?
There was a problem hiding this comment.
Are we doing this because maybe we might not have heard back from a webhook, and so here we tidy up in case we had never heard back?
Yes.
| ); | ||
|
|
||
| // RetrievePreTranslationStatusAsync is run via a background job, so we verify that no new job was scheduled | ||
| env.BackgroundJobClient.DidNotReceive().Create(Arg.Any<Job>(), Arg.Any<IState>()); |
There was a problem hiding this comment.
📌 Oh, yes. Good fixing this check.
|
Looks like still E2E failures :( |
pmachapman
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 2 files reviewed, 3 unresolved discussions (waiting on @marksvc)
| if (project.TranslateConfig.DraftConfig.CurrentScriptureRange != currentScriptureRange) | ||
| string currentScriptureRange = GetDraftedScriptureRange(lastTranslationBuild); | ||
| if ( | ||
| !string.IsNullOrWhiteSpace(currentScriptureRange) |
There was a problem hiding this comment.
These will be older builds that did not use the scripture range format.
| string currentScriptureRange = GetDraftedScriptureRange(lastTranslationBuild); | ||
| if ( | ||
| !string.IsNullOrWhiteSpace(currentScriptureRange) | ||
| && project.TranslateConfig.DraftConfig.CurrentScriptureRange != currentScriptureRange |
There was a problem hiding this comment.
Are we doing this because maybe we might not have heard back from a webhook, and so here we tidy up in case we had never heard back?
Yes.
| ); | ||
|
|
||
| // RetrievePreTranslationStatusAsync is run via a background job, so we verify that no new job was scheduled | ||
| env.BackgroundJobClient.DidNotReceive().Create(Arg.Any<Job>(), Arg.Any<IState>()); |
4495143 to
060ae5c
Compare
060ae5c to
714a35b
Compare
|
Merging so we can finish testing on QA. |
This PR fixes a bug on QA, blocking its release to live, so I have marked as critical path.
This change is