-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 :)
# 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 |
There was a problem hiding this comment.
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
- 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' }} |
There was a problem hiding this comment.
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
# 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 |
There was a problem hiding this comment.
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.
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!