Skip to content

Conversation

@dotansimha
Copy link
Member

@dotansimha dotansimha commented Jan 6, 2026

In this PR, I've made some refactoring to the Pulumi deployment, mostly around ServiceDeployment. With these changes, deployments are now faster, with zero downtime and no strong dependencies that might fail and cause a broken state.

  • Prevent full Deployment replacement when Secret changes (by allowing Pulumi to set the Secret's metadata.name)
  • Fix strong dependency between Deployment and Service (by avoiding using kubernetex's createService function, and use a custom one - we have now only a dependency on ports and not full spec. Also no use of parent field of Pulumi). The relation now is loose and based on the matchLabels only.
  • The change above also fixes a race condition we had while deploying the same commit ID - it was causing the Service to be removed because it was strictly bound to the Deployment. (to confirm)
  • Upgrade Pulumi CLI to latest
  • Upgrade Pulumi K8s adapter to latest
  • Test on dev
  • Test on staging

Closes https://github.com/graphql-hive/deployment/issues/1412

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dotansimha, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on updating the core Pulumi dependencies within the deployment configuration. The primary objective is to bring the @pulumi/kubernetes and @pulumi/pulumi packages to their latest versions, which aims to address potential deployment issues or incorporate the newest features and stability improvements.

Highlights

  • Pulumi Dependency Upgrades: The @pulumi/kubernetes package has been updated from version 4.23.0 to 4.24.1, and the @pulumi/pulumi package has been upgraded from 3.185.0 to 3.214.1.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades Pulumi dependencies. According to the repository's style guide, changes that affect deployment and self-hosted instances require a changeset. As this change modifies deployment tooling, please add a changeset for the hive scope to document this upgrade for users.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/apollo 0.46.0-alpha-20260107091850-1b1fe7943dc29c53983ca218291e4f30fb50bb68 npm ↗︎ unpkg ↗︎
@graphql-hive/cli 0.57.0-alpha-20260107091850-1b1fe7943dc29c53983ca218291e4f30fb50bb68 npm ↗︎ unpkg ↗︎
@graphql-hive/core 0.19.0-alpha-20260107091850-1b1fe7943dc29c53983ca218291e4f30fb50bb68 npm ↗︎ unpkg ↗︎
@graphql-hive/envelop 0.40.1-alpha-20260107091850-1b1fe7943dc29c53983ca218291e4f30fb50bb68 npm ↗︎ unpkg ↗︎
@graphql-hive/yoga 0.46.1-alpha-20260107091850-1b1fe7943dc29c53983ca218291e4f30fb50bb68 npm ↗︎ unpkg ↗︎
hive 8.14.0-alpha-20260107091850-1b1fe7943dc29c53983ca218291e4f30fb50bb68 npm ↗︎ unpkg ↗︎
hive-apollo-router-plugin 2.3.6-alpha-20260107091850-1b1fe7943dc29c53983ca218291e4f30fb50bb68 npm ↗︎ unpkg ↗︎
hive-console-sdk-rs 0.2.3-alpha-20260107091850-1b1fe7943dc29c53983ca218291e4f30fb50bb68 npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📚 Storybook Deployment

The latest changes are available as preview in: https://pr-7460.hive-storybook.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

💻 Website Preview

The latest changes are available as preview in: https://pr-7460.hive-landing-page.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tag: 1b1fe7943dc29c53983ca218291e4f30fb50bb68

@theguild-bot theguild-bot had a problem deploying to development January 6, 2026 10:10 Failure
@theguild-bot theguild-bot had a problem deploying to development January 6, 2026 10:11 Failure
@theguild-bot theguild-bot had a problem deploying to development January 6, 2026 10:21 Failure
@theguild-bot theguild-bot temporarily deployed to development January 6, 2026 10:22 Inactive
@theguild-bot theguild-bot had a problem deploying to development January 6, 2026 10:45 Failure
@theguild-bot theguild-bot temporarily deployed to development January 6, 2026 13:09 Inactive
@theguild-bot theguild-bot had a problem deploying to development January 6, 2026 13:33 Failure
@theguild-bot theguild-bot had a problem deploying to development January 6, 2026 13:54 Failure
@theguild-bot theguild-bot temporarily deployed to development January 6, 2026 14:12 Inactive
ok try this

fix(service): do not use Pulumi `parent` for Service <> Deployment
relation

ok try this
@theguild-bot theguild-bot temporarily deployed to development January 6, 2026 15:02 Inactive
@theguild-bot theguild-bot temporarily deployed to development January 6, 2026 15:09 Inactive
@dotansimha dotansimha requested a review from n1ru4l January 6, 2026 17:32
@theguild-bot theguild-bot temporarily deployed to development January 6, 2026 17:32 Inactive
@dotansimha dotansimha changed the title fix(deployment): try to upgrade pulumi to latest fix(deployment): upgrade pulumi, solve race-condition between Service and Deployment, fix Secrets updating Jan 6, 2026
@dotansimha dotansimha marked this pull request as ready for review January 6, 2026 17:41
}
}

export function createService(name: string, deployment: kx.Deployment) {
Copy link
Member Author

Choose a reason for hiding this comment

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

The main difference from @pulumi/kubernetesx are:

  • we evaluate labels and ports separately (instead of grouping them together and construct the spec field) - this leads to loose dependency and only change the Service if the port or labels has chaneged (instead of any change).
  • No parent set on the Pulumi resource, so no strict coupling between the Service and the Deployment.

) {
this.raw = data;
this.record = new k8s.core.v1.Secret(this.name, {
metadata: {
Copy link
Member Author

Choose a reason for hiding this comment

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

If we don't set explicit name, then Pulumi will use the this.name (pass the the ctor) and will appends some suffix to it. Since Secrets are immutable, when we change the secret, it will re-create a new one with a new suffix, leading to a chain of reaction that causes a RollingUpgrade to the pod.

If we explicitly set the name, then when the secret changes, we get a new one, and the Deployment needs to be re-created (instead of updated to point to the new Secret), and this leads to downtime as the pod is replaced without rolling upgrade.

@theguild-bot theguild-bot had a problem deploying to staging January 7, 2026 09:11 Failure
@n1ru4l n1ru4l merged commit 815f279 into main Jan 7, 2026
26 checks passed
@n1ru4l n1ru4l deleted the upgrade-pulumi branch January 7, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants