Skip to content

fix(actions): prevent bulk actions from affecting all runners (#38453) - #38457

Merged
wxiaoguang merged 1 commit into
go-gitea:release/v1.27from
GiteaBot:backport-38453-v1.27
Jul 15, 2026
Merged

fix(actions): prevent bulk actions from affecting all runners (#38453)#38457
wxiaoguang merged 1 commit into
go-gitea:release/v1.27from
GiteaBot:backport-38453-v1.27

Conversation

@GiteaBot

Copy link
Copy Markdown
Collaborator

Backport #38453 by @dreamstarsky

Keep the selected runner IDs synchronized with the bulk action form and reject requests without valid IDs. Add integration regression tests.

This fixes a severe and destructive bug in the site-admin runner bulk actions introduced by #37869.

Before this fix, every bulk operation always affected all registered runners, regardless of which runners the administrator selected. This affected the Disable, Enable, and Delete actions. In the most serious case, selecting a single runner and confirming the bulk deletion could delete every registered runner.

The frontend populated the hidden ids field only once during page initialization, before any runner was selected. It was not updated when the checkbox selection changed, so bulk requests were submitted with an empty ID list.

The backend then passed the empty list to FindRunnerOptions. An empty IDs value means that no ID filter is added to the database query, causing all runners to be loaded and modified.

This PR:

  • synchronizes the hidden runner IDs whenever the selection changes;
  • rejects bulk requests without valid runner IDs before querying or modifying runners;
  • restores the intended bulk action button classes so the selected runner count is displayed;
  • adds integration coverage to ensure an empty-ID delete request is rejected without deleting any runners.

Before

untitled.mp4

After

fixed.mp4

Fixes #38449

AI assistance disclosure: OpenAI Codex was used to assist with investigation, implementation, testing, and drafting this pull request. The changes were reviewed and manually tested by the author.

…ea#38453)

Fix the bug in the site-admin runner bulk actions introduced by go-gitea#37869:
the runner IDs are empty then all runners will be deleted.

Fixes go-gitea#38449

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot
GiteaBot requested a review from bircni July 15, 2026 02:36
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 15, 2026
@GiteaBot
GiteaBot requested a review from wxiaoguang July 15, 2026 02:36
@GiteaBot GiteaBot added this to the 1.27.1 milestone Jul 15, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jul 15, 2026
@wxiaoguang
wxiaoguang enabled auto-merge (squash) July 15, 2026 03:06
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jul 15, 2026
@wxiaoguang
wxiaoguang merged commit 6e86c4c into go-gitea:release/v1.27 Jul 15, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants