Skip to content

Show shop names in dashboard changelogs#738

Open
shyim wants to merge 1 commit into
mainfrom
codex/fix-issue-736-in-shopmon-repository
Open

Show shop names in dashboard changelogs#738
shyim wants to merge 1 commit into
mainfrom
codex/fix-issue-736-in-shopmon-repository

Conversation

@shyim

@shyim shyim commented Jul 13, 2026

Copy link
Copy Markdown
Member

Motivation

  • Make changelog entries unambiguous when environments share names by including the shop name in account changelogs and displaying entries as Shop · Environment in the dashboard.
  • Expose the shop name in the API schema and frontend types so UI and other consumers can rely on a stable field.

Description

  • Add environmentShopName to the OpenAPI AccountChangelog and AccountExtensionEnvironment schemas and propagate the new field into generated types.
  • Update SQL queries (GetUserChangelogs, GetUserChangelogsByOrg) to JOIN shop and select the shop name into the changelog rows.
  • Populate EnvironmentShopName in API responses in internal/handler/account.go and in environment-detail mapping in internal/handler/environment_convert.go (using the existing deref helper for optional shop names).
  • Update the dashboard UI to render changelog titles as Shop · Environment with a fallback to the environment name, and add/adjust unit tests to cover the rendering and API mapping.

Testing

  • Ran frontend type-check (npm run tsc) and it succeeded.
  • Ran the frontend dashboard unit tests (Dashboard.spec.ts) and they passed.
  • Attempted to run the focused API integration test TestGetAccountChangelogs_IncludesShopName, but it could not start the required testcontainers (Redis/Postgres) in this environment so the integration test did not complete.
  • A full mise run test run also could not complete for the same reason (testcontainers/rootless Docker provider unavailable).

Codex Task

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds shop names to dashboard changelog data and display. The main changes are:

  • Adds environmentShopName to OpenAPI, Go, and frontend API types.
  • Joins shop into account changelog queries and maps the shop name into responses.
  • Renders dashboard changelog titles as Shop · Environment with an environment-only fallback.
  • Adds focused backend and frontend test coverage for the new display field.

Confidence Score: 4/5

The changelog display path is mostly safe, but extension-environment responses can expose the new required shop-name field as an empty string.

  • The new changelog SQL path is protected by the existing environment-to-shop relationship.
  • The dashboard rendering handles missing or empty shop names without crashing.
  • Some API response paths and stored JSON values can still return empty shop names for a required field.

api/internal/handler/account.go and historical last-changelog handling.

Important Files Changed

Filename Overview
api/sql/queries/user.sql Adds shop joins to user changelog queries; the join matches the non-null environment-to-shop relationship.
api/internal/handler/account.go Maps shop names for account changelog responses, but related account-extension response paths need consistent population.
api/internal/handler/environment_convert.go Adds shop names to live environment changelog mapping using the existing nullable helper.
api/openapi/spec.yaml Marks shop names as required on changelog and account-extension schemas.
frontend/src/views/Dashboard.vue Displays combined shop and environment names with a safe fallback when the shop name is empty.

Fix All in Claude Code

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"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Fix in Claude Code

EnvironmentName string `json:"environmentName"`
EnvironmentOrganizationId string `json:"environmentOrganizationId"`
EnvironmentOrganizationName string `json:"environmentOrganizationName"`
EnvironmentShopName string `json:"environmentShopName"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Fix in Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant