-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fall back to name/source for matching software titles on insert if bundle ID is provided, add missing special case for edit software upload timeout #22412
Conversation
…ndle ID is provided This avoids "no rows in set" errors when adding software whose name/source matches an existing software title but whose bundle ID doesn't, likely because the bundle ID is null due to e.g. a GitOps upload. There's likely more work to do (e.g. on VPP) for this fallback, and on the write side we should probably be saving bundle identifiers in more places than we're doing (e.g. in the batch endpoint where GitOps is used) but this is the smallest fix that will un-break software uploads.
Test failures are unrelated to this change. |
Missed this in dev. This fixes package uploads on software edit timing out on lower-speed internet connections on larger packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got some subtle edge cases here, and I want to say the data store tests would pass as they stand pre-patch, hence the need to add the cases I outlined.
Thinking that we actually want to constrain the query on the app side for bundle ID more, so it checks for source ID, so I'm going to push that change in a sec.
app *fleet.VPPApp | ||
}{ | ||
{ | ||
name: "title that already exists, no bundle identifier in payload", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See notes on the installers test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that this catches bugginess in 4.57.0, and we have a test for mismatched bundle ID in the other test (not this one)...but probably might as well add one more test case since this is a different code path than for installers. Going to work on adding that now.
2f4185e
to
aafb59c
Compare
I'm happy with the way the tests look now, so this comment is my signoff on @roperzh's work (can't approve since I created the PR and did some of the work). @lucasmrod can you take one more look? I believe you're ready here, and code between this and #22413 are identical. |
Test failures are known unrelated flakiness fixed in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨ lgtm!
Closing this out so we can follow proper patch procedure (#24213 into main, cherry-picked into patch release from there). |
… bundle ID, add missing request timeout special case for edit package endpoint (#22413) Same as #22412, for #21370, but against `main` rather than 4.57.0. # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Added/updated tests - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Roberto Dip <rroperzh@gmail.com>
… bundle ID, add missing request timeout special case for edit package endpoint (#22413) Same as #22412, for #21370, but against `main` rather than 4.57.0. If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Added/updated tests - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Roberto Dip <rroperzh@gmail.com>
… bundle ID, add missing request timeout special case for edit package endpoint (#22413) Same as #22412, for #21370, but against `main` rather than 4.57.0. If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Added/updated tests - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Roberto Dip <rroperzh@gmail.com>
See #21370
For the first fix:
This avoids "no rows in set" errors when adding software whose name/source matches an existing software title but whose bundle ID doesn't, likely because the bundle ID is null due to e.g. a GitOps upload.
There's likely more work to do (e.g. on VPP) for this fallback, and on the write side we should probably be saving bundle identifiers in more places than we're doing (e.g. in the batch endpoint where GitOps is used) but this is the smallest fix that will un-break software uploads.
For the second fix: this matches the timeout for PATCH to the timeout for POST on installers, so if e.g. you're on a 20 Mbps up connection uploading a 150MB installer the upload actually completes rather than timing out after 20s.
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/
,orbit/changes/
oree/fleetd-chrome/changes
.See Changes files for more information.
@roperzh lmk if this looks right. Pending assignment on this, I can add tests if this is the right approach.