Skip to content

Conversation

@alocay
Copy link
Contributor

@alocay alocay commented Sep 3, 2025

Finalizing the prep release workflow. Adding the following steps:

  1. Updating changelog via cargo xtask
  2. Extracting the changelog portion for the new version (using python)
  3. Pushing changes to branch
  4. Opening a draft PR with these changes and the extracted changelog section as the description

@alocay alocay requested a review from a team as a code owner September 3, 2025 14:42
@apollo-librarian
Copy link

apollo-librarian bot commented Sep 3, 2025

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

3 new, 4 changed, 9 removed
+ (developer-tools)/apollo-mcp-server/(latest)/guides/auth.mdx
+ (developer-tools)/apollo-mcp-server/(latest)/guides/index.mdx
+ (developer-tools)/apollo-mcp-server/(latest)/command-reference.mdx
* (developer-tools)/apollo-mcp-server/(latest)/best-practices.mdx
* (developer-tools)/apollo-mcp-server/(latest)/index.mdx
* (developer-tools)/apollo-mcp-server/(latest)/quickstart.mdx
* (developer-tools)/apollo-mcp-server/(latest)/_sidebar.yaml
- (developer-tools)/apollo-mcp-server/(latest)/auth.mdx
- (developer-tools)/apollo-mcp-server/(latest)/config-file.mdx
- (developer-tools)/apollo-mcp-server/(latest)/custom-scalars.mdx
- (developer-tools)/apollo-mcp-server/(latest)/debugging.mdx
- (developer-tools)/apollo-mcp-server/(latest)/define-tools.mdx
- (developer-tools)/apollo-mcp-server/(latest)/deploy.mdx
- (developer-tools)/apollo-mcp-server/(latest)/health-checks.mdx
- (developer-tools)/apollo-mcp-server/(latest)/run.mdx
- (developer-tools)/apollo-mcp-server/(latest)/guides/auth-auth0.mdx

Build ID: 51cb02a820d24e69ed1ec6e4
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/51cb02a820d24e69ed1ec6e4

Copy link
Contributor

@nicholascioli nicholascioli left a comment

Choose a reason for hiding this comment

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

Looks good to me! I left a few nit comments, but feel free to ignore them

Comment on lines +8 to +16
paths-ignore:
- '.github/**'
- '.cargo/**'
- '.direnv/**'
- '.vscode/**'
- 'docs/**'
- 'Cargo.*'
- 'crates/**/Cargo.*'
- '*.md'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Do we want this to just be paths instead set to rust source files?

Comment on lines +183 to +216
python3 - <<'PY' > CHANGELOG_SECTION.md
try:
import os, re, sys, pathlib
new = os.environ["NEW"]
old = os.environ["OLD"]
p = pathlib.Path("CHANGELOG.md")
if not p.exists():
raise FileNotFoundError("CHANGELOG.md not found at repo root")
text = p.read_text(encoding="utf-8")

# Find header for the new version
start = re.search(rf'(?m)^# \[{re.escape(new)}\]', text)
if not start:
print(f"::error::Could not find changelog entry for {new}", file=sys.stderr)
sys.exit(1)

# Prefer the *specific* previous version header if present; otherwise, next '# ['; else, EOF
segment = text[start.start():]
end_old = re.search(rf'(?m)^# \[{re.escape(old)}\]', segment)
if end_old:
segment = segment[:end_old.start()]
else:
nxt = re.search(r'(?m)^# \[', segment[len('# [' + new + ']'):])
if nxt:
# adjust to absolute end
segment = segment[: (len('# [' + new + ']') + nxt.start())]

segment = segment.rstrip() + "\n"
print(segment)
except Exception:
import traceback
traceback.print_exc()
sys.exit(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: We might want this to just be a file that it includes and runs vs writing inline. Your choice

Comment on lines +240 to +256
# Try to create; if it already exists, update it
if ! gh pr create \
--base main \
--head "$HEAD" \
--title "$TITLE" \
--draft \
--body-file CHANGELOG_SECTION.md \
--label release
then
num=$(gh pr list --head "$HEAD" --base main --state open --json number -q '.[0].number' || true)
if [[ -n "$num" ]]; then
gh pr edit "$num" --title "$TITLE" --body-file CHANGELOG_SECTION.md --add-label release
else
echo "::error::Failed to create or find PR from $HEAD to main"
exit 1
fi
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: This works for now, but it might be more stable as a cargo xtask in the future since bash can be very finicky.

@nicholascioli nicholascioli merged commit eedc53e into develop Sep 3, 2025
7 checks passed
@nicholascioli nicholascioli deleted the gt-337-github-workflow-release-finalize branch September 3, 2025 20:11
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.

3 participants