feat(context): enrich context getter to provide project details - #2033
Open
gandie wants to merge 8 commits into
Open
feat(context): enrich context getter to provide project details#2033gandie wants to merge 8 commits into
gandie wants to merge 8 commits into
Conversation
martin-helmich
requested changes
Jul 24, 2026
martin-helmich
requested changes
Aug 11, 2026
| ); | ||
| }; | ||
|
|
||
| const ProjectOverviewSection: FC<{ overview: ProjectOverview }> = ({ |
Member
There was a problem hiding this comment.
This component is very long. Consider splitting it into separate subcomponents.
Comment on lines
+123
to
+177
| const projectResponse = await apiClient.project.getProject({ | ||
| projectId, | ||
| }); | ||
| assertStatus(projectResponse, 200); | ||
|
|
||
| const appInstallationsResponse = await apiClient.app.listAppinstallations({ | ||
| projectId, | ||
| }); | ||
| assertStatus(appInstallationsResponse, 200); | ||
|
|
||
| const appInstallations = appInstallationsResponse.data; | ||
| const uniqueAppIds = Array.from( | ||
| new Set(appInstallations.map((installation) => installation.appId)), | ||
| ); | ||
|
|
||
| const appNames = new Map<string, string>(); | ||
| await Promise.all( | ||
| uniqueAppIds.map(async (appId) => { | ||
| try { | ||
| const app = await getAppFromUuid(apiClient, appId); | ||
| appNames.set(appId, app.name); | ||
| } catch { | ||
| appNames.set(appId, appId); | ||
| } | ||
| }), | ||
| ); | ||
|
|
||
| const databaseById = new Map< | ||
| string, | ||
| { name: string; kind: "mysql" | "redis" } | ||
| >(); | ||
|
|
||
| try { | ||
| const mysqlResponse = await apiClient.database.listMysqlDatabases({ | ||
| projectId, | ||
| }); | ||
| assertStatus(mysqlResponse, 200); | ||
| for (const db of mysqlResponse.data) { | ||
| databaseById.set(db.id, { name: db.name, kind: "mysql" }); | ||
| } | ||
| } catch { | ||
| // best effort | ||
| } | ||
|
|
||
| try { | ||
| const redisResponse = await apiClient.database.listRedisDatabases({ | ||
| projectId, | ||
| }); | ||
| assertStatus(redisResponse, 200); | ||
| for (const db of redisResponse.data) { | ||
| databaseById.set(db.id, { name: db.name, kind: "redis" }); | ||
| } | ||
| } catch { | ||
| // best effort | ||
| } |
Member
There was a problem hiding this comment.
This function contains many chained await calls, some of which might be run concurrently using Promise.all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #929