job: Assign scoped health to jobs added to scoped job groups #47
+16
−4
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.
Jobs can be added to a job group both before and after it has started. When adding a job group before it has started it is put in a queue and started on group start.
One of the parameters we pass in when the job starts is a health reporter. However, there was a bug where when you create a scoped job group, we would pass the health reporter of its parent to the job and not the health reporter of the scoped job group. We were doing it correctly for jobs added to the job group after it had started.
This commit fixes the bug enqueueing the health reporter along with the job when enqueueing before the job group has started and using the colocated health reporter to call the job on start.