var-update-trigger: Update only devices that should be running the release that the image env var is part of #1796
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.
The
device.should_be_running__release
path is optimized w/ the/canAccess()
permissions hence this produces a smaller query, which has faster planning & execution time.It looks like that the previous query was trying to only update devices that already have an
image_install
, but in the form it was, it was it was also including devices withimage_install
s that were marked asdeleted
. So the new approach might actually be saving work.Didn't add further nested filters on
image_install
s, in an attempt to keep the query smaller, but I don't think that they are necessary, since it's correct to give trigger an update on a device that has just started downloading a release, but didn't have yet the time to do a state PATCH to create theimage_install
s.Moreover, we don't really expect any POSTs or UPDATEs of device service env vars after a release successfully builds anyway.
Change-type: patch