Show shop names in dashboard changelogs#738
Conversation
Greptile SummaryThis PR adds shop names to dashboard changelog data and display. The main changes are:
Confidence Score: 4/5The changelog display path is mostly safe, but extension-environment responses can expose the new required shop-name field as an empty string.
api/internal/handler/account.go and historical last-changelog handling. Important Files Changed
Reviews (1): Last reviewed commit: "Show shop names in dashboard changelogs" | Re-trigger Greptile |
| EnvironmentName string `json:"environmentName"` | ||
| EnvironmentOrganizationId string `json:"environmentOrganizationId"` | ||
| EnvironmentOrganizationName string `json:"environmentOrganizationName"` | ||
| EnvironmentShopName string `json:"environmentShopName"` |
There was a problem hiding this comment.
Extension Environments Lose Shop Names
Adding this required response field makes environmentShopName part of every AccountExtensionEnvironment, but existing account-extension mappings that were not updated will serialize the Go zero value. Calls that return subscribed or extension environments can send "environmentShopName":"", so consumers receive an empty required shop name while changelog rows include the real value.
| EnvironmentName string `json:"environmentName"` | ||
| EnvironmentOrganizationId string `json:"environmentOrganizationId"` | ||
| EnvironmentOrganizationName string `json:"environmentOrganizationName"` | ||
| EnvironmentShopName string `json:"environmentShopName"` |
There was a problem hiding this comment.
Stored Changelogs Get Empty Shops
Existing last_changelog JSON stored before this field existed will unmarshal into this new string field as "" and then serialize it as a required value. Environment-detail responses can therefore show an empty shop name for historical lastChangelog data even when the current environment still has a shop name available.
Motivation
Shop · Environmentin the dashboard.Description
environmentShopNameto the OpenAPIAccountChangelogandAccountExtensionEnvironmentschemas and propagate the new field into generated types.GetUserChangelogs,GetUserChangelogsByOrg) toJOIN shopand select the shop name into the changelog rows.EnvironmentShopNamein API responses ininternal/handler/account.goand in environment-detail mapping ininternal/handler/environment_convert.go(using the existingderefhelper for optional shop names).Shop · Environmentwith a fallback to the environment name, and add/adjust unit tests to cover the rendering and API mapping.Testing
npm run tsc) and it succeeded.Dashboard.spec.ts) and they passed.TestGetAccountChangelogs_IncludesShopName, but it could not start the required testcontainers (Redis/Postgres) in this environment so the integration test did not complete.mise run testrun also could not complete for the same reason (testcontainers/rootless Docker provider unavailable).Codex Task