ci/hostnames: Add PR check for example hostnames - #1933
Closed
marcleblanc2 wants to merge 7 commits into
Closed
marcleblanc2 wants to merge 7 commits into
marcleblanc2 wants to merge 7 commits into
Conversation
Standardize on sourcegraph.example.com for "your Sourcegraph instance" (replacing your-sourcegraph-instance.com, sourcegraph.company.com, sourcegraph.your*.com, *.sourcegraph.com placeholders, sourcegraph.test:3443, src.acme.com, and URL-style angle-bracket placeholders), and on <service>.example.com for code hosts and infra (my-*.example.com, bitbucketserver/your-bbs-instance, github-enterprise, smtp-server, *.company.net, bitbucket.sgdev.org). Auto-generated SCHEMA_SYNC blocks and the technical changelog are left untouched; the schema descriptions must be fixed upstream. Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672
… *.example.com Postgres, PgBouncer, Redis, Grafana, Prometheus, registry, and external pgsql example hosts, plus the CAA dig example in the Cloud docs. Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <[email protected]>
Adds dev/check-hostnames.mjs, run from next.config.js alongside the existing link/filename/image checks, so a Vercel preview build (and thus the PR check) fails when docs use a non-canonical placeholder host: - your-sourcegraph-instance.com, sourcegraph.yourcompany.com, sourcegraph.company.com, myinstance.sourcegraph.com, src.example.com, etc. -> sourcegraph.example.com - my-gitlab.example.com, bitbucketserver.example.com, github-enterprise.example.com, *.company.net -> <service>.example.com - any *.sgdev.org (internal Sourcegraph infrastructure) SCHEMA_SYNC blocks and technical-changelog.mdx are skipped, matching the normalization PR. Also fixes the two remaining sgdev.org references the check found. Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <[email protected]>
…hostnames Generalizes the company-domain rule from a fixed list of code hosts to any host under a fictional company domain (mycompany, yourcompany, company, corp, acme, mydomain, yourdomain), so infra placeholders like grafana.mycompany.com and psql1.mycompany.org are caught too. Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <[email protected]>
…t build Adds .github/workflows/check-hostnames.yml (on pull_request touching docs/**) and removes the next.config.js hook. The script no longer needs the glob dependency, so the job is checkout + setup-node + node. Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <[email protected]>
…stnames Suggests example.<saas-domain> (e.g. example.onelogin.com). Amp-Thread-ID: https://ampcode.com/threads/T-01a07e6a-e26f-753a-8486-cd5b81a79672 Co-authored-by: Amp <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
marcleblanc2
force-pushed
the
marc/docs/normalize-example-hostnames
branch
2 times, most recently
from
October 1, 2026 07:11
6e05535 to
02f8d7b
Compare
Contributor
Author
marcleblanc2
added a commit
that referenced
this pull request
Oct 2, 2026
Mapping entries can be literal text, a glob where `*` matches a run of hostname characters, or a `/regex/`. Matching ignores case, and `-`, `_`, and `.` in literal and glob entries match any of the three, so one entry covers the spelling variants the docs used. The JSON is 2-space indented with keys and lists sorted, and the duplicated literals are folded into glob and regex entries, including the patterns from #1933. The workflow runs only when a PR touches docs/ or the check itself. Amp-Thread-ID: https://ampcode.com/threads/T-01a0fdce-6d4c-708e-a1ac-c5a8f9e48a65 Co-authored-by: Amp <[email protected]>
This branch had an error being 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.
Stacked on #1876 (base branch is
docs/normalize-example-hostnames; GitHub will retarget tomainwhen that merges). Do not merge before #1876.What
Adds a GitHub Actions PR check, Example hostnames / Canonical example hostnames (
.github/workflows/check-hostnames.yml), that runs on every pull request touchingdocs/**and fails when a page uses a non-canonical placeholder hostname. The job is checkout +setup-node(version from.tool-versions) +node dev/check-hostnames.mjs; the script has no dependencies so there is no install step. Also runnable locally viapnpm run check-hostnames. It is not wired into the Next build, so Vercel deploys are unaffected.Flagged → suggested:
your-sourcegraph-instance.com,my_sourcegraph.io, …sourcegraph.example.comsourcegraph.yourcompany.com,sourcegraph.your-domain.com,sourcegraph.mycompany.com, …sourcegraph.example.comsourcegraph.company.com,sourcegraph.acme.io,sourcegraph.test:3443,sourcegraph.corpsourcegraph.example.commyinstance.sourcegraph.com,yourinstance.sourcegraph.com,example.sourcegraph.comsourcegraph.example.comsrc.example.com,src.acme.comsourcegraph.example.commy-gitlab.example.com(anymy-*.example.com)gitlab.example.combitbucketserver.example.com,your-bbs-instance.example.combitbucket.example.comgithub-enterprise.example.com,ghe.example.comgithub.example.comsmtp-server.example.comsmtp.example.commycompany.*,yourcompany.*,company.*,corp.*,acme.*,mydomain.*,yourdomain.*— e.g.grafana.mycompany.com,psql1.mycompany.org,github.internal.company.netgrafana.example.com,psql1.example.com,github.internal.example.commycompany.onelogin.com(anymycompany/acme/yourorg… tenant on a real SaaS domain)example.onelogin.com*.sgdev.orgSkipped, matching #1876: auto-generated
SCHEMA_SYNCblocks (fix upstream insourcegraph/sourcegraph) anddocs/technical-changelog.mdx.Output on failure is
docs/<file>:<line>plusfound:/use:so the fix is copy-pasteable.Also in this PR
Two leftover internal hosts the new check caught on top of #1876:
gitlab.sgdev.org/sourcegraph/src-cliinbatch-changes/tracking-existing-changesets.mdxandhttps://cse-k8s.sgdev.org/.api/graphqlincli/explanations/env.mdx.Verification
main(pre-docs/hostnames: Normalize placeholder hostnames to *.example.com #1876):❌ Found 127 non-canonical example hostname(s), exit 1.✅ All example hostnames are canonical!, exit 0.actionlintpasses on the workflow; the script runs green from a directory containing onlydocs/anddev/(nonode_modules).your-sourcegraph-instance.comandmy-gitlab.example.cominto a scratch.mdxfails the check with the expected suggestions.Amp threads
Replaces #1878 (branch renamed to
marc/docs/check-example-hostnames).