Skip to content

docs: migrate routing recipes to service model#12

Merged
guoqqqi merged 3 commits intomasterfrom
codex/recipe-service-model-routing
Apr 29, 2026
Merged

docs: migrate routing recipes to service model#12
guoqqqi merged 3 commits intomasterfrom
codex/recipe-service-model-routing

Conversation

@guoqqqi
Copy link
Copy Markdown
Contributor

@guoqqqi guoqqqi commented Apr 28, 2026

Summary

  • Migrate GraphQL proxy and multi-tenant recipes to service-backed route examples.
  • Replace inline upstream route examples with service creation plus route paths / service_id bindings.
  • Update GraphQL guidance to use raw route payloads for vars and avoid implying config sync preserves unsupported route fields.
  • Update multi-tenant guidance to use separate consumer and credential creation.

Validation

  • make validate-skills
  • make test-skills
  • git diff --check

Copilot AI review requested due to automatic review settings April 28, 2026 17:12
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Warning

Rate limit exceeded

@guoqqqi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 52 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d5e0080e-ac21-451a-a844-41a976065716

📥 Commits

Reviewing files that changed from the base of the PR and between 024dacd and ccf331b.

📒 Files selected for processing (2)
  • skills/a7-recipe-graphql-proxy/SKILL.md
  • skills/a7-recipe-multi-tenant/SKILL.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/recipe-service-model-routing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 53 minutes and 52 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

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

Migrates the GraphQL proxy and multi-tenant recipe skills to the service-backed route model (create services with upstreams, then bind routes via paths/service_id), and updates guidance around using raw route payloads for fields not supported by a7 config sync (e.g., vars).

Changes:

  • Update both recipes to create services first and bind routes using paths + service_id (instead of inline route upstreams).
  • Adjust GraphQL guidance to rely on raw route payloads for vars and avoid implying unsupported fields are preserved by declarative sync.
  • Update multi-tenant guidance to create consumers and credentials separately (a7 credential create) rather than embedding key-auth material in consumer objects.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
skills/a7-recipe-multi-tenant/SKILL.md Migrates tenant routing examples to service-backed routes and separates consumer vs credential creation.
skills/a7-recipe-graphql-proxy/SKILL.md Migrates GraphQL routing examples to service-backed routes and clarifies raw payload usage for vars/operation matching.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 13 to +17
a7_commands:
- a7 consumer create
- a7 gateway-group create
- a7 consumer-group create
- a7 consumer create
- a7 credential create
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

The recipe body references additional a7 commands (e.g., a7 global-rule create, a7 consumer-group list, a7 consumer list, a7 service get) that aren’t represented in metadata.a7_commands, while some listed commands (like a7 config dump) aren’t used below. Please align a7_commands with what this skill actually covers so the metadata stays accurate for filtering/testing.

Copilot uses AI. Check for mistakes.
### 1. Create Consumer Groups (scoped to a Gateway Group)
Create consumer groups in the shared gateway group:

```bash
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

This section uses -g platform for consumer groups/consumers/routes, but earlier the recipe only shows creating premium-tier and standard-tier gateway groups. A reader starting from scratch won’t have a platform gateway group and these commands will fail/confuse. Consider creating platform explicitly here, or consistently using one of the gateway groups created above throughout the remaining examples.

Suggested change
```bash
```bash
a7 gateway-group create platform --desc "Shared platform gateway group for tenant consumers and routes"

Copilot uses AI. Check for mistakes.
Comment on lines 13 to 17
a7_commands:
- a7 service create
- a7 service get
- a7 route create
- a7 route update
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

a7 config sync is still used later in this recipe (Declarative Management Notes), but it’s no longer included in metadata.a7_commands. Please add it back (and keep this list aligned with commands the skill covers) so the skill metadata stays accurate for filtering/testing.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 29, 2026 14:00
Copy link
Copy Markdown

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 56 to +58
a7 gateway-group create premium-tier --desc "High-performance tier for paid customers"

# Create a Standard Gateway Group
a7 gateway-group create standard-tier --desc "Standard tier for free/trial users"
a7 gateway-group create standard-tier --desc "Standard tier for free and trial users"
a7 gateway-group create platform --desc "Shared platform gateway group for tenant consumers and routes"
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

a7 gateway-group create does not take a positional name argument and does not have a --desc flag. In the CLI, the name must be provided via --name and the description via --description (or provide a full payload via -f). As written, these commands will fail if a reader follows the recipe.

Copilot uses AI. Check for mistakes.
Comment on lines 117 to 121
a7 route update gql-mutations -g prod-group -f - <<'EOF'
{
"service_id": "gql-write-service",
"plugins": {
"key-auth": {},
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

a7 route update -f performs a full PUT replacement of the route. This update payload only includes service_id and plugins, so it will drop required matcher fields like paths and the vars condition (and may fail validation or change routing semantics). Update examples should include the full existing route definition (at least name, paths, and vars) along with the modified plugins/service binding.

Copilot uses AI. Check for mistakes.

```bash
a7 route update gql-mutations -g prod-group -f - <<'EOF'
{
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

Same issue as above: this a7 route update -f example will fully replace the gql-mutations route but the payload omits required routing fields (paths and the vars matcher for mutations). Include the full route definition (including name, paths, and vars) together with the updated consumer-restriction plugin to avoid clobbering the route.

Suggested change
{
{
"id": "gql-mutations",
"name": "gql-mutations",
"paths": ["/graphql"],
"vars": [
["graphql_operation", "==", "mutation"]
],

Copilot uses AI. Check for mistakes.
@guoqqqi guoqqqi merged commit 9a636fd into master Apr 29, 2026
9 checks passed
@guoqqqi guoqqqi deleted the codex/recipe-service-model-routing branch April 29, 2026 16:36
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