Skip to content

fix: Preserve empty runner-group workflow lists - #4735

Open
Muneer320 wants to merge 2 commits into
google:masterfrom
Muneer320:fix/runner-group-empty-workflows
Open

Muneer320 wants to merge 2 commits into
google:masterfrom
Muneer320:fix/runner-group-empty-workflows

Conversation

@Muneer320

@Muneer320 Muneer320 commented Nov 26, 2026 •

Copy link
Copy Markdown

An explicitly empty SelectedWorkflows slice is omitted from runner-group requests, so callers cannot send "selected_workflows": [] separately from leaving the field unset. GitHub's organization and enterprise request schemas permit empty arrays.

Use omitzero for this field in all four create/update request types. Nil slices remain omitted and populated slices are unchanged. The update marshalers also preserve empty lists when removing a network configuration.

Regression coverage lives in the existing API-method tests: four request-body assertions and two empty-workflow/network-removal cases. The raw JSON assertions detect an omitted field without marshaling the expected value through the same request type.

Verification on hosted Linux / Go 1.26.0:

  • All six service-level regressions fail if the four corrected tags are reverted, and pass with the change.
  • Eighteen public service-request checks cover nil, empty and populated lists across all four operations and both network-removal paths.
  • Required script/fmt.sh, script/test.sh (all 12 modules, including race checks) and script/lint.sh pass; generated files are unchanged. Verification run.

Contract references: organization API and enterprise-cloud API. The pinned OpenAPI schemas were checked for all four operations. No live organization or enterprise settings were changed or tested.

AI assistance was used for discovery, implementation, regression checks and drafting.

@Muneer320
Muneer320 marked this pull request as ready for review November 26, 2026 13:10
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Nov 26, 2026
@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (87b7b3f) to head (9240a6b).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4735   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files         204      204           
  Lines       19164    19164           
=======================================
  Hits        18904    18904           
  Misses        260      260           

☔ View full report in Codecov by Harness.
📢 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.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Muneer320!
LGTM.
Awaiting second LGTM+Approval from any other contributor to the repo before merging.

cc: @stevehipwell - @Not-Dhananjay-Mishra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants