Skip to content

Change: Adds latestDeployment for Environment#4073

Closed
CGoodwin90 wants to merge 1 commit into
mainfrom
latest-deployment-support
Closed

Change: Adds latestDeployment for Environment#4073
CGoodwin90 wants to merge 1 commit into
mainfrom
latest-deployment-support

Conversation

@CGoodwin90

@CGoodwin90 CGoodwin90 commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Adds minimal field resolver latestDeployment to Environment.

Required for uselagoon/lagoon-beta-ui#148

@github-actions

Copy link
Copy Markdown

Overview

Image reference testlagoon/api:main lagoon/api:ci-latest
- digest 97b436889d7c d98d826760b5
- tag main ci-latest
- vulnerabilities critical: 5 high: 66 medium: 34 low: 8 unspecified: 2 critical: 5 high: 66 medium: 34 low: 8 unspecified: 2
- platform linux/amd64 linux/amd64
- size 151 MB 182 MB (+31 MB)
- packages 1579 1579
Base Image node:22-alpine
also known as:
22-alpine3.23
22.22-alpine
22.22-alpine3.23
jod-alpine
jod-alpine3.23
node:22-alpine
also known as:
22-alpine3.23
22.22-alpine
22.22-alpine3.23
jod-alpine
jod-alpine3.23
- vulnerabilities critical: 1 high: 22 medium: 9 low: 4 unspecified: 2 critical: 1 high: 22 medium: 9 low: 4 unspecified: 2

@CGoodwin90 CGoodwin90 marked this pull request as ready for review April 16, 2026 04:28
@rocketeerbkw

Copy link
Copy Markdown
Member

This PR adds a new field that can be used like:

query {
  environmentByName(project: 1, name: "main") {
    latestDeployment {
      name
    }
  }
}

But this is functionally equivalent to the existing query that can be used:

query {
  environmentByName(project: 1, name: "main") {
    deployments(limit: 1) {
      name
    }
  }
}

They both return the same data, and they even both run the same sql query, so I don't see the benefit of extended the API in this way.

If latestDeployment needed to return a different type than Deployment or there was some need for special performance handling, I'd be happy to see that get in.

@CGoodwin90

CGoodwin90 commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

This PR adds a new field that can be used like:

query {
  environmentByName(project: 1, name: "main") {
    latestDeployment {
      name
    }
  }
}

But this is functionally equivalent to the existing query that can be used:

query {
  environmentByName(project: 1, name: "main") {
    deployments(limit: 1) {
      name
    }
  }
}

They both return the same data, and they even both run the same sql query, so I don't see the benefit of extended the API in this way.

If latestDeployment needed to return a different type than Deployment or there was some need for special performance handling, I'd be happy to see that get in.

Perfect! Didn't realize using limit this way returned the latest, closing this off now.

@CGoodwin90 CGoodwin90 closed this Apr 30, 2026
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.

3 participants