[codex] Check in docs-site generated output#598
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43bf6dc239
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <a href="/docs/cookbook/">native cookbook</a>. For full lessons, use the | ||
| <a href="/docs/learning/native/">native learning path</a>.</p><h2 id="cli-and-project-shape">CLI And Project Shape</h2><ul><li><a href="/docs/reference/cli/">CLI</a>: current <code>gowdk</code> command surface.</li><li><a href="/docs/reference/config/">Config</a>: current Go config types and build target fields.</li><li><a href="/docs/reference/dev/">Dev server</a>: <code>gowdk dev</code> rebuild, live reload, generated-app restart, |
There was a problem hiding this comment.
Generate the linked cookbook and learning pages
This committed page links to /docs/cookbook/ and /docs/learning/native/, but neither path exists under docs-site/dist/site and neither route appears in gowdk-routes.json, so the checked-in site served by docs-site/main.go returns 404 for both. Please include the cookbook/learning markdown in the generated site or keep these as repository links before relying on this committed output.
Useful? React with 👍 / 👎.
| examples/pages/home.page.gwdk \ | ||
| examples/pages/hero.cmp.gwdk | ||
| </code></pre><p>For a broader path, use <a href="/docs/learning/native/">Native Learning Path</a> and the | ||
| full-stack <a href="/docs/../examples/flagship/">flagship example</a>.</p><h2 id="playground-cli">Playground CLI</h2><p>Inspect the sandbox policy:</p><pre><code class="language-sh">gowdk playground policy |
There was a problem hiding this comment.
Keep example links from becoming docs routes
This generated link normalizes to /examples/flagship/, but the checked-in dist/site tree has no examples/flagship/index.html, so clicking the flagship example from the published Playground page will 404. Links that leave the docs/ tree need to remain source/GitHub links or be excluded from the .md route rewrite before committing dist/site.
Useful? React with 👍 / 👎.
| "stage": "manifest", | ||
| "kind": "security_manifest_written", | ||
| "message": "security manifest written", | ||
| "path": "/tmp/gowdk-distfix/docs-site/dist/.gowdk/reports/site/gowdk-security.json" |
There was a problem hiding this comment.
Remove local build paths from committed reports
Because dist/site is now checked in and served, this report publishes the build machine's /tmp/gowdk-distfix/... path and will churn every time another maintainer regenerates the site from a different checkout. Keep committed reports deterministic by recording a path relative to dist/site or omitting the private security-report path from the public build report.
Useful? React with 👍 / 👎.
| `go.mod`. Use `go run ../cmd/gowdk ...` for compiler/build commands that | ||
| should run against the in-tree repository checkout. | ||
| `go.mod`. Build the in-tree CLI with | ||
| `(cd .. && go build -o docs-site/tools/gowdk ./cmd/gowdk)` before compiler |
There was a problem hiding this comment.
Create tools before building the local CLI
In a fresh checkout docs-site/tools/ is not present, and go build -o docs-site/tools/gowdk does not create missing parent directories, so the documented prereq/develop/build commands fail before ./tools/gowdk exists. Add mkdir -p docs-site/tools or use an existing ignored output path with this command.
Useful? React with 👍 / 👎.
| dist/* | ||
| !dist/site/ | ||
| !dist/site/** |
There was a problem hiding this comment.
Re-apply secret ignores under dist/site
This broad unignore makes every file under the committed output tree trackable, overriding the repository-level ignores for .env, *.key, *.pem, logs, and similar files. When the documented build copies assets/. into dist/site/assets, an ignored local secret accidentally left in assets would be staged by git add docs-site/dist/site; re-ignore secret/local patterns after this exception or narrow the exception to the generated file set.
Useful? React with 👍 / 👎.
Summary
docs-site/dist/siteso Render's default Go build can deploy the docs-site server without a custom build command.docs-site/dist/sitewhile keeping other generated/local output ignored.tools/gowdkCLI binary before regenerating output when the custom build command is used.Why
After #597, the docs-site server compiles cleanly without
//go:embed, but Render's default Go service build still only runs:go build -tags netgo -ldflags '-s -w' -o appThat produces
./appbut does not generatedist/site, so startup fails with:If the service cannot rely on a custom Build Command, the generated site output has to be present in the checkout. This PR makes that explicit.
Verification
(cd .. && go build -o docs-site/tools/gowdk ./cmd/gowdk)go run ./cmd/syncdocs./tools/gowdk buildgo test ./...fromdocs-site.docs-site:go build -tags netgo -ldflags '-s -w' -o app .GOWDK_ADDR=127.0.0.1:18117 ./appcurl /and/docs/reference/config/successfully returned HTML.git diff --cached --check.