[run status sensors] scope run status sensor to code location #20587
+203
−0
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.
Summary & Motivation
This PR fixes a bug in run status sensors where jobs in other code locations were erroneously ticking the run status sensor when it was configured to only tick for jobs in the current code location.
Run status sensors can be set to only monitor specific jobs in the code location/repository where the sensor is located. This functionality was added before
Definitions
was introduced and we used the repository name to ensure that only jobs in the current repository were considered. With code locations/definitions, now all the repositories have the same name, so jobs in other code locations can tick the sensor now. To solve this we pipe theCodeLocationOrigin
to the sensor evaluation context so that we can compare the code location name for the sensor with the code location name for the job.How I Tested These Changes
New unit test, I also run local host cloud and added two code locations with the same named job in each. Confirmed that the job in code location 2 didn't tick the sensor in code location 1
resolves #14353 and #13076