co-pilot instructions and example fixes from PR review#66
Conversation
There was a problem hiding this comment.
Pull request overview
Adds repository-level Copilot PR review instructions and introduces automation to keep Copilot instructions/manifest/examples in sync, plus a few example fixes and doc clarifications.
Changes:
- Add
.github/copilot-instructions.mdand a PR workflow to run a sync checker. - Extend
check-copilot-sync.shwith an advisory check for untrackedexamples/projects. - Fix response body replacement sizing in CDN examples and clarify CORS example configuration docs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| fastedge-plugin-source/check-copilot-sync.sh | Improves sync validation and adds an advisory examples/ coverage check. |
| .github/workflows/copilot-sync.yml | New PR workflow to run the sync script when relevant files change. |
| .github/copilot-instructions.md | New Copilot PR review guidance + mapping table for docs regeneration expectations. |
| examples/cdn/md2html/src/lib.rs | Adjusts body replacement call to use the original body size. |
| examples/cdn/custom_error_pages/src/lib.rs | Same body replacement sizing fix; also uses the body_size parameter. |
| examples/cdn/cors/src/lib.rs | Clarifies configuration behavior when ALLOWED_ORIGINS is unset/empty. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [ -d "examples" ] && [ -f "$MANIFEST" ]; then | ||
| # Get all examples/ file paths from the manifest | ||
| manifest_examples=$(jq -r '.sources[].files[]' "$MANIFEST" | grep '^examples/' | sort -u) | ||
|
|
||
| # Find example project directories (contain package.json, Cargo.toml, or asconfig.json) | ||
| # Handles flat (examples/<name>/) and nested (examples/cdn/<name>/) structures | ||
| untracked=() | ||
| while IFS= read -r marker_file; do | ||
| [ -z "$marker_file" ] && continue | ||
| project_dir=$(dirname "$marker_file") | ||
| # Check if any manifest file starts with this project directory | ||
| if [ -z "$manifest_examples" ] || ! printf '%s\n' "$manifest_examples" | grep -q "^${project_dir}/"; then | ||
| untracked+=("$project_dir") | ||
| fi | ||
| done < <(find examples/ -maxdepth 4 \( -name "package.json" -o -name "Cargo.toml" -o -name "asconfig.json" \) -not -path "*/node_modules/*" 2>/dev/null | sort) |
There was a problem hiding this comment.
In Check 3, manifest_examples=$(... | grep '^examples/' | sort -u) can cause the whole script to exit under set -euo pipefail when the manifest currently contains zero examples/ entries (grep exits 1). That would turn this intended advisory check into a hard failure. Consider filtering with jq (e.g., select(startswith("examples/"))) or otherwise neutralizing the non-match case (e.g., || true) so an empty examples list results in warnings rather than an early exit.
No description provided.