Skip to content

feat(docs): deploy Sphinx site to Cloudflare - #49

Merged
HsiangNianian merged 1 commit into
mainfrom
feat/cloudflare-docs
Jul 30, 2026
Merged

feat(docs): deploy Sphinx site to Cloudflare#49
HsiangNianian merged 1 commit into
mainfrom
feat/cloudflare-docs

Conversation

@HsiangNianian

@HsiangNianian HsiangNianian commented Jul 30, 2026

Copy link
Copy Markdown
Member

What changed

  • build the Sphinx/Furo site through pinned repository scripts
  • deploy the exact verified artifact to Cloudflare Workers Static Assets on oneroll.hydroroll.team
  • run production deployment only from main through the protected docs-production environment
  • verify the live site and 404 behavior after every deployment
  • document local development, deployment prerequisites, smoke checks, and rollback

Why

The previous workflow published directly to the legacy gh-pages branch and did not verify the production domain. This gives the documentation a reproducible build, a least-privilege PR path, and a post-deploy production check.

Related to #20.

Validation

  • uv run --frozen python -m unittest discover -s tests -v — 91 passed
  • uv run ruff check .
  • uv run ruff format --check .
  • npm run docs:build
  • npm run docs:deploy:dry-run
  • npm audit --registry=https://registry.npmjs.org — 0 vulnerabilities
  • initial production deployment and smoke test at https://oneroll.hydroroll.team/

Summary by Sourcery

Deploy the Sphinx/Furo documentation site to Cloudflare Workers using a reproducible artifact built in CI and gated by the existing quality workflow.

New Features:

  • Introduce a Cloudflare Workers-based deployment target for the documentation site at https://oneroll.hydroroll.team/.
  • Add npm-based scripts for cleaning, building, locally serving, and deploying the Sphinx documentation via Wrangler.
  • Add live documentation and deployment pages to the roadmap and docs index, including custom headers support in the Sphinx config.

Enhancements:

  • Restrict the docs workflow triggers to documentation- and build-related file changes and enforce scoped read-only permissions with concurrency control.
  • Refactor the docs CI pipeline to build once, verify the generated artifact, upload it, and deploy only from main via a protected docs-production environment.
  • Add contract tests that validate the Cloudflare Wrangler configuration, package.json scripts, and CI deployment steps for the docs site.

Documentation:

  • Update README and Sphinx documentation to reference the live site and document the deployment process and behaviors.

Tests:

  • Add unit tests to enforce the docs workflow contract with Cloudflare deployment, artifact upload, production environment gating, and post-deploy smoke checks.
  • Add unit tests to validate the Wrangler docs configuration and npm scripts to guarantee the local CLI path matches the CI deployment behavior.

@HsiangNianian
HsiangNianian requested a review from fu050409 July 30, 2026 18:19
@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

Docs workflow now builds Sphinx/Furo docs via npm/uv, publishes the built artifact to Cloudflare Workers on oneroll.hydroroll.team behind a protected production environment, and adds tests and docs to enforce the deployment contract and smoke checks.

Sequence diagram for the new docs CI build-and-deploy pipeline

sequenceDiagram
    actor Developer
    participant GitHubActions
    participant docs_build_job
    participant docs_deploy_job
    participant CloudflareWranglerAction
    participant CloudflareWorkers

    Developer->>GitHubActions: push to main with docs changes
    GitHubActions->>docs_build_job: start build job
    docs_build_job->>docs_build_job: npm run docs:build
    docs_build_job->>docs_build_job: actions/upload-artifact
    docs_build_job-->>GitHubActions: build artifact oneroll-docs-${{ github.sha }}

    alt [ref is main && event is push]
        GitHubActions->>docs_deploy_job: start deploy job
        docs_deploy_job->>docs_deploy_job: actions/download-artifact
        docs_deploy_job->>CloudflareWranglerAction: cloudflare/wrangler-action deploy
        CloudflareWranglerAction->>CloudflareWorkers: deploy --config wrangler.docs.jsonc --strict
        docs_deploy_job->>CloudflareWorkers: curl smoke checks on core pages
        docs_deploy_job->>CloudflareWorkers: curl 404 check for missing page
    else [pull_request or non-main]
        GitHubActions-->>Developer: build-only, no deploy
    end
Loading

File-Level Changes

Change Details Files
Restructure the docs CI workflow to build once, publish an artifact, and deploy only from main to a protected Cloudflare-backed production environment with smoke tests.
  • Limit docs workflow triggers to documentation- and build-related paths on push to main and relevant pull requests.
  • Add workflow-level permissions and concurrency controls for docs jobs.
  • Refactor the workflow into separate build and deploy jobs, wiring deploy to depend on build and gating it on main branch non-PR events.
  • Switch docs build to an npm-based Sphinx/Furo build, verify the build artifact, and upload it as a versioned artifact.
  • Introduce a deploy job that downloads the artifact and deploys it via cloudflare/wrangler-action, then verifies core pages and 404 behavior on the production domain.
.github/workflows/docs.yml
Add tests that enforce the new Cloudflare docs deployment pipeline, contract, and CLI behavior.
  • Update quality gate tests to assert docs workflow triggers, build command, artifact upload, deploy job configuration, Cloudflare action wiring, and smoke test content.
  • Add a dedicated deployment contract test module that validates wrangler config routes, asset directory, 404 handling, and npm scripts for build and deploy.
  • Ensure tests cover wrangler version pinning and that local CLI scripts target the same Sphinx output as CI.
tests/test_quality_gate.py
tests/test_docs_deployment_contract.py
Introduce npm and Wrangler configuration to build and deploy Sphinx docs to Cloudflare Workers Static Assets and support local workflows.
  • Create package.json and package-lock.json with docs-specific scripts for cleaning, building, dev server, deploy, and deploy dry-run, all wired through uv and wrangler.
  • Pin wrangler as a dev dependency and align script commands with the CI deploy command.
  • Add wrangler.docs.jsonc to configure Cloudflare Workers assets, not-found handling, and routing for oneroll.hydroroll.team under the hydroroll.team zone.
package.json
package-lock.json
wrangler.docs.jsonc
Update Sphinx configuration and docs content to support Cloudflare deployment and expose the live site.
  • Configure Sphinx to ship an additional _headers static file via html_extra_path.
  • Add a _headers file in docs/source for custom HTTP headers (e.g., for Cloudflare / static hosting).
  • Update README to link to the live documentation site and a dedicated deployment guide page.
  • Add a deployment.rst doc describing deployment prerequisites, local commands, smoke checks, and rollback (content not shown in diff but implied by new file).
docs/source/conf.py
docs/source/_headers
docs/source/deployment.rst
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@HsiangNianian
HsiangNianian marked this pull request as ready for review July 30, 2026 18:25
@HsiangNianian
HsiangNianian merged commit 8e3cc1a into main Jul 30, 2026
20 of 21 checks passed

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 14 security issues, 4 other issues, and left some high level feedback:

Security issues:

  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • Apache-2.0 AND LGPL-3.0-or-later AND MIT: Open-source license can require releasing the entire application source (link)
  • Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)
  • Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source (link)

General comments:

  • The deployment smoke test in docs.yml hardcodes specific paths and the 404 check inline in the workflow; consider moving these checks into a reusable script so they can be versioned and updated alongside the docs code without editing the workflow YAML.
  • The Verify deployment artifact step in docs.yml asserts the presence of the string furo in index.html, which couples the pipeline to the current theme; replacing this with a more stable structural check (e.g., a known element or metadata) would make the build verification less brittle if the theme or branding changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The deployment smoke test in `docs.yml` hardcodes specific paths and the 404 check inline in the workflow; consider moving these checks into a reusable script so they can be versioned and updated alongside the docs code without editing the workflow YAML.
- The `Verify deployment artifact` step in `docs.yml` asserts the presence of the string `furo` in `index.html`, which couples the pipeline to the current theme; replacing this with a more stable structural check (e.g., a known element or metadata) would make the build verification less brittle if the theme or branding changes.

## Individual Comments

### Comment 1
<location path=".github/workflows/docs.yml" line_range="61-65" />
<code_context>
+      - name: Build Furo documentation
+        run: npm run docs:build
+
+      - name: Verify deployment artifact
+        run: |
+          set -euo pipefail
+          test -s docs/_build/html/index.html
+          grep -Fq "furo" docs/_build/html/index.html
+          test ! -e docs/_build/html/.doctrees
+
</code_context>
<issue_to_address>
**suggestion:** Verification relying on the literal string "furo" in index.html is brittle and tightly coupled to the current theme/content.

This assertion is likely to fail on benign changes (theme rename, HTML restructuring, or content edits). If you want to verify that Furo is used, prefer a more stable signal (e.g., checking for a specific CSS/JS asset or a structural marker in a particular element) rather than a generic text occurrence, so the check reflects the build contract rather than page content.

Suggested implementation:

```
      - name: Build Furo documentation
        run: npm run docs:build

      - name: Verify deployment artifact
        run: |
          set -euo pipefail
          test -s docs/_build/html/index.html
          grep -Fq '_static/styles/furo.css' docs/_build/html/index.html
          test ! -e docs/_build/html/.doctrees

```

This change assumes that the built Furo docs always include a stylesheet link to `_static/styles/furo.css` in `index.html`, which is the default for the Furo Sphinx theme. If your configuration customizes asset paths or names, adjust the `grep` pattern to match a more stable structural marker (e.g. a theme-specific `<div class="content">` wrapper or a `data-theme="furo"` attribute) that reliably indicates the Furo theme is in use.
</issue_to_address>

### Comment 2
<location path="tests/test_quality_gate.py" line_range="66-75" />
<code_context>
+    def test_docs_changes_build_and_deploy_to_cloudflare(self):
</code_context>
<issue_to_address>
**suggestion (testing):** Add assertions that the deploy job consumes the uploaded artifact, not rebuilding docs independently.

Right now the test only asserts that docs are built and that `deploy` depends on `build`. To ensure the deploy job actually uses the built docs, extend the test to check for a correctly configured `actions/download-artifact` (or equivalent) step in `deploy["steps"]` that matches the upload name. This will validate that deployment uses the verified artifact rather than rebuilding or using a different output.
</issue_to_address>

### Comment 3
<location path="tests/test_docs_deployment_contract.py" line_range="7-13" />
<code_context>
+
+
+ROOT = Path(__file__).parents[1]
+WRANGLER_CONFIG = ROOT / "wrangler.docs.jsonc"
+PACKAGE_JSON = ROOT / "package.json"
+
+
+class DocsDeploymentContractTests(unittest.TestCase):
+    def test_wrangler_serves_sphinx_output_on_the_documentation_domain(self):
+        config = json.loads(WRANGLER_CONFIG.read_text(encoding="utf-8"))
+
+        self.assertEqual(config["name"], "oneroll-docs")
</code_context>
<issue_to_address>
**issue (bug_risk):** Using `json.loads` for a `.jsonc` file is fragile and may break when comments or JSONC features are used.

Because Wrangler accepts comments and other JSONC features, this test may fail on a config that Wrangler itself would load successfully (e.g., comments, trailing commas). That makes the test brittle and out of sync with real behavior. Consider using a JSONC/JSON5-capable parser or stripping comments before `json.loads` so the test validates the same syntax rules Wrangler uses.
</issue_to_address>

### Comment 4
<location path="tests/test_docs_deployment_contract.py" line_range="28-18" />
<code_context>
+            ],
+        )
+
+    def test_local_cli_builds_and_deploys_the_same_documentation_target(self):
+        package = json.loads(PACKAGE_JSON.read_text(encoding="utf-8"))
+
+        self.assertTrue(package["private"])
+        self.assertEqual(package["devDependencies"]["wrangler"], "4.116.0")
+        build = package["scripts"]["docs:build"]
+        self.assertEqual(
+            package["scripts"]["docs:clean"],
+            "uv run --frozen sphinx-build -M clean docs/source docs/_build",
</code_context>
<issue_to_address>
**suggestion (testing):** Extend the contract test to cover the `docs:deploy:dry-run` script mentioned in the PR description.

The test currently covers `docs:build` and `docs:deploy`, but not `npm run docs:deploy:dry-run`, which is also part of the deployment toolchain mentioned in the PR description. Please extend the contract test to assert that `docs:deploy:dry-run` exists and targets the same `wrangler.docs.jsonc` config (e.g., dry-run with `--config wrangler.docs.jsonc`) so local dry runs remain aligned with production deployments.
</issue_to_address>

### Comment 5
<location path="package-lock.json" line_range="648-664" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-darwin-arm64):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 6
<location path="package-lock.json" line_range="665-681" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-darwin-x64):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 7
<location path="package-lock.json" line_range="682-698" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-linux-arm):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 8
<location path="package-lock.json" line_range="699-715" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-linux-arm64):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 9
<location path="package-lock.json" line_range="716-732" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-linux-ppc64):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 10
<location path="package-lock.json" line_range="733-749" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-linux-riscv64):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 11
<location path="package-lock.json" line_range="750-766" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-linux-s390x):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 12
<location path="package-lock.json" line_range="767-783" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-linux-x64):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 13
<location path="package-lock.json" line_range="784-800" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-linuxmusl-arm64):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 14
<location path="package-lock.json" line_range="801-817" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-libvips-linuxmusl-x64):** LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 15
<location path="package-lock.json" line_range="1002-1018" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-wasm32):** Apache-2.0 AND LGPL-3.0-or-later AND MIT: Open-source license can require releasing the entire application source

This `Apache-2.0 AND LGPL-3.0-or-later AND MIT` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 16
<location path="package-lock.json" line_range="1039-1058" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-win32-arm64):** Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `Apache-2.0 AND LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 17
<location path="package-lock.json" line_range="1059-1078" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-win32-ia32):** Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `Apache-2.0 AND LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

### Comment 18
<location path="package-lock.json" line_range="1079-1098" />
<code_context>

</code_context>
<issue_to_address>
**security (license/@img/sharp-win32-x64):** Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This `Apache-2.0 AND LGPL-3.0-or-later` open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

*Source: trivy*
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +61 to +65
- name: Verify deployment artifact
run: |
set -euo pipefail
test -s docs/_build/html/index.html
grep -Fq "furo" docs/_build/html/index.html

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Verification relying on the literal string "furo" in index.html is brittle and tightly coupled to the current theme/content.

This assertion is likely to fail on benign changes (theme rename, HTML restructuring, or content edits). If you want to verify that Furo is used, prefer a more stable signal (e.g., checking for a specific CSS/JS asset or a structural marker in a particular element) rather than a generic text occurrence, so the check reflects the build contract rather than page content.

Suggested implementation:

      - name: Build Furo documentation
        run: npm run docs:build

      - name: Verify deployment artifact
        run: |
          set -euo pipefail
          test -s docs/_build/html/index.html
          grep -Fq '_static/styles/furo.css' docs/_build/html/index.html
          test ! -e docs/_build/html/.doctrees

This change assumes that the built Furo docs always include a stylesheet link to _static/styles/furo.css in index.html, which is the default for the Furo Sphinx theme. If your configuration customizes asset paths or names, adjust the grep pattern to match a more stable structural marker (e.g. a theme-specific <div class="content"> wrapper or a data-theme="furo" attribute) that reliably indicates the Furo theme is in use.

Comment on lines +66 to +75
def test_docs_changes_build_and_deploy_to_cloudflare(self):
workflow = load_workflow("docs.yml")
push = workflow["on"]["push"]
pull_request = workflow["on"]["pull_request"]

self.assertEqual(push["branches"], ["main"])
for changed_paths in (push["paths"], pull_request["paths"]):
self.assertIn("docs/**", changed_paths)
self.assertIn("wrangler.docs.jsonc", changed_paths)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (testing): Add assertions that the deploy job consumes the uploaded artifact, not rebuilding docs independently.

Right now the test only asserts that docs are built and that deploy depends on build. To ensure the deploy job actually uses the built docs, extend the test to check for a correctly configured actions/download-artifact (or equivalent) step in deploy["steps"] that matches the upload name. This will validate that deployment uses the verified artifact rather than rebuilding or using a different output.

Comment on lines +7 to +13
WRANGLER_CONFIG = ROOT / "wrangler.docs.jsonc"
PACKAGE_JSON = ROOT / "package.json"


class DocsDeploymentContractTests(unittest.TestCase):
def test_wrangler_serves_sphinx_output_on_the_documentation_domain(self):
config = json.loads(WRANGLER_CONFIG.read_text(encoding="utf-8"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Using json.loads for a .jsonc file is fragile and may break when comments or JSONC features are used.

Because Wrangler accepts comments and other JSONC features, this test may fail on a config that Wrangler itself would load successfully (e.g., comments, trailing commas). That makes the test brittle and out of sync with real behavior. Consider using a JSONC/JSON5-capable parser or stripping comments before json.loads so the test validates the same syntax rules Wrangler uses.

self.assertEqual(config["name"], "oneroll-docs")
self.assertEqual(config["assets"]["directory"], "./docs/_build/html")
self.assertEqual(config["assets"]["not_found_handling"], "none")
self.assertEqual(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (testing): Extend the contract test to cover the docs:deploy:dry-run script mentioned in the PR description.

The test currently covers docs:build and docs:deploy, but not npm run docs:deploy:dry-run, which is also part of the deployment toolchain mentioned in the PR description. Please extend the contract test to assert that docs:deploy:dry-run exists and targets the same wrangler.docs.jsonc config (e.g., dry-run with --config wrangler.docs.jsonc) so local dry runs remain aligned with production deployments.

Comment thread package-lock.json
Comment on lines +648 to +664
"node_modules/@img/sharp-libvips-darwin-arm64": {
"version": "1.3.1",
"resolved": "https://registry.npmmirror.com/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.1.tgz",
"integrity": "sha512-4V/M3roRMTYjiwZY9IOVQOE8OyeCxFAkYmyZDrZl51uOKjibm3oeEJ4WAmLxutAfzFbC9jqUiPs2gbnGflH+7g==",
"cpu": [
"arm64"
],
"dev": true,
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
"darwin"
],
"funding": {
"url": "https://opencollective.com/libvips"
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@img/sharp-libvips-darwin-arm64): LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This LGPL-3.0-or-later open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

Source: trivy

Comment thread package-lock.json
Comment on lines +801 to +817
"node_modules/@img/sharp-libvips-linuxmusl-x64": {
"version": "1.3.1",
"resolved": "https://registry.npmmirror.com/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.1.tgz",
"integrity": "sha512-yO21HwoUVLN8Qa+/SBjQLMYwBWAVJjeGPNe+hc0OUeMeifEtJqu5a1c4HayE1nNpDih9y3/KkoltfkDodmKAlg==",
"cpu": [
"x64"
],
"dev": true,
"license": "LGPL-3.0-or-later",
"optional": true,
"os": [
"linux"
],
"funding": {
"url": "https://opencollective.com/libvips"
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@img/sharp-libvips-linuxmusl-x64): LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This LGPL-3.0-or-later open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

Source: trivy

Comment thread package-lock.json
Comment on lines +1002 to +1018
"node_modules/@img/sharp-wasm32": {
"version": "0.35.2",
"resolved": "https://registry.npmmirror.com/@img/sharp-wasm32/-/sharp-wasm32-0.35.2.tgz",
"integrity": "sha512-Mrv4JQNYVQ94xH+jzZ9r+gowleN8mv2FTgKT+PI6bx5C0G8TdNYndu161pg2i7uoBwxy2ImPMHrJOM2LZef7Bw==",
"dev": true,
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
"optional": true,
"dependencies": {
"@emnapi/runtime": "^1.11.1"
},
"engines": {
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@img/sharp-wasm32): Apache-2.0 AND LGPL-3.0-or-later AND MIT: Open-source license can require releasing the entire application source

This Apache-2.0 AND LGPL-3.0-or-later AND MIT open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

Source: trivy

Comment thread package-lock.json
Comment on lines +1039 to +1058
"node_modules/@img/sharp-win32-arm64": {
"version": "0.35.2",
"resolved": "https://registry.npmmirror.com/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.2.tgz",
"integrity": "sha512-BiVRYc/t6/Vl3e1hBx0hugG4oN9Pydf4fgMSpxTQJmwGUg/YoXTWHiFeRymHfCZzifxu4F4rpk/I67D0LQ20wQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "Apache-2.0 AND LGPL-3.0-or-later",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@img/sharp-win32-arm64): Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This Apache-2.0 AND LGPL-3.0-or-later open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

Source: trivy

Comment thread package-lock.json
Comment on lines +1059 to +1078
"node_modules/@img/sharp-win32-ia32": {
"version": "0.35.2",
"resolved": "https://registry.npmmirror.com/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.2.tgz",
"integrity": "sha512-YYEhx9PImCC7T0tI8JDMi4DB9LwLCXCU5OWNYEXAxh5Q1ShKkyC6byxzoBJ3gEFDnH2lQckWuDe70G7mB2XJog==",
"cpu": [
"ia32"
],
"dev": true,
"license": "Apache-2.0 AND LGPL-3.0-or-later",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": "^20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@img/sharp-win32-ia32): Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This Apache-2.0 AND LGPL-3.0-or-later open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

Source: trivy

Comment thread package-lock.json
Comment on lines +1079 to +1098
"node_modules/@img/sharp-win32-x64": {
"version": "0.35.2",
"resolved": "https://registry.npmmirror.com/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.2.tgz",
"integrity": "sha512-imoOyBcoM/iiUr4J6VPpCNjPnjvP/Gks95898yB8YqoGGYmHYbOyCuNv9FMhFgtaiHFGbHW8bxKqRV6VjtXThQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "Apache-2.0 AND LGPL-3.0-or-later",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security (license/@img/sharp-win32-x64): Apache-2.0 AND LGPL-3.0-or-later: Open-source license can require releasing the entire application source

This Apache-2.0 AND LGPL-3.0-or-later open-source license can impose strong copyleft or non-commercial obligations that may require releasing your full application source code or restrict commercial use, depending on how the code is used or distributed

Source: trivy

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant