Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4b93d1e
add apollo open source and rust toolchain channel extensions
esilverm Aug 20, 2025
462b765
add nix maintenance support and comment about how it is in beta
esilverm Aug 20, 2025
966b024
add commas to fix errors from dry-run
esilverm Aug 20, 2025
692e5bf
Merge pull request #273 from apollographql/evan/configure-renovate
esilverm Aug 21, 2025
ad66be2
change wording around mcp auth spec
mabuyo Aug 21, 2025
b437692
fix: generate openAI-compatible json schemas for list types
DaleSeo Aug 20, 2025
f5fa993
Merge pull request #279 from apollographql/mm/fix-auth-wording
mabuyo Aug 22, 2025
04cee88
chore: add changeset
DaleSeo Aug 22, 2025
ee83b8c
test: update test snapshots after OpenAI compatibility fix
DaleSeo Aug 22, 2025
a0efb1e
refactor: use schema_factory consistently
DaleSeo Aug 22, 2025
3f2c5f6
test: add tests for input object lists
DaleSeo Aug 22, 2025
fca294f
test: revert the unrelated changes in custom_scalar_map.rs
DaleSeo Aug 22, 2025
ebc18f1
Merge pull request #272 from apollographql/GT-349
DaleSeo Aug 22, 2025
adc9c70
Gt 367 GitHub workflow to merge main into develop (#282) (#284)
alocay Aug 25, 2025
bad5cf2
release: v0.7.3
DaleSeo Aug 25, 2025
73dc0cd
Merge pull request #285 from apollographql/0.7.3
DaleSeo Aug 26, 2025
3395691
ci: setting git author in sync workflow to github bot (#286)
alocay Aug 26, 2025
d922033
ci: using gh cli for PR creation and adding a fallback in case of mer…
alocay Aug 26, 2025
e2efe34
ci: fix gh pr create command (#292)
alocay Aug 26, 2025
23d392a
ci: fixing bad variable name in comment step (#293)
alocay Aug 26, 2025
86355f6
ci: opening PR from main instead on conflict (#294)
alocay Aug 26, 2025
8a7a924
Merge branch 'develop' into conflict/main-into-develop-pr-
alocay Aug 26, 2025
b58aaca
ci: ignoring conflict and sync branches from changeset verification
alocay Aug 26, 2025
af3ea63
ci: adding ignore check to job level
alocay Aug 26, 2025
9c78e1e
chore: fixing typo
alocay Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [
"github>apollographql/renovate-config-apollo-open-source:default.json5",
"github>Turbo87/renovate-config//rust/updateToolchain",
],
packageRules: [
{
enabled: false,
matchPackageNames: ["*"],
},
],
// Automating Nix upgrades is currently in beta and opt-in only.
// https://docs.renovatebot.com/modules/manager/nix/
nix: {
enabled: true,
},
vulnerabilityAlerts: {
enabled: true,
},
Expand Down
138 changes: 106 additions & 32 deletions .github/workflows/sync-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,69 +48,143 @@ jobs:
HEAD_BRANCH: ${{ (github.event_name == 'workflow_dispatch' && inputs.head_branch) || 'main' }}
BASE_BRANCH: ${{ (github.event_name == 'workflow_dispatch' && inputs.base_branch) || 'develop' }}
SOURCE_PR: ${{ (github.event_name == 'pull_request' && github.event.pull_request.number) || inputs.source_pr_number || '' }}
GH_TOKEN: ${{ secrets.GH_PAT }}

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}

- name: Configure git author
run: |
git config --local user.name "Apollo Bot"
git config --local user.email "[email protected]"

# Generate branch name from PR# when available, otherwise use first 7 commit SHA characters
- name: Compute branch/name metadata
id: meta
run: |
if [ -n "${SOURCE_PR}" ]; then
echo "branch=sync/${HEAD_BRANCH}-into-${BASE_BRANCH}-pr-${SOURCE_PR}" >> $GITHUB_OUTPUT
echo "title=Sync ${HEAD_BRANCH} → ${BASE_BRANCH} (PR #${SOURCE_PR})" >> $GITHUB_OUTPUT
echo "body=Auto-opened to merge \`${HEAD_BRANCH}\` into \`${BASE_BRANCH}\`. Source PR: #${SOURCE_PR}." >> $GITHUB_OUTPUT
else
short_sha=${GITHUB_SHA::7}
echo "branch=sync/${HEAD_BRANCH}-into-${BASE_BRANCH}-${short_sha}" >> $GITHUB_OUTPUT
echo "title=Sync ${HEAD_BRANCH} → ${BASE_BRANCH} (${short_sha})" >> $GITHUB_OUTPUT
echo "body=Auto-opened to merge \`${HEAD_BRANCH}\` into \`${BASE_BRANCH}\` at \`${GITHUB_SHA}\`." >> $GITHUB_OUTPUT
fi
pr=${{ github.event.pull_request.number }}
echo "sync_branch=sync/main-into-develop-pr-${pr}" >> $GITHUB_OUTPUT
echo "title_sync=Sync main → develop (PR #${pr})" >> $GITHUB_OUTPUT
echo "body_sync=Auto-opened after merging \`${{ github.event.pull_request.head.ref }}\` into \`main\`. Source PR: #${pr}." >> $GITHUB_OUTPUT
echo "conflict_branch=conflict/main-into-develop-pr-${pr}" >> $GITHUB_OUTPUT
echo "title_conflict=Sync main → develop (resolve conflicts)" >> $GITHUB_OUTPUT
echo "body_conflict=Opened from a copy of \`main\` so conflicts can be resolved without pushing to a protected branch." >> $GITHUB_OUTPUT

# Short-lived sync branch from develop and merge main into it (do NOT rebase)
# use +e to stop errors from short-circuiting the script
- name: Prepare sync branch
id: prep
run: |
set -e
git fetch origin "${BASE_BRANCH}" "${HEAD_BRANCH}"
git switch -c "${{ steps.meta.outputs.branch }}" "origin/${BASE_BRANCH}"
git switch -c "${{ steps.meta.outputs.sync_branch }}" "origin/${BASE_BRANCH}"
set +e
git merge --no-ff "origin/${HEAD_BRANCH}"
rc=$?
set -e
git add -A || true
git commit -m "WIP: merge ${HEAD_BRANCH} into ${BASE_BRANCH} via ${{ steps.meta.outputs.branch }}" || true
git push origin HEAD

right=$(git rev-list --count --right-only "origin/${BASE_BRANCH}...HEAD")

echo "merge_status=$rc" >> "$GITHUB_OUTPUT"
echo "sync_right=$right" >> "$GITHUB_OUTPUT"
echo "Merge exit=$rc, sync branch ahead-by=$right"

# Open the PR targeting develop
- name: Open PR to develop
id: syncpr
uses: peter-evans/create-pull-request@v6
with:
branch: ${{ steps.meta.outputs.branch }}
base: ${{ env.BASE_BRANCH }}
title: ${{ steps.meta.outputs.title }}
body: |
${{ steps.meta.outputs.body }}
# If no merge conflicts and there are changes, open the PR targeting develop
- name: Open clean PR to develop
id: sync_pr
if: ${{ steps.prep.outputs.merge_status == '0' && steps.prep.outputs.sync_right != '0' }}
run: |
# Avoid duplicate PRs
existing=$(gh pr list --base "${BASE_BRANCH}" --head "${{ steps.meta.outputs.sync_branch }}" --state open --json number --jq '.[0].number' || true)
if [ -n "$existing" ] && [ "$existing" != "null" ]; then
echo "pr_number=$existing" >> "$GITHUB_OUTPUT"
url=$(gh pr view "$existing" --json url --jq .url)
echo "pr_url=$url" >> "$GITHUB_OUTPUT"
exit 0
fi

Merge status: ${{ steps.prep.outputs.merge_status == '0' && 'clean ✅' || 'conflicts ❗' }}
labels: ${{ steps.prep.outputs.merge_status == '0' && 'back-merge,automation' || 'back-merge,automation,conflicts' }}
gh pr create \
--base "${BASE_BRANCH}" \
--head "${{ steps.meta.outputs.sync_branch }}" \
--title "${{ steps.meta.outputs.sync_title }}" \
--body "${{ steps.meta.outputs.sync_body }} (created via gh CLI)" \
--label back-merge \
--label automation

# Emit outputs for later steps
gh pr view --base "${BASE_BRANCH}" --head "${{ steps.meta.outputs.sync_branch }}" \
--json number,url | jq -r '"pr_number=\(.number)\npr_url=\(.url)"' >> "$GITHUB_OUTPUT"

# If the merge hit conflicts, open a DIRECT PR: HEAD_BRANCH -> BASE_BRANCH so conflicts can be resolved prior to merge
- name: Open conflict PR
id: conflict_pr
if: ${{ steps.prep.outputs.merge_status != '0' }}
run: |
set -e
git fetch origin "${HEAD_BRANCH}" "${BASE_BRANCH}"

git switch -c "${{ steps.meta.outputs.conflict_branch }}" "origin/${HEAD_BRANCH}"
git push -u origin HEAD

# Skip if no diff between conflict branch and base (should be unlikely)
right=$(git rev-list --right-only --count "origin/${BASE_BRANCH}...origin/${{ steps.meta.outputs.conflict_branch }}")
if [ "$right" -eq 0 ]; then
echo "No diff between ${HEAD_BRANCH} and ${BASE_BRANCH}; nothing to open."
exit 0
fi

# Reuse existing open PR if present
existing=$(gh pr list --base "${BASE_BRANCH}" --head "${{ steps.meta.outputs.conflict_branch }}" --state open --json number --jq '.[0].number' || true)
if [ -n "$existing" ] && [ "$existing" != "null" ]; then
echo "pr_number=$existing" >> "$GITHUB_OUTPUT"
url=$(gh pr view "$existing" --json url --jq .url)
echo "pr_url=$url" >> "$GITHUB_OUTPUT"
exit 0
fi

gh pr create \
--base "${BASE_BRANCH}" \
--head "${{ steps.meta.outputs.conflict_branch }}" \
--title "${{ steps.meta.outputs.title_conflict }}" \
--body "${{ steps.meta.outputs.body_conflict }}" \
--label back-merge \
--label automation \
--label conflicts

gh pr view --base "${BASE_BRANCH}" --head "${{ steps.meta.outputs.conflict_branch }}" \
--json number,url | jq -r '"pr_number=\(.number)\npr_url=\(.url)"' >> "$GITHUB_OUTPUT"

# Comment back on the ORIGINAL merged PR with a link to the sync PR
- name: Comment on source PR with sync PR link
if: github.event_name == 'pull_request' && steps.syncpr.outputs.pull-request-number != ''
if: ${{ env.SOURCE_PR != '' && (steps.sync_pr.outputs.pr_number != '' || steps.conflict_pr.outputs.pr_number != '') }}
uses: actions/github-script@v7
with:
script: |
const owner = context.repo.owner;
const repo = context.repo.repo;
const issue_number = Number(process.env.SOURCE_PR);
const syncUrl = `${{ toJson(steps.syncpr.outputs['pull-request-url']) }}`.replace(/^"|"$/g, '');
const body = `Opened sync PR **${process.env.HEAD_BRANCH} → ${process.env.BASE_BRANCH}**: ${syncUrl}`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number,
body,
});

const hadConflicts = '${{ steps.prep.outputs.merge_status }}' !== '0';
const syncUrl = '${{ steps.sync_pr.outputs.pr_url || steps.conflict_pr.outputs.pr_url }}';
const head = process.env.HEAD_BRANCH;
const base = process.env.BASE_BRANCH;

const status = hadConflicts ? 'conflicts ❗' : 'clean ✅';
const note = hadConflicts
? 'Opened from a copy of main so conflicts can be resolved safely.'
: 'Opened from a sync branch created off develop.';

const body = [
`Opened sync PR **${head} → ${base}**: ${syncUrl}`,
``,
`Merge status: **${status}**`,
note
].join('\n');

await github.rest.issues.createComment({ owner, repo, issue_number, body });
4 changes: 3 additions & 1 deletion .github/workflows/verify-changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
branches-ignore:
- main
- release/**
- conflict/*
- sync/*
paths-ignore:
- '.github/**'
- '.cargo/**'
Expand All @@ -17,7 +19,7 @@ on:

jobs:
verify-changeset:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changeset') }}
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-changeset') && !startsWith(github.head_ref, 'sync/') && !startsWith(github.head_ref, 'conflict/') }}
name: Verify
runs-on: ubuntu-24.04
permissions:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [0.7.3] - 2025-08-25

## 🐛 Fixes

### fix: generate openAI-compatible json schemas for list types - @DaleSeo PR #272

The MCP server is generating JSON schemas that don't match OpenAI's function calling specification. It puts `oneOf` at the array level instead of using `items` to define the JSON schemas for the GraphQL list types. While some other LLMs are more flexible about this, it technically violates the [JSON Schema specification](https://json-schema.org/understanding-json-schema/reference/array) that OpenAI strictly follows.

This PR updates the list type handling logic to move `oneOf` inside `items` for GraphQL list types.

# [0.7.2] - 2025-08-19

## 🚀 Features
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [

[workspace.package]
authors = ["Apollo <[email protected]>"]
version = "0.7.2"
version = "0.7.3"

[workspace.dependencies]
apollo-compiler = "1.27.0"
Expand Down
4 changes: 2 additions & 2 deletions crates/apollo-mcp-server/src/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ mod test {
"extensions": {
"clientLibrary": {
"name":"mcp",
"version":"0.7.2"
"version":"0.7.3"
}
},
"operationName":"mock_operation"
Expand Down Expand Up @@ -233,7 +233,7 @@ mod test {
},
"clientLibrary": {
"name":"mcp",
"version":"0.7.2"
"version":"0.7.3"
}
},
})
Expand Down
Loading