Title: fix(github): make branch protection usable and wire workflow_id to its endpoint by waleedlatif1 · Pull Request #7308 · simstudioai/sim · GitHub
Open Graph Title: fix(github): make branch protection usable and wire workflow_id to its endpoint by waleedlatif1 · Pull Request #7308 · simstudioai/sim
X Title: fix(github): make branch protection usable and wire workflow_id to its endpoint by waleedlatif1 · Pull Request #7308 · simstudioai/sim
Description: Summary Two verified GitHub defects: an operation that could never run, and a UI field wired to nothing. github_update_branch_protection was unusable PUT /repos/{owner}/{repo}/branches/{branch}/protection documents four body fields as required but nullable — required_status_checks, enforce_admins, required_pull_request_reviews, restrictions, each "Set to null to disable." GitHub's "required" means present in the body, satisfiable by null. Sim's required: true means the user must supply a non-empty value — validateRequiredParametersAfterMerge rejects null, undefined and '' outright, so Sim could not express GitHub's disable case at all. Combined with restrictions having no subBlock anywhere in the block, every call threw Restrictions is required for GitHub Update Branch Protection before reaching the network. All four params → required: false request.body now emits an explicit null for each unset field instead of dropping the key, preserving GitHub's "present but null = disable" contract The body also normalizes the editor's JSON strings to objects and the dropdown's 'true'/'false' to booleans, fixing the type mismatches without touching tools.config.tool New restrictions subBlock, so the operation finally has full param coverage workflow_id rendered but did nothing The block showed a workflow_id field for github_list_workflow_runs, but the tool declared no such param and always hit the repo-wide /actions/runs. GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs exists, takes the identical query set, and returns the identical response schema — so this wires the field rather than deleting a working affordance. The segment is encodeURIComponent-escaped. Design notes Normalization lives in the tool's request.body, not in GITHUB_PARAM_ALIASES. Nothing here needs renaming, and the tool body covers the agent tool-calling path identically while carrying zero cross-operation clobber risk — the alias mapper is scoped by operation precisely because advanced fields serialize without their condition being evaluated. The three pre-existing subBlocks stay mode: 'advanced'. With required: false that is now correct — they are genuinely optional — and flipping them would have changed visibility. updateBranchProtectionV2Tool shares params and request by reference and inherits both fixes; a test asserts it. Backwards compatibility subBlock ids: nothing renamed or removed; one added (restrictions). Subblock-ID stability check passes. required: only ever loosened (true → false), never tightened — no saved workflow can newly fail validation. visibility and mode: unchanged on every existing param. The only behavior change is that an operation which always threw now runs, and a field that was discarded now takes effect. Testing apps/sim/tools/github/branch_protection_and_workflow_runs.test.ts — 41 tests; 151 pass across blocks/blocks/github and tools/github. Verified red-first per guard, reverting each individually: Guard Red required: false on the four params 5 explicit-null body emission 5 JSON-string parsing 2 boolean coercion 1 restrictions subBlock 1 json input types 1 workflow_id param 2 URL endpoint branch 4 encodeURIComponent 1 alias operation scoping 2 alias presence guard 6 parse-error message hardening 3 Two of those tests initially passed with their guard deleted and were rewritten. The presence-guard test used toEqual, which treats an undefined-valued key as absent — so {title: 'v1.0', description: undefined} compared equal to {title: 'v1.0'}. It now asserts on Object.keys, which is the distinction that actually matters when the provider spreads the transform over a model's tool-call arguments. The scoping test used real param names instead of alias source names and was rewritten to use milestone_title / gist_public / fork_name. Includes coverage that a stale advanced value from another operation cannot leak into anything wired here. bun run lint, type-check, check:audits (39 audits), tool-metadata:check, docs:check, integration-catalog:check, deployment-config:check and check-block-registry.ts origin/staging all pass. Regenerated artifacts committed. Deferred: github_check_star Confirmed dead and deliberately left alone. GitHub answers 204 for starred and 404 for not-starred; the shared executor throws on !response.ok before transformResponse runs, so starred: false is unreachable and the ordinary negative answer surfaces as a failure. Three options exist — convert to an internal operation (isolated, but leaves the shared retry/DNS-pinning/size-limit machinery for one trivial GET), add an opt-in like expectedErrorStatuses on ToolConfig.request (generalizes, but sits on the hot path for every tool), or have callers read the status the thrown error already carries. Worth noting for that decision: 13 GitHub tools use the status === 204 pattern, but 12 are mutations where any non-204 genuinely is an error — their false branch is harmless dead code, not a defect. check_star is the only GitHub tool where the non-2xx status carries meaning; the comparable live cases elsewhere are elasticsearch/get_document.ts and delete_document.ts. That makes it a three-tool problem rather than a ten-tool one, which argues against paying for the shared-executor change. Type of Change Bug fix Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Two verified GitHub defects: an operation that could never run, and a UI field wired to nothing. github_update_branch_protection was unusable PUT /repos/{owner}/{repo}/branches/{branch}/pro...
X Description: Summary Two verified GitHub defects: an operation that could never run, and a UI field wired to nothing. github_update_branch_protection was unusable PUT /repos/{owner}/{repo}/branches/{branch}/pro...
Opengraph URL: https://github.com/simstudioai/sim/pull/7308
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5c4ac2bc-a7b5-ec75-0e01-6ae15fbbf299 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8B36:14B945:196129:237FED:6AFB2F0E |
| html-safe-nonce | 278e0b575ff6477335966d42aacda0eea69081c55f5109f5ce27baea77642009 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjM2OjE0Qjk0NToxOTYxMjk6MjM3RkVEOjZBRkIyRjBFIiwidmlzaXRvcl9pZCI6IjUxNjc1NTM2Mjg0MDcwMTcyMzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e6a35a4439ac4b148760aedf635c31e482f589b7fa6096492144da7487196493 |
| hovercard-subject-tag | pull_request:4406310424 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/7308/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Two verified GitHub defects: an operation that could never run, and a UI field wired to nothing. github_update_branch_protection was unusable PUT /repos/{owner}/{repo}/branches/{branch}/pro... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | efe184de15c1d8c1107a340cfc27bf7187b458dc07687ee1fa51f035148fb3d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f567cf3af46b50a3211fb5dab569a9d6a7b58025 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width