fleet/server/datastore
Scott Gress 6c659050c0
Fix Orbit-canceled script runs being counted as "pending" (#33300)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #32220

# Details

This PR fixes an issue where hosts whose running scripts were canceled
by Orbit (e.g. due to timing out) were reported as being still "pending"
on the batch script details view. This was due to our only counting runs
as errored if the error code was > 0, and ignoring negative error codes
(which is what Orbit uses for this case).

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [X] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)

## Testing

- [X] Added/updated automated tests
Changed a couple of places where we were using `1` for an error code to
`-1`
- [X] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [X] QA'd all new/changed functionality manually

For unreleased bug fixes in a release candidate, one of:

- [X] Confirmed that the fix is not expected to adversely impact load
test results
- [X] Alerted the release DRI if additional load testing is needed
2025-09-23 12:22:28 -05:00
..
cached_mysql Improved performance when modifying config with a large number of yara rules (#32696) 2025-09-08 10:24:22 -05:00
failing Add custom software icons (#32652) 2025-09-05 17:31:03 -05:00
filesystem Add custom software icons (#32652) 2025-09-05 17:31:03 -05:00
mysql Fix Orbit-canceled script runs being counted as "pending" (#33300) 2025-09-23 12:22:28 -05:00
mysqlredis Add missing platform_like during orbit enrollment (#32671) 2025-09-05 16:05:19 -03:00
redis Feat 1817 add iam auth to mysql and redis (#32488) 2025-09-04 10:08:47 -05:00
s3 Fix GCS for remaining features that use S3 (#32743) 2025-09-09 11:22:04 -03:00