Skip to content

first try at adding a preview build #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sanchezdale
Copy link

@sanchezdale sanchezdale commented Jun 27, 2025

Summary

To support the first deployment experience and provide Apollo users with early access to preview features, we should publish a Docker image that includes the latest Apollo Router preview. In the future, this image could also include a preview version of the MCP server.

The logic added checks if there is a preview version defined, and if so, it builds publishes the image with the tag latest-preview

Looking for feedback or improvements on this!

Copy link
Collaborator

@jonathanrainer jonathanrainer 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 but I think we can do the same thing with less code if we use the metadata-action's tagging facility so have a look at that and let me know :)

Comment on lines +36 to +42
# Check if preview version is defined as workflow input
if [ -n "${{ inputs.preview_router_version }}" ]; then
echo "has_preview=true" >> "$GITHUB_OUTPUT"
echo "preview_version=${{ inputs.preview_router_version }}" >> "$GITHUB_OUTPUT"
else
echo "has_preview=false" >> "$GITHUB_OUTPUT"
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think, if we can use the docker/metadata-action we probably don't need to do this. You can use the tags field there to set all sorts of conditonal behaviour: https://github.com/docker/metadata-action?tab=readme-ov-file#tags-input

Comment on lines +152 to +161
- name: Build and Push Preview Docker Image
if: steps.get-versions.outputs.has_preview == 'true'
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
push: true
platforms: ${{ env.PLATFORMS }}
build-args: |
APOLLO_ROUTER_VERSION=${{ steps.get-versions.outputs.preview_version }}
tags: |
${{ env.NAMESPACED_REGISTRY }}:${{ github.event_name == 'pull_request' && format('PR{0}-router-preview', github.event.number) || 'router-preview' }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the same way here, if we use the metadata action, I think that's the only thing that needs to change, so this should simplify things here

Comment on lines +8 to +10
# Preview router version - set this to build preview images automatically
# once new preview is out, we'll uncomment this.
#ARG APOLLO_ROUTER_PREVIEW_VERSION=2.3.0-preview.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm tempted to ignore this for now, and just focus on getting on-demand builds of router previews. However, I'm writing a doc at the moment about publishing multiple router versions etc, and I'll include a section on preview versions. We can probably rig up renovate so that it will bump this for us, as and when preview versions exist but if we can get the on-demand part working for now that would be a great start.

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