Add experiment usage counts to the Decision Points table#3232
Open
zackcl wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds “Used By” experiment usage counts to decision points shown on the Experiment Details page, backed by a new repository query that counts distinct non-archived experiments sharing the same decision point.
Changes:
- Frontend: add a Used By column to the Decision Points table with singular/plural formatting.
- Backend: compute and attach per-decision-point usage counts to experiment detail, update, and updateState responses.
- Tests: add unit coverage for both frontend rendering/formatting and backend usage-count attachment/query behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/frontend/projects/upgrade/src/assets/i18n/en.json | Adds i18n strings for “Used By” header and singular/plural count text. |
| packages/frontend/projects/upgrade/src/app/features/dashboard/experiments/pages/experiment-details-page/experiment-details-page-content/experiment-decision-points-section-card/experiment-decision-points-table/experiment-decision-points-table.component.ts | Adds the usedBy column and count formatting helper. |
| packages/frontend/projects/upgrade/src/app/features/dashboard/experiments/pages/experiment-details-page/experiment-details-page-content/experiment-decision-points-section-card/experiment-decision-points-table/experiment-decision-points-table.component.html | Renders the new “Used By” column/cell. |
| packages/frontend/projects/upgrade/src/app/features/dashboard/experiments/pages/experiment-details-page/experiment-details-page-content/experiment-decision-points-section-card/experiment-decision-points-table/experiment-decision-points-table.component.scss | Adjusts column widths and adds styling for the new column. |
| packages/frontend/projects/upgrade/src/app/features/dashboard/experiments/pages/experiment-details-page/experiment-details-page-content/experiment-decision-points-section-card/experiment-decision-points-table/experiment-decision-points-table.component.spec.ts | Adds unit tests for column order and usage-count formatting/rendering. |
| packages/frontend/projects/upgrade/src/app/core/experiments/store/experiments.model.ts | Extends ExperimentDecisionPoint with optional usedByCount. |
| packages/frontend/projects/upgrade/src/app/core/experiments/experiments.data.service.ts | Strips usedByCount from decision points when sending update requests. |
| packages/frontend/projects/upgrade/src/app/core/experiments/experiments.data.service.spec.ts | Tests that usedByCount is removed from update payloads. |
| packages/backend/src/api/repositories/DecisionPointRepository.ts | Adds getUsageCountsForExperiment query to compute usage counts. |
| packages/backend/src/api/services/ExperimentService.ts | Attaches usage counts to single-experiment and update/updateState responses. |
| packages/backend/test/unit/repositories/DecisionPointRepository.test.ts | Adds tests for usage-count query behavior and transaction manager usage. |
| packages/backend/test/unit/services/ExperimentService.test.ts | Adds tests ensuring usage counts are present in update/updateState/getSingleExperiment responses. |
| packages/backend/src/api/controllers/ExperimentController.ts | Documents usedByCount on decision point schema (OpenAPI annotations). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 #3230
Dependency
This PR is based on #3228 and should be reviewed after that PR. Once #3228 is merged, this PR will be retargeted to
dev.Changes
Used Bycolumn to the Decision Points table.