I am developing a forge app version in Confluence. I’m working on a feature that needs to check the latest version of the forge app on the production environment, and the version of the app that the user is currently installing. Is there a way to check that?
There is, as far as I know, no way how doing that from the Forge app itself.
You can have an external service (aka outside Forge) call Forge Graphql API to get the latest version of your app on a given environment and call that service from your Forge app as a remote. But that will make you ineligible to Runs on Atlassian.
An example of Graphql query on GraphQL Gateway :
query getAppEnvironmentsDetailed($appId: ID!, $key: String!) {
app(id: $appId) {
id
environmentByKey(key: $key) {
id
key
type
versions(first: 1) {
nodes {
version
createdAt
updatedAt
__typename
}
__typename
}
}
__typename
}
}
An alternative here may also be considering this within your release strategy.
When releasing a major version, you could first release a final minor version for that major version which notes that there is a newer version available. Following this, you can deploy the major version, which is available for customers to update to.
Minor versions are consistent across installations - all users on a major version will be on the latest minor version. If customers do not update, they’ll be on the version flagged as out of date. Once they update, they’ll be on the version flagged as up to date.