Skip to content

feat(api): retrieve app deployments based on last used data#7377

Merged
adambenhassen merged 12 commits into
mainfrom
adam/console-1504
Jan 15, 2026
Merged

feat(api): retrieve app deployments based on last used data#7377
adambenhassen merged 12 commits into
mainfrom
adam/console-1504

Conversation

@adambenhassen

Copy link
Copy Markdown
Contributor

Description

Adds activeAppDeployments GraphQL query to find app deployments based on usage criteria, enabling teams to identify and clean up stale deployments

Filter options:

  • lastUsedBefore - find deployments used but not recently
  • neverUsedAndCreatedBefore - find old unused deployments
  • name - filter by app name (partial match)

Closes CONSOLE-1504

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @adambenhassen, 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 introduces a significant enhancement to the API by providing a new GraphQL query, activeAppDeployments, designed to help teams efficiently identify and manage stale application deployments. This feature allows users to filter deployments based on their last usage date or creation date if they've never been used, facilitating cleanup and resource optimization. The addition of a createdAt field to the AppDeployment type further enriches the data available for these operations, ensuring better visibility into deployment lifecycle.

Highlights

  • New GraphQL Query: Introduced activeAppDeployments GraphQL query to retrieve app deployments based on usage and creation criteria.
  • Filter Options: Added filter options including lastUsedBefore (for recently unused deployments), neverUsedAndCreatedBefore (for old, never-used deployments), and name (for partial name matching). Date filters use OR logic, while the name filter uses AND logic.
  • AppDeployment Type Enhancement: The AppDeployment GraphQL type now includes a createdAt field to track the deployment's creation timestamp.
  • Comprehensive Testing: Extensive integration tests have been added to validate the functionality of the new activeAppDeployments query, covering various filter combinations and pagination.
  • Documentation Update: New documentation has been added to guide users on 'Finding Stale App Deployments', including usage tracking, GraphQL API querying examples, and automated cleanup workflows.
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.

@github-actions

github-actions Bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

🚀 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/cli 0.57.2-alpha-20260115133028-efbc8592ef16657cc3bbbdd30357cbe8f4448f39 npm ↗︎ unpkg ↗︎
hive 9.0.0-alpha-20260115133028-efbc8592ef16657cc3bbbdd30357cbe8f4448f39 npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

📚 Storybook Deployment

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

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

Copy link
Copy Markdown
Contributor

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 introduces a new activeAppDeployments GraphQL query to find stale deployments, which is a valuable addition for maintenance and cleanup. The implementation is accompanied by thorough integration tests and clear documentation. My main feedback is a performance concern regarding how deployments are fetched and filtered, which could be problematic for targets with a large number of deployments. I've also noted an opportunity to reduce code duplication in the new tests.

Comment thread integration-tests/tests/api/app-deployments.spec.ts
@github-actions

github-actions Bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

💻 Website Preview

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

@github-actions

github-actions Bot commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

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

Targets: build

Platforms: linux/amd64

Image Tag: efbc8592ef16657cc3bbbdd30357cbe8f4448f39

@adambenhassen adambenhassen marked this pull request as draft December 5, 2025 10:47
@adambenhassen adambenhassen changed the title feat(api): retrieve app deployments based on last used data WIP feat(api): retrieve app deployments based on last used data Dec 5, 2025
@adambenhassen adambenhassen marked this pull request as ready for review December 5, 2025 11:35
@adambenhassen adambenhassen changed the title WIP feat(api): retrieve app deployments based on last used data feat(api): retrieve app deployments based on last used data Dec 5, 2025

@jdolle jdolle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great job adding descriptions, comments, and docs. These are all very helpful. I'm excited for App Deployments to get more flushed out

@adambenhassen adambenhassen requested a review from n1ru4l December 8, 2025 11:26
Comment thread packages/web/docs/src/content/schema-registry/app-deployments.mdx
Comment thread packages/services/api/src/modules/app-deployments/module.graphql.ts Outdated

@n1ru4l n1ru4l left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There is one naming issue for the public GraphQL API: https://github.com/graphql-hive/console/pull/7377/changes#r2689652280

I recommend to either

  • adjusting the schema to only expose types that follow our naming conventions
  • remove the field from the public API for now

Comment on lines 29 to 33
enum AppDeploymentStatus {
pending
active
retired
pending @tag(name: "public")
active @tag(name: "public")
retired @tag(name: "public")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this enum type is added to the public API, we need to make sure they follow the naming conventions we decided for the public API, which is also a bit complicated since it is used within the app:create command.

https://www.notion.so/theguildoss/Hive-Console-GraphQL-API-Design-Patterns-18ab6b71848a80678939c669699fe8e6?source=copy_link#18ab6b71848a80d5a1b1d16abd881d32

We could also omit the field for now since it is not required as an input type for the functionality introduced in this PR.

Your choice!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Went with omitting the field for now 👍

@adambenhassen adambenhassen merged commit 8549f22 into main Jan 15, 2026
50 of 51 checks passed
@adambenhassen adambenhassen deleted the adam/console-1504 branch January 15, 2026 14:11
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