docs(network-broker): document the scms list in v0.47.0 - #2844
Open
matthewdean-semgrep wants to merge 2 commits into
Open
matthewdean-semgrep wants to merge 2 commits into
matthewdean-semgrep wants to merge 2 commits into
Conversation
Network Broker v0.47.0 adds inbound.scms, a list whose entries each carry their own type. It lets one broker reach several instances of the same SCM type. The page only showed the single-SCM keys, so a second instance of the same type still needed a hand-written allowlist with a token on every rule. The config file steps gain a v0.47.0 tab, and the multiple-SCM section leads with scms. The earlier instructions stay in tabs for v0.46.0 and earlier. The page also covers the two ways scms differs from the rest of the config: files merge entries by type and baseUrl instead of replacing the list, and the broker refuses to start when two entries would share allowlist rules. Co-Authored-By: Claude Code <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
matthewdean-semgrep
requested review from
abhijna,
armchairlinguist and
semgrep-jamie
September 21, 2026 22:22
matthewdean-semgrep
marked this pull request as ready for review
September 21, 2026 22:22
|
|
||
| Note that arrays are replaced, while maps are merged. | ||
|
|
||
| The `scms` list in v0.47.0 and later is an exception. The broker identifies each entry by its `type` and `baseUrl`. It merges entries that share both field by field, and the later file wins. It keeps entries that differ in either field side by side. |
Collaborator
There was a problem hiding this comment.
field by field and side by side here are a little confusing to me - can you describe this in a way that's less ambiguous?
|
|
||
| Update the `config.yaml` by replacing the SCM information containing `YOUR_BASE_URL` with your SCM and its base URL for Azure DevOps, GitHub, GitLab, or Bitbucket Data Center. | ||
|
|
||
| If you use `scms` in v0.47.0 and later, set the entry's `type` to the key shown in the tab for your SCM, which is `azuredevops`, `bitbucket`, `github`, or `gitlab`. Set its `baseUrl` to the base URL shown in the same tab. |
Collaborator
There was a problem hiding this comment.
Suggested change
| If you use `scms` in v0.47.0 and later, set the entry's `type` to the key shown in the tab for your SCM, which is `azuredevops`, `bitbucket`, `github`, or `gitlab`. Set its `baseUrl` to the base URL shown in the same tab. | |
| If you use the `scms` key with an SCM list, available in v0.47.0 and later, set each entry's `type` to the key shown in the tab for your SCM: either `azuredevops`, `bitbucket`, `github`, or `gitlab`. Set its `baseUrl` to the base URL value shown in that same tab. |
| </Tab> | ||
| </Tabs> | ||
|
|
||
| If you use `scms` in v0.47.0 and later, add `allowCodeAccess: true` to each entry that needs code access. The setting applies only to the entry that sets it. |
Collaborator
There was a problem hiding this comment.
Suggested change
| If you use `scms` in v0.47.0 and later, add `allowCodeAccess: true` to each entry that needs code access. The setting applies only to the entry that sets it. | |
| If you use the `scms` key with an SCM list, available in v0.47.0 and later, add `allowCodeAccess: true` to each entry that needs code access. The setting applies only to the entry that sets it. |
|
|
||
| Each entry requires `type` and `baseUrl`. It also accepts `token` and `allowCodeAccess`, which apply only to that entry. The broker allows the same endpoints for each entry that it allows for the matching [SCM-specific key](/semgrep-ci/network-broker#update-the-config-with-your-scm-information). | ||
|
|
||
| You can combine `scms` with SCM-specific keys, such as `github`, as long as they name different instances. The broker exits with an error at startup in the following cases: |
Collaborator
There was a problem hiding this comment.
Suggested change
| You can combine `scms` with SCM-specific keys, such as `github`, as long as they name different instances. The broker exits with an error at startup in the following cases: | |
| You can use both `scms` and SCM-specific keys, such as `github`, as long as the same instance is not named twice. The broker exits with an error at startup in the following cases: |
| You can combine `scms` with SCM-specific keys, such as `github`, as long as they name different instances. The broker exits with an error at startup in the following cases: | ||
|
|
||
| - An SCM-specific key and an `scms` entry have the same type and base URL. | ||
| - Two GitHub, GitLab, or Bitbucket entries of the same type share a host, and at least one of them sets `allowCodeAccess: true`. The broker allows repository cloning for these SCMs by host, so it can't keep the clone access and tokens of the two instances apart. Give each instance its own host, or leave `allowCodeAccess` unset on every instance on that host. |
Collaborator
There was a problem hiding this comment.
Suggested change
| - Two GitHub, GitLab, or Bitbucket entries of the same type share a host, and at least one of them sets `allowCodeAccess: true`. The broker allows repository cloning for these SCMs by host, so it can't keep the clone access and tokens of the two instances apart. Give each instance its own host, or leave `allowCodeAccess` unset on every instance on that host. | |
| - For GitHub, GitLab, and Bitbucket: if two entries of the same type share a host and at least one of them sets `allowCodeAccess: true`. The broker allows repository cloning for these SCMs by host, so it can't have different code access settings for the same host. Give each instance its own host, or leave `allowCodeAccess` unset on every instance on that host. |
abhijna
approved these changes
Sep 22, 2026
abhijna
left a comment
Collaborator
There was a problem hiding this comment.
Ltgm! Agree with Alexis' comments. Made a couple of tiny edits
|
|
||
| Note that arrays are replaced, while maps are merged. | ||
|
|
||
| The `scms` list in v0.47.0 and later is an exception. The broker identifies each entry by its `type` and `baseUrl`. It merges entries that share both field by field, and the later file wins. It keeps entries that differ in either field side by side. |
Collaborator
There was a problem hiding this comment.
Suggested change
| The `scms` list in v0.47.0 and later is an exception. The broker identifies each entry by its `type` and `baseUrl`. It merges entries that share both field by field, and the later file wins. It keeps entries that differ in either field side by side. | |
| The `scms` list in v0.47.0 and later is an exception. The broker matches entries that have the same | |
| `type` and `baseUrl` and combines them into one entry. It keeps a key that only one file sets, such | |
| as `token`. If both files set the same key, it uses the value from the later file. Entries with a | |
| different `type` or `baseUrl` are both kept. A later file does not replace the list. |
Reviewers found the multiple-config merge rule ambiguous and asked for the `scms` mentions to name the key the same way each time. The merge paragraph now spells out the behavior key by key rather than leaning on "field by field" and "side by side". The three cross-references to the list say "the `scms` key with an SCM list", and the shared-host error case leads with the SCMs it applies to. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sister PR to semgrep/semgrep-network-broker#236, released in v0.47.0.
Why
The Network Broker page only documents the single-SCM keys (
github,gitlab,bitbucket,azuredevops). Each key holds one instance, so a second instance of the same type needs a hand-writtenallowlistwith a token on every rule. v0.47.0 addsinbound.scms, a list whose entries each carry their owntype:Approach
Create the config file gains a v0.47.0 and later tab that uses
scms. The old v0.25.0 and later tab becomes v0.25.0 to v0.46.0. Allowlist multiple source code managers now leads withscms, and the hand-written allowlist moves to a v0.46.0 and earlier tab. Headings are unchanged, so inbound anchors still resolve.The SCM information and Managed Scans steps keep their per-SCM tabs. Each gets one sentence on how to express the same thing as an
scmsentry, because the single-SCM keys still work in v0.47.0.The page also covers the two ways
scmsbehaves differently from the rest of the config:-cfiles, entries that sharetypeandbaseUrlmerge field by field. The page says elsewhere that arrays are replaced, so this needs its own note.scmsand under a single-SCM key. It also refuses when two GitHub, GitLab, or Bitbucket entries of one type share a host and either setsallowCodeAccess.Testing
I built the broker from the
v0.47.0tag and randumpagainst configs modeled on the page:allowCodeAccessset only on the second GitHub entry.allowCodeAccess: truefor the first GitHub entry amends that entry, even with a trailing slash onbaseUrl.inbound.githubplus anscmsentry for the same URL fails withdeclare it in one place.allowCodeAccessfail withshare host.I haven't checked the Mintlify preview yet.
Thanks for improving Semgrep Docs
Please ensure:
docs/docs.jsonif URLs changeddocs/extensions/pre-commit.md.template.mdx, CI regeneratespre-commit.mdxon this PR (no manualrun-build-scriptsneeded)main)🤖 Generated with Claude Code