Skip to content

co-pilot instructions and example fixes from PR review#66

Closed
godronus wants to merge 1 commit into
mainfrom
fix/cdn-app-generation
Closed

co-pilot instructions and example fixes from PR review#66
godronus wants to merge 1 commit into
mainfrom
fix/cdn-app-generation

Conversation

@godronus
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 20, 2026 10:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.md and a PR workflow to run a sync checker.
  • Extend check-copilot-sync.sh with an advisory check for untracked examples/ 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.

Comment on lines +101 to +115
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)
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@godronus godronus closed this Apr 20, 2026
@godronus godronus deleted the fix/cdn-app-generation branch April 20, 2026 11:30
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.

2 participants