Skip to content

feat(Dependencies): Show dependency changes pending in change requests - #8783

Open
talissoncosta wants to merge 10 commits into
feat/flag-dependencies-cr-interactions-8450from
feat/flag-dependencies-pending-section-8450
Open

talissoncosta wants to merge 10 commits into
feat/flag-dependencies-cr-interactions-8450from
feat/flag-dependencies-pending-section-8450

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Contributes to #8450

The feature's Dependencies tab lists the prerequisite changes waiting in each open change request, linking to it.

  • Open change requests come from list-change-requests?committed=false&feature_id=. Each one loads its dependencies as if live in its own component, as the change request page does, and hides itself when it changes no prerequisite or has since been published or deleted.
  • Each header counts the adds and removes (+1 −2). With more than one change request listed they start collapsed; opening one shows which prerequisites, their Status and Satisfies, and a link to it.
  • Scheduled change requests are left out, as the API refuses to list their dependencies. Only shown to people who can create change requests, which the API requires.
  • If the list or a change request can't load, the section says so rather than claiming nothing is pending.

How did you test this code?

Unit tests for the counts and for reading a 400 or 404 as closed. Locally against main with #8720: the list stays after coming back to the browser tab, and a new change request appears without a reload.

@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Oct 16, 2026 9:41pm UTC
flagsmith-frontend-staging Ready Ready Preview Oct 16, 2026 9:41pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Oct 16, 2026 9:41pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

📝 Walkthrough

The feature-dependencies tab now displays uncommitted change requests when change-request mode and permission are enabled. Each request can show its dependency changes, change counts, loading or error state, and a link to the request. The dependency-change hook now reports closed requests and excludes them from its scoped-query error result.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🔵 Low · up to e1ab7

The new Dependencies view can omit staged changes, though users can still inspect the change request elsewhere. Resolve the API contract or merge with owner awareness.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Oct 15, 2026
@github-actions github-actions Bot added the feature New feature or request label Oct 15, 2026
@talissoncosta talissoncosta changed the title feat(dependencies): show dependency changes pending in change requests feat(Dependencies): Show dependency changes pending in change requests Oct 15, 2026
@talissoncosta
talissoncosta added this pull request to stack #8784 October 15, 2026 13:30
@talissoncosta
talissoncosta force-pushed the feat/flag-dependencies-pending-section-8450 branch from e06a447 to 8f348e4 Compare October 15, 2026 13:31
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Oct 15, 2026
@talissoncosta
talissoncosta force-pushed the feat/flag-dependencies-pending-section-8450 branch from 8f348e4 to d303338 Compare October 15, 2026 13:45
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Oct 15, 2026
@talissoncosta
talissoncosta force-pushed the feat/flag-dependencies-pending-section-8450 branch from d303338 to 3a10762 Compare October 15, 2026 13:53
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Oct 15, 2026
@github-actions github-actions Bot removed the feature New feature or request label Oct 15, 2026
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Oct 15, 2026
@talissoncosta
talissoncosta force-pushed the feat/flag-dependencies-pending-section-8450 branch from 2e5f136 to 35bf125 Compare October 15, 2026 21:51
@github-actions github-actions Bot added feature New feature or request and removed feature New feature or request labels Oct 15, 2026
Comment on lines +213 to +228
providesTags: (res, err, query) => pendingTags(query.featureId),
queryFn: async (query, { dispatch }) => {
const lists = await Promise.all(
query.changeRequestIds.map((changeRequestId) =>
dispatch(
featureDependencyService.endpoints.getFeatureDependencies.initiate(
{
changeRequestId,
environmentId: query.environmentId,
featureId: query.featureId,
},
{ subscribe: false },
),
),
),
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I found a focus/refetch issue here: after returning to the browser tab, the pending dependencies disappear temporarily until reload.

I tested a workaround that replaces these nested imperative queries with fetchWithBQ and preserves the last settled result during refetching. It fixes the visible behaviour, but the custom synchronisation suggests that we are fighting RTK.

There seem to be two cleaner options:

  1. In the backend, expose an endpoint returning all pending dependency changes for a feature.
  2. Render one child component with a subscribed useGetFeatureDependenciesQuery per change request and calculate that CR’s diff there.

Let me know if you prefer option 1 so I provide it ASAP.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks, good catch. Option 1 please: one call for all of a feature's pending dependency changes is the best scenario.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Went with option 2 in 789923e: each change request now loads its dependencies in its own component, with a subscribed query, like the change request page. Coming back to the tab keeps them.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-8783 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-8783 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8783 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith:pr-8783 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8783 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-frontend:pr-8783 Finished ✅ Results ✅

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-16 — run #22561 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  51.8 seconds
commit  e1ab738
info  🔄 Run: #22561 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22561 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  4 passed

Details

stats  4 tests across 3 suites
duration  11.5 seconds
commit  e1ab738
info  🔄 Run: #22561 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #22561 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  33.1 seconds
commit  e1ab738
info  🔄 Run: #22561 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #22561 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  21 passed
skipped  1 skipped

Details

stats  22 tests across 14 suites
duration  1 minute, 10 seconds
commit  e1ab738
info  🔄 Run: #22561 (attempt 1)

Skipped tests

firefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss

✅ private-cloud · depot-ubuntu-latest-16 — run #22558 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  48.3 seconds
commit  a9d1f7b
info  🔄 Run: #22558 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-16 — run #22554 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  56.2 seconds
commit  a9d1f7b
info  🔄 Run: #22554 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22554 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  3 passed

Details

stats  3 tests across 3 suites
duration  46.6 seconds
commit  a9d1f7b
info  🔄 Run: #22554 (attempt 1)

✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22558 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  44.7 seconds
commit  a9d1f7b
info  🔄 Run: #22558 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #22554 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38 seconds
commit  a9d1f7b
info  🔄 Run: #22554 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #22558 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  36.3 seconds
commit  a9d1f7b
info  🔄 Run: #22558 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #22554 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  3.4 seconds
commit  a9d1f7b
info  🔄 Run: #22554 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #22558 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  31.8 seconds
commit  a9d1f7b
info  🔄 Run: #22558 (attempt 1)

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Visual Regression

24 screenshots compared. See report for details.
View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: fc91597d-a279-494b-aa97-2ae88c0ee27a
📥 Commits

Reviewing files that changed from the base of the PR and between 06e1f37 and 31e4772.

📒 Files selected for processing: 10
  • frontend/documentation/components/Chip.stories.tsx
  • frontend/web/components/base/Chip/Chip.scss
  • frontend/web/components/base/Chip/Chip.tsx
  • frontend/web/components/feature-dependencies/useDependencyChanges.ts
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/ChangeRequestLink.tsx
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/FeatureDependenciesTab.tsx
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequest.tsx
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequests.scss
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequests.tsx
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/index.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

talissoncosta and others added 10 commits October 16, 2026 17:09
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Brings back the feature tab's pending section, split out of #8716 while
the API's way to list change requests by feature is discussed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replaces the stub with list-change-requests?feature_id=, which matches
change requests through their change sets. Each one's dependencies are
fetched as if live in one query, and those changing no prerequisite drop
out. Scheduled change requests are left out, as the API refuses them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ist query

Drops the cast on the raw responses, and shares each list's cache with
the change request page.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…sts them

Hidden without the create change request permission, which the API needs,
and one published or deleted since listing drops out instead of failing
the section.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… its own component

The section read them through one query that dispatched the per change
request queries unsubscribed. Both shared a cache tag, so coming back to the
tab refetched them together and the change requests dropped out until a
reload. Each change request now subscribes to its own query, as the change
request page does, and hides itself when it changes no prerequisite.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… look like a link

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s header

Collapsed when there are several, so the list stays short; the count gives
a hint at the size and opening shows which prerequisites. The "Awaiting
approval" chip goes, as approved change requests are listed too and every
one here is pending.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… and drop the unused Chip variant

The chip went with the counts, so its warning variant had no user.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: be69bf92-e329-495a-ba27-35dcf59a5308
📥 Commits

Reviewing files that changed from the base of the PR and between a9d1f7b and e1ab738.

📒 Files selected for processing: 6
  • frontend/common/utils/__tests__/diffDependencies.test.ts
  • frontend/common/utils/diffDependencies.ts
  • frontend/web/components/feature-dependencies/useDependencyChanges.ts
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequest.tsx
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequests.scss
  • frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequests.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment on lines +22 to +29
// One open change request, shown only if it changes this feature's
// prerequisites. Each loads its own, as the change request page does.
const PendingChangeRequest: FC<PendingChangeRequestProps> = ({
changeRequest,
defaultOpen,
environmentId,
featureId,
isEnabled,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

nl -ba frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequest.tsx | sed -n '15,95p'
nl -ba frontend/web/components/feature-dependencies/useDependencyChanges.ts | sed -n '1,65p'
nl -ba frontend/common/utils/diffDependencies.ts | sed -n '1,55p'

Repository: Flagsmith/flagsmith

Length of output: 6570


🏁 Script executed:

nl -ba frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequests.tsx | sed -n '1,220p'
nl -ba frontend/common/services/useFeatureDependency.ts | sed -n '1,90p'
nl -ba api/features/dependencies/views.py | sed -n '80,120p'
nl -ba api/features/dependencies/services.py | sed -n '290,320p'

Repository: Flagsmith/flagsmith

Length of output: 9309


🏁 Script executed:

rg -n -F --glob '*.tsx' -e 'PendingChangeRequests' frontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab

Repository: Flagsmith/flagsmith

Length of output: 1131


Make the dependency API honour change_request.

When this tab renders an open change request with staged dependency changes, the child requests live and change-request-scoped dependencies. The API ignores change_request and returns live dependencies for both requests. The diff is therefore empty, so the pending dependency changes are hidden. Update the dependency API to return dependencies as they would exist in the specified change request.

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-preview — e1ab7382 Deployed Oct 16, 2026 by vercel[bot]
Preview – flagsmith-frontend-staging — e1ab7382 Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants