diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0b2f7a7c..42fa2707 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,9 +11,12 @@ repos: hooks: - id: trailing-whitespace # Skip generated trees and paths often checked in read-only (0444); mutating hooks must not touch them. - exclude: (cdk/cdk\.out/|node_modules/|^docs/src/content/docs/.*\.md$|(^|/)LICENSE$|(^|/)\.gitattributes$|(^|/)\.npmignore$|(^|/)\.gitignore$|^cli/header\.js$|^docs/astro\.config\.mjs$|^docs/tsconfig\.json$|^docs/src/content\.config\.ts$|\.(snap|lock)$) + # `\.mdx?$` covers the .mdx mirrors too (Quick-start.mdx) — with a bare + # `\.md$` these fixers could reformat a generated file, which the next + # sync-starlight.mjs run then reverts, i.e. permanent CI self-mutation. + exclude: (cdk/cdk\.out/|node_modules/|^docs/src/content/docs/.*\.mdx?$|(^|/)LICENSE$|(^|/)\.gitattributes$|(^|/)\.npmignore$|(^|/)\.gitignore$|^cli/header\.js$|^docs/astro\.config\.mjs$|^docs/tsconfig\.json$|^docs/src/content\.config\.ts$|\.(snap|lock)$) - id: end-of-file-fixer - exclude: (cdk/cdk\.out/|node_modules/|^docs/src/content/docs/.*\.md$|(^|/)LICENSE$|(^|/)\.gitattributes$|(^|/)\.npmignore$|(^|/)\.gitignore$|^cli/header\.js$|^docs/astro\.config\.mjs$|^docs/tsconfig\.json$|^docs/src/content\.config\.ts$) + exclude: (cdk/cdk\.out/|node_modules/|^docs/src/content/docs/.*\.mdx?$|(^|/)LICENSE$|(^|/)\.gitattributes$|(^|/)\.npmignore$|(^|/)\.gitignore$|^cli/header\.js$|^docs/astro\.config\.mjs$|^docs/tsconfig\.json$|^docs/src/content\.config\.ts$) - id: check-merge-conflict - id: check-yaml exclude: ^(cdk/cdk\.out/|cdk\.out/|node_modules/|agent/\.venv/) @@ -59,7 +62,12 @@ repos: entry: bash -lc 'cd "$(git rev-parse --show-toplevel)/docs" && node scripts/sync-starlight.mjs && git add src/content/docs/' language: system pass_filenames: false - files: ^(docs/(design|guides)/.*\.md$|CONTRIBUTING\.md$) + # `.mdx?$`, not `.md$`: QUICK_START.mdx is an .mdx source that + # sync-starlight.mjs mirrors to getting-started/Quick-start.mdx, but the + # `$` after `\.md` meant this hook never selected it — so edits to it + # skipped mirror regeneration locally and could only fail in CI's + # "Files were changed during build" check (PR #780). + files: ^(docs/(design|guides)/.*\.mdx?$|CONTRIBUTING\.md$) stages: [pre-commit] - id: docs-astro-check diff --git a/docs/guides/QUICK_START.mdx b/docs/guides/QUICK_START.mdx index f6abf09d..9eed85b1 100644 --- a/docs/guides/QUICK_START.mdx +++ b/docs/guides/QUICK_START.mdx @@ -19,7 +19,7 @@ Install these before you begin: - **Docker** - for building the agent container image. On an **x86_64** host you also need QEMU/binfmt to build the arm64 (Graviton) image — see the caution in Step 3. - **Node.js** v20 or later (Node 24 is the supported maximum — see CI matrix) - **mise** - task runner ([install guide](https://mise.jdx.dev/getting-started.html)) -- **AWS CDK CLI** - `npm install -g aws-cdk` (after mise is active) +- **AWS CDK CLI** — **no global install needed.** Step 1's `mise run install` provisions the version pinned in `cdk/package.json` into the `cdk/` workspace, and every command in this guide reaches it through `mise //cdk:*` (which runs `npx cdk`). A global `npm install -g aws-cdk` can drift from the pinned version and shadow it on `PATH`. - **GitHub account** — You need a [GitHub profile](https://github.com/join) to fork the sample repository and create a **fine-grained personal access token (PAT)** the agent uses to push branches and open pull requests. A free github.com account is sufficient. :::note[mise provisions Node, Yarn, and the CDK CLI for you] @@ -41,6 +41,8 @@ git clone https://github.com/aws-samples/sample-autonomous-cloud-coding-agents.g cd sample-autonomous-cloud-coding-agents # Trust mise config and install tools +command -v mise >/dev/null || curl https://mise.run | sh +eval "$(mise activate bash)" mise trust mise install diff --git a/docs/src/content/docs/getting-started/Quick-start.mdx b/docs/src/content/docs/getting-started/Quick-start.mdx index bd14eaf4..112a46d6 100644 --- a/docs/src/content/docs/getting-started/Quick-start.mdx +++ b/docs/src/content/docs/getting-started/Quick-start.mdx @@ -19,7 +19,7 @@ Install these before you begin: - **Docker** - for building the agent container image. On an **x86_64** host you also need QEMU/binfmt to build the arm64 (Graviton) image — see the caution in Step 3. - **Node.js** v20 or later (Node 24 is the supported maximum — see CI matrix) - **mise** - task runner ([install guide](https://mise.jdx.dev/getting-started.html)) -- **AWS CDK CLI** - `npm install -g aws-cdk` (after mise is active) +- **AWS CDK CLI** — **no global install needed.** Step 1's `mise run install` provisions the version pinned in `cdk/package.json` into the `cdk/` workspace, and every command in this guide reaches it through `mise //cdk:*` (which runs `npx cdk`). A global `npm install -g aws-cdk` can drift from the pinned version and shadow it on `PATH`. - **GitHub account** — You need a [GitHub profile](https://github.com/join) to fork the sample repository and create a **fine-grained personal access token (PAT)** the agent uses to push branches and open pull requests. A free github.com account is sufficient. :::note[mise provisions Node, Yarn, and the CDK CLI for you] @@ -41,6 +41,8 @@ git clone https://github.com/aws-samples/sample-autonomous-cloud-coding-agents.g cd sample-autonomous-cloud-coding-agents # Trust mise config and install tools +command -v mise >/dev/null || curl https://mise.run | sh +eval "$(mise activate bash)" mise trust mise install