-
Notifications
You must be signed in to change notification settings - Fork 33
Feat: release id [EXT-6547] #2287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5d89a9d
to
d62e235
Compare
lib/api.ts
Outdated
@@ -64,6 +64,8 @@ function makeSharedAPI( | |||
const { user, parameters, locales, ids, initialContentTypes, hostnames, release } = data | |||
const currentLocation = data.location || locations.LOCATION_ENTRY_FIELD | |||
|
|||
const idsWithRelease = release ? { ...ids, release: release.sys.id } : ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const idsWithRelease = release ? { ...ids, release: release.sys.id } : ids | |
const maybeIdsWithRelease = release ? { ...ids, release: release.sys.id } : ids |
lib/api.ts
Outdated
@@ -89,7 +91,7 @@ function makeSharedAPI( | |||
error: (message: string) => channel.send('notify', { type: 'error', message }), | |||
warning: (message: string) => channel.send('notify', { type: 'warning', message }), | |||
}, | |||
ids, | |||
ids: idsWithRelease, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ids: idsWithRelease, | |
ids: maybeIdsWithRelease, |
lib/cma.ts
Outdated
@@ -13,6 +13,8 @@ export function createCMAClient(ids: IdsAPI, channel: Channel): CMAClient { | |||
environmentId: ids.environmentAlias ?? ids.environment, | |||
spaceId: ids.space, | |||
organizationId: ids.organization, | |||
// TODO: Shipped in the CMA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a public repo, we might want to remove this TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably remove the TODO here.
lib/api.ts
Outdated
@@ -64,6 +64,8 @@ function makeSharedAPI( | |||
const { user, parameters, locales, ids, initialContentTypes, hostnames, release } = data | |||
const currentLocation = data.location || locations.LOCATION_ENTRY_FIELD | |||
|
|||
const effectiveIds = release ? { ...ids, release: release.sys.id } : ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not against this approach per se -- but I wonder why we append the releaseId
here in the SDK instead of doing so upstream ie in the channel sender that provides the data
attribute (where the other ids
are).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed!
406df46
to
6905ba0
Compare
…reateCMAClient to include releaseId in the configuration
…akeSharedAPI function
…eIds and enforcing release property in IdsAPI
6905ba0
to
4b0cdf7
Compare
🎉 This PR is included in version 4.34.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Purpose of PR
This pull request enhances the
ui-extensions-sdk
to support the "Releases v2" project by ensuring apps are aware of the release context they are operating in. This change specifically addresses ticket EXT-6547.We are adding the
releaseId
to thesdk.ids
object when an application is running within a release. This provides developers with a straightforward way to access the current release's ID, enabling them to build release-aware features.A primary use case for this is to allow an app to fetch data or modify its behavior based on the specific release it's interacting with. This is a foundational requirement for many of the planned features in Releases v2.
PR Checklist