-
Notifications
You must be signed in to change notification settings - Fork 327
Experiment #127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Experiment #127
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c08f509
Add mapgen: DSL-to-draw.io generator prototype (tools/mapgen)
DmitrievDmitriyA 6b90732
Add mapcheck: CI validation for the roadmap maps (box-fit, overlaps, …
DmitrievDmitriyA 4962c44
mapgen: bilateral spine with per-language computed hub-x
DmitrievDmitriyA e16e2bf
mapgen: center node, vertical centering, local packing, side-aware hi…
DmitrievDmitriyA bb63d09
Updated TODO.md
DmitrievDmitriyA 470d989
Generate the roadmap maps from a language-neutral mapgen source (word…
DmitrievDmitriyA 8f725f7
mapgen: place hints by explicit angle/dist; restructure source Hints …
DmitrievDmitriyA ea5b8c0
mapgen: move extract/remap into bootstrap/; document DSL angle/dist e…
DmitrievDmitriyA 5b9fd1c
Updates to the dsl and to TODO.md
DmitrievDmitriyA fcd3a3c
mapgen: migrate build engine PowerShell -> Python; hint arrow start s…
DmitrievDmitriyA 07735e7
Updated hints' position in dsl
DmitrievDmitriyA 45416c8
Updated hints' position in dsl
DmitrievDmitriyA eb9fc32
Updated the graphes after the migration
DmitrievDmitriyA 63f29a9
Updated cross-references
DmitrievDmitriyA 3cc3aa1
Added unit tests for the mapgen engine
DmitrievDmitriyA 8e7dae9
Fixed broken links
DmitrievDmitriyA 327eb4c
Applied review remarks
DmitrievDmitriyA c3de694
Tuned lychee
DmitrievDmitriyA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Generated maps are written by tools/mapgen/build.py with LF endings. Pin them to LF so a | ||
| # checkout doesn't rewrite them to CRLF on Windows: otherwise `build.py --deploy` reports | ||
| # three modified files whose only change is line endings. Keeps the working tree | ||
| # byte-identical to what the generator produces. | ||
| *.drawio.svg text eol=lf | ||
| *.drawio text eol=lf | ||
|
|
||
| # The map source is likewise generator-written / hand-edited in lockstep with it. | ||
| tools/mapgen/roadmap/*.dsl text eol=lf | ||
| tools/mapgen/roadmap/*.tsv text eol=lf |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,40 @@ | ||
| # Fast, deterministic link check that runs on every PR. | ||
| # | ||
| # This checks ONLY internal links -- relative paths between files in the repo. Those are | ||
| # the ones a PR can actually break (a moved file, a wrong ../ prefix), and they never fail | ||
| # for reasons outside the repo, so this check is safe to require for merge. It takes | ||
| # milliseconds because nothing goes over the network. | ||
| # | ||
| # External URLs are NOT checked here on purpose. There are ~370 of them; any one being | ||
| # down, rate-limited, or blocking datacenter IPs would fail an unrelated PR. They are swept | ||
| # monthly instead by link-audit.yml, which opens an issue rather than blocking anyone. | ||
|
|
||
| name: Check links | ||
|
|
||
| on: | ||
| pull_request: | ||
| schedule: | ||
| # Every Monday at 06:00 UTC | ||
| - cron: "0 6 * * 1" | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| # NOTE: job id `lychee` is deliberate -- the required status check is named | ||
| # "Check links / lychee". Renaming this job would break branch protection. | ||
| lychee: | ||
| name: lychee | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Restore lychee cache | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: .lycheecache | ||
| key: cache-lychee-${{ github.sha }} | ||
| restore-keys: cache-lychee- | ||
|
|
||
| - name: Check links in markdown files | ||
| - name: Check internal links | ||
| uses: lycheeverse/lychee-action@v2 | ||
| id: lychee | ||
| with: | ||
| args: >- | ||
| --offline | ||
| --no-progress | ||
| --accept 200..=204,429 | ||
| --max-retries 2 | ||
| --timeout 45 | ||
| --cache | ||
| --max-cache-age 1d | ||
| "**/*.md" | ||
| fail: true | ||
| output: ./lychee/out.md | ||
|
|
||
| - name: Create Issue From File | ||
| if: failure() && github.event_name == 'schedule' | ||
| uses: peter-evans/create-issue-from-file@v6 | ||
| with: | ||
| title: Link Checker Report | ||
| content-filepath: ./lychee/out.md | ||
| labels: report, automated issue |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Monthly sweep of every EXTERNAL link in the repo. | ||
| # | ||
| # Split out of check-links.yml so that third-party outages never block a pull request. | ||
| # This workflow does not gate anything: it runs on the 1st of each month, and when it | ||
| # finds dead links it files (or updates) a single "Link Checker Report" issue to work | ||
| # through when convenient. Run it on demand any time from the Actions tab. | ||
| # | ||
| # Fixing what it reports: replace the dead link, or -- if the site is alive in a browser | ||
| # but blocks CI (403/415/redirect loop from datacenter IPs) -- add it to .lycheeignore | ||
| # with a comment saying why. See CONTRIBUTING.md. | ||
|
|
||
| name: Link audit | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 6 1 * *" # 06:00 UTC on the 1st of every month | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| audit: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| issues: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
|
|
||
| - name: Restore lychee cache | ||
| uses: actions/cache@v6 | ||
| with: | ||
| path: .lycheecache | ||
| key: cache-lychee-${{ github.sha }} | ||
| restore-keys: cache-lychee- | ||
|
|
||
| - name: Check all links | ||
| uses: lycheeverse/lychee-action@v2 | ||
| id: lychee | ||
| with: | ||
| args: >- | ||
| --no-progress | ||
| --accept 200..=204,429 | ||
| --max-retries 3 | ||
| --retry-wait-time 5 | ||
| --timeout 45 | ||
| --cache | ||
| --max-cache-age 1d | ||
| "**/*.md" | ||
| fail: false # never fail the run; the issue is the output | ||
| output: ./lychee/out.md | ||
|
|
||
| # Reuse one issue instead of opening a new one every month. | ||
| - name: Find existing report issue | ||
| if: steps.lychee.outputs.exit_code != 0 | ||
| id: existing | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| num=$(gh issue list --state open --label "automated issue" \ | ||
| --search "Link Checker Report in:title" \ | ||
| --json number --jq '.[0].number // empty') | ||
| echo "number=$num" >> "$GITHUB_OUTPUT" | ||
| echo "Existing report issue: ${num:-none}" | ||
|
|
||
| - name: File or update the report | ||
| if: steps.lychee.outputs.exit_code != 0 | ||
| uses: peter-evans/create-issue-from-file@v6 | ||
| with: | ||
| title: Link Checker Report | ||
| content-filepath: ./lychee/out.md | ||
| labels: report, automated issue | ||
| issue-number: ${{ steps.existing.outputs.number }} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Validates the roadmap maps on every PR that touches them or the generator. | ||
| # | ||
| # The three <Language>/Graph/roadmap.drawio.svg maps are build output of tools/mapgen — | ||
| # generated from one language-neutral source (structure.dsl + <lang>.tsv). CI cannot | ||
| # rebuild them (that needs the draw.io desktop CLI), so instead it verifies that what was | ||
| # committed is valid and still matches the source: | ||
| # | ||
| # 1. Unit-test the generator — DSL parser + hint geometry (no Pillow/draw.io needed). | ||
| # 2. Validate the maps — tools/mapcheck: text fits its box, nothing overlaps, and | ||
| # the committed maps match structure.dsl / <lang>.tsv | ||
| # (so a forgotten rebuild fails here rather than shipping). | ||
| # | ||
| # Hard errors fail the build; cross-language drift and a stale "Last updated" date are | ||
| # reported as warnings. See tools/mapcheck/README.md. | ||
|
|
||
| name: Check maps | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "*/Graph/roadmap.drawio.svg" | ||
| - "tools/mapgen/**" # DSL/tsv source — the map-vs-DSL check compares against it | ||
| - "tools/mapcheck/**" | ||
| - ".github/workflows/map-check.yml" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| mapcheck: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v7 | ||
| with: | ||
| fetch-depth: 0 # date check reads each map's last-commit date | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Unit-test the generator | ||
| run: python tools/mapgen/test_build.py # parser + geometry math; no Pillow/draw.io needed | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --quiet Pillow | ||
| sudo apt-get update -qq | ||
| # Liberation Sans is metric-compatible with Arial (what draw.io uses); | ||
| # Noto CJK covers the Chinese map. | ||
| sudo apt-get install -y -qq fonts-liberation fonts-noto-cjk | ||
|
|
||
| - name: Validate maps | ||
| run: python tools/mapcheck/check.py | ||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.