Hive now tracks when each app deployment was last used, helping you identify stale deployments that are candidates for retirement.
Query Stale Deployments
Use the new activeAppDeployments query to find deployments based on usage:
query FindStaleDeployments($target: TargetReferenceInput!) {
target(reference: $target) {
activeAppDeployments(
filter: {
# Deployments last used more than 30 days ago
lastUsedBefore: "2024-11-01T00:00:00Z"
# OR deployments never used and older than 30 days
neverUsedAndCreatedBefore: "2024-11-01T00:00:00Z"
}
) {
edges {
node {
name
version
createdAt
lastUsed
}
}
}
}
}Filter Options
| Filter | Description |
|---|---|
name | Filter by deployment name (case-insensitive partial match) |
lastUsedBefore | Deployments last used before this timestamp |
neverUsedAndCreatedBefore | Deployments never used and created before this timestamp |
The date filters use OR semantics—deployments matching either condition are returned.
Automated Cleanup
For teams creating many deployments (e.g., one per PR), you can automate cleanup by combining the GraphQL API with the Hive CLI:
# Query stale deployments via GraphQL API, then retire each one:
hive app:retire \
--registry.accessToken "<ACCESS_TOKEN>" \
--target "<ORG>/<PROJECT>/<TARGET>" \
--name "<app-name>" \
--version "<app-version>"Last updated on