Conversation
- Add BugReportWidget.vue: persistent side-tab with expandable form, success/error states, responsive design (side panel on desktop, bottom sheet on mobile), dark mode support, and prefers-reduced-motion - Add Cloudflare Pages Function (docs/functions/api/report-bug.ts): creates GitHub issues via GitHub App installation token with honeypot anti-spam, IP-based rate limiting via KV, input validation, and CORS restricted to docs domain - Add VitePress custom theme extending default with layout-bottom slot - Add .github/ISSUE_TEMPLATE/bug.yml as fallback for direct GitHub reports - Add @cloudflare/workers-types and docs/functions/tsconfig.json - Exclude docs/ from main tsconfig to avoid type conflicts Closes #145
- Fix PKCS#1 vs PKCS#8 PEM detection: use "BEGIN RSA" presence to correctly identify PKCS#1 format (GitHub App PEMs) vs PKCS#8 - Add aria-modal="true" and focus trap to dialog panel for screen reader and keyboard-only accessibility - Return focus to trigger button when dialog closes - Extract pure utility functions to utils.ts for testability - Add 27 unit tests covering validation, CORS, base64url encoding, ASN.1 length encoding, and buffer concatenation
Import CATEGORIES and MIN_DESCRIPTION_LENGTH from shared utils into the Vue widget instead of duplicating values. Add explicit local variable narrowing in validateReport for stricter TypeScript compatibility.
The trigger button uses v-if and is recreated on state change. Focus must wait for DOM patch before the new element ref is available.
GitHub Pages returns 405 for POST requests because it's static-only hosting. The CF Pages Function in docs/functions/ was never deployed. Solution: standalone Cloudflare Worker at docs/worker/ with route rule docs.gitlab-mcp.sw.foundation/api/* intercepting requests before GitHub Pages. - Add docs/worker/ with wrangler.toml and Worker-format handler - Add deploy-worker job to docs.yml CI workflow - Add https://docs.gitlab-mcp.sw.foundation to ALLOWED_ORIGINS - Update test expectation for new primary origin Closes #153
- Widget: move from vertical side tab to floating bottom-right button with pulse animation and "Report Bug" label (more discoverable) - Logo: add project logo to navbar and hero section on landing page - Layout: add custom CSS with @media queries for wider content on screens >1440px and >1600px (reduces wasted horizontal space)
…d-report-a-bug-feedback-widget-to-docum # Conflicts: # docs/.vitepress/theme/components/BugReportWidget.vue # docs/.vitepress/theme/index.ts # docs/functions/api/utils.ts # tests/unit/docs/report-bug-handler.test.ts
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Deploys a bug-report backend that works with the static GitHub Pages docs site, while improving docs UI (bug widget, branding, and layout).
Changes:
- Add a standalone Cloudflare Worker for
POST /api/report-bug(GitHub App auth + KV rate limiting) and a CI job to deploy it. - Update the VitePress theme to include a more visible “Report Bug” floating widget and widen the layout on large screens.
- Add docs branding assets (logo in navbar + hero image) and a GitHub bug issue template.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds Cloudflare Workers type dependency to the lockfile. |
| tsconfig.json | Excludes docs/ from root TS compilation. |
| package.json | Adds @cloudflare/workers-types to devDependencies. |
| tests/unit/docs/report-bug-utils.test.ts | Unit tests for validation/CORS/encoding utilities used by the bug report API. |
| tests/unit/docs/report-bug-handler.test.ts | Unit tests for the Pages Function implementation of the bug report handler. |
| tests/unit/docs/cloudflare-types.d.ts | Minimal CF type stubs for the Jest environment. |
| docs/worker/wrangler.toml | Worker config with route and KV binding for rate limiting. |
| docs/worker/tsconfig.json | Worker-specific TS config using Workers types. |
| docs/worker/src/index.ts | Cloudflare Worker implementation of the bug report API endpoint. |
| docs/worker/package.json | Separate worker package metadata/dependencies. |
| docs/public/logo.png | Adds the navbar logo asset. |
| docs/index.md | Adds hero image configuration to the landing page. |
| docs/functions/tsconfig.json | Adds TS config for the (legacy/tested) functions code. |
| docs/functions/api/utils.ts | Extracts shared pure utilities for testability (validation/CORS/encoding helpers). |
| docs/functions/api/report-bug.ts | Pages Function implementation (JWT auth, KV rate limiting, create GitHub issue). |
| docs/.vitepress/theme/style.css | Adds layout widening and hero image sizing CSS overrides. |
| docs/.vitepress/theme/index.ts | Extends the default theme to mount the bug report widget. |
| docs/.vitepress/theme/components/BugReportWidget.vue | New floating bug report widget UI and client-side submit logic. |
| docs/.vitepress/config.mts | Adds themeConfig.logo for the navbar. |
| .github/workflows/docs.yml | Adds a deploy-worker job using cloudflare/wrangler-action@v3. |
| .github/ISSUE_TEMPLATE/bug.yml | Adds a structured GitHub bug report issue template. |
Comments suppressed due to low confidence (2)
docs/.vitepress/theme/components/BugReportWidget.vue:68
submit()always updatesstateafter the awaitedfetch(). If the user closes the widget (via the close button or Escape) while the request is in-flight, the resolved promise can setstateback tosuccess/errorand unexpectedly reopen the panel. Consider preventing closing whilestate === "submitting", or track a request id/AbortController and ignore late responses when the widget has been collapsed/unmounted.
if (response.ok) {
state.value = "success";
resetForm();
setTimeout(() => {
state.value = "collapsed";
}, 3000);
.github/workflows/docs.yml:82
deploy-workercan run even if the docsbuildjob fails (noneeds:dependency). This can deploy an updated API while the site build/deploy did not succeed, leaving the system in an inconsistent state. Addneeds: build(or similar gating) so the Worker only deploys after a successful build.
deploy-worker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy Cloudflare Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: docs/worker
| { | ||
| "name": "gitlab-mcp-docs-api", | ||
| "private": true, | ||
| "type": "module", | ||
| "devDependencies": { | ||
| "@cloudflare/workers-types": "^4.20241218.0", | ||
| "typescript": "^5.7.0", | ||
| "wrangler": "^3.99.0" | ||
| } | ||
| } |
There was a problem hiding this comment.
docs/worker is set up as a separate package (with its own package.json) but there’s no lockfile in that directory. Combined with caret (^) ranges, Worker deployments via CI can become non-deterministic as transitive deps change. Consider either making docs/worker a Yarn workspace managed by the root lockfile, or pin exact versions and add a lockfile for the worker directory.
| export default { | ||
| async fetch(request: Request, env: Env): Promise<Response> { | ||
| const url = new URL(request.url); | ||
|
|
||
| if (url.pathname !== "/api/report-bug") { | ||
| return new Response("Not Found", { status: 404 }); | ||
| } | ||
|
|
||
| if (request.method === "OPTIONS") { | ||
| return handleOptions(request); | ||
| } | ||
|
|
||
| if (request.method === "POST") { | ||
| return handlePost(request, env); | ||
| } | ||
|
|
||
| return new Response("Method Not Allowed", { status: 405 }); | ||
| }, | ||
| }; |
There was a problem hiding this comment.
This Worker implementation is the production handler for /api/report-bug, but the new unit tests target docs/functions/api/report-bug.ts instead. That means the deployed code path is currently untested and can drift from the tested implementation. Consider refactoring to share a single tested handler between docs/worker/src/index.ts and the Pages Function (or add dedicated unit tests that import/call the Worker handler).
## [6.33.2](v6.33.1...v6.33.2) (2026-01-23) ### Bug Fixes * **docs:** deploy bug report API as CF Worker + improve widget & layout ([#154](#154)) ([e8284bc](e8284bc)), closes [#145](#145) [PKCS#1](https://github.com/structured-world/PKCS/issues/1) [PKCS#8](https://github.com/structured-world/PKCS/issues/8) [PKCS#1](https://github.com/structured-world/PKCS/issues/1) [PKCS#8](https://github.com/structured-world/PKCS/issues/8) [#153](#153)
|
🎉 This PR is included in version 6.33.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
@mediaqueries for screens >1440px and >1600pxTechnical Details
docs/worker/— standalone CF Worker with routedocs.gitlab-mcp.sw.foundation/api/*/api/report-bugbefore it reaches GitHub Pages origindeploy-workerusescloudflare/wrangler-action@v367e3b42cfafe492bbc8bbb17fe5c6b8bfor IP-based rate limitinghttps://docs.gitlab-mcp.sw.foundationas primary originsw-release-bot(ID: 2686935) withissues:writepermissionPost-merge steps
After CI deploys the Worker:
Test plan
yarn lint— 0 errorsyarn test— 3746 passedyarn docs:build— builds successfully/api/report-bugreturns 201Closes #145, closes #153