Skip to content

Add experiment usage counts to the Decision Points table#3232

Open
zackcl wants to merge 1 commit into
feature/3226-clickable-decision-point-filterfrom
feature/3230-add-decision-point-used-by-count
Open

Add experiment usage counts to the Decision Points table#3232
zackcl wants to merge 1 commit into
feature/3226-clickable-decision-point-filterfrom
feature/3230-add-decision-point-used-by-count

Conversation

@zackcl

@zackcl zackcl commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

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

  • Add a Used By column to the Decision Points table.
  • Display the number of non-archived experiments using each site-target pair.
  • Include usage counts in experiment detail and update responses.
  • Preserve current counts after decision point and experiment state updates.
  • Add backend and frontend unit coverage for usage counting and display behavior.

@zackcl zackcl requested review from bcb37 and Copilot July 14, 2026 12:59
@zackcl zackcl self-assigned this Jul 14, 2026

Copilot AI left a comment

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.

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.

Comment thread packages/backend/src/api/repositories/DecisionPointRepository.ts

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants