Skip to content

Fix reporting of hosts in batch script runs#32517

Merged
sgress454 merged 3 commits intomainfrom
sgress454/fix-issue-with-batches-made-of-deleted-hosts
Sep 4, 2025
Merged

Fix reporting of hosts in batch script runs#32517
sgress454 merged 3 commits intomainfrom
sgress454/fix-issue-with-batches-made-of-deleted-hosts

Conversation

@sgress454
Copy link
Copy Markdown
Contributor

@sgress454 sgress454 commented Sep 2, 2025

Details

Applying the patches from
#32516 (comment) and
#32563
onto main.

This fixes:

  • Batches where all remaining hosts are deleted will be correctly marked as "finished"
  • Batches scheduled for the future, and then canceled, will have al hosts marked as "canceled" rather than pending

Checklist for submitter

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

  • Input data is properly validated, SELECT * is avoided, SQL injection is prevented (using placeholders for values in statements)
  • If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes

Testing

  • Added/updated automated tests

  • Where appropriate, automated tests simulate multiple hosts and test for host isolation (updates to one hosts's records do not affect another)

  • QA'd all new/changed functionality manually

    • Started a new batch script run with one host, deleted that host, and triggered the batch_activity_completion_checker schedule, and verified that the batch was moved to "finished".
    • Scheduled script
      • Created a new batch script run scheduled for a future date
      • Canceled that batch run
      • Clicked on the batch run in the "finished" tab of the batch scripts list
      • Verified that the number of canceled hosts = the number of targeted hosts for that batch, and all other numbers were 0.
      • Verified that clicking the canceled hosts number navigated to the correct list of canceled hosts
    • "Run now" script
      • Created a new batch script run with "run now"
      • Waited for at least one host to run.
      • Canceled that batch
      • Clicked on the batch run in the "finished" tab of the batch scripts list
      • Verified that the number of canceled hosts = the number that were still pending when I canceled the script, and that the # of pending hosts was 0
      • Verified that clicking the canceled hosts number navigated to the correct list of canceled hosts
    • Multiple batches with the same hosts don't bleed into each other
      • Created another batch script with the same hosts, scheduled for the future
      • Verified that the "pending" host list is correct

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 2, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.02%. Comparing base (27560c7) to head (5f0c963).
⚠️ Report is 31 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #32517   +/-   ##
=======================================
  Coverage   64.02%   64.02%           
=======================================
  Files        1987     1987           
  Lines      195579   195622   +43     
  Branches     6461     6543   +82     
=======================================
+ Hits       125221   125254   +33     
- Misses      60560    60565    +5     
- Partials     9798     9803    +5     
Flag Coverage Δ
backend 65.25% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sgress454 sgress454 changed the title Mark batch runs as finished when hosts have been deleted Fix reporting of hosts in batch script runs Sep 3, 2025
@sgress454 sgress454 merged commit 790d254 into main Sep 4, 2025
39 checks passed
@sgress454 sgress454 deleted the sgress454/fix-issue-with-batches-made-of-deleted-hosts branch September 4, 2025 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants