Repository navigation
feat(Dependencies): Show dependency changes pending in change requests - #8783
talissoncosta wants to merge 10 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 Walkthrough
Merge Risk: 🔵 Low · up to
|
e06a447 to
8f348e4
Compare
8f348e4 to
d303338
Compare
d303338 to
3a10762
Compare
2e5f136 to
35bf125
Compare
| 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 }, | ||
| ), | ||
| ), | ||
| ), | ||
| ) |
There was a problem hiding this comment.
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:
- In the backend, expose an endpoint returning all pending dependency changes for a feature.
- Render one child component with a subscribed
useGetFeatureDependenciesQueryper change request and calculate that CR’s diff there.
Let me know if you prefer option 1 so I provide it ASAP.
There was a problem hiding this comment.
Thanks, good catch. Option 1 please: one call for all of a feature's pending dependency changes is the best scenario.
There was a problem hiding this comment.
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.
Docker builds report
|
✅ private-cloud · depot-ubuntu-latest-16 — run #22561 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
🗂️ Previous results✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22561 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #22561 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #22561 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Skipped testsfirefox › 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)Details
✅ private-cloud · depot-ubuntu-latest-16 — run #22554 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22554 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #22558 (attempt 1)Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #22554 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-arm-16 — run #22558 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
✅ oss · depot-ubuntu-latest-16 — run #22554 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
✅ oss · depot-ubuntu-latest-16 — run #22558 (attempt 1)Playwright Test Results (oss - depot-ubuntu-latest-16)Details
|
Visual Regression24 screenshots compared. See report for details. |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
fc91597d-a279-494b-aa97-2ae88c0ee27a
📒 Files selected for processing: 10
frontend/documentation/components/Chip.stories.tsxfrontend/web/components/base/Chip/Chip.scssfrontend/web/components/base/Chip/Chip.tsxfrontend/web/components/feature-dependencies/useDependencyChanges.tsfrontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/ChangeRequestLink.tsxfrontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/FeatureDependenciesTab.tsxfrontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequest.tsxfrontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequests.scssfrontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequests.tsxfrontend/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.
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>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: ASSERTIVE
- Plan: Advanced
- Run ID:
be69bf92-e329-495a-ba27-35dcf59a5308
📒 Files selected for processing: 6
frontend/common/utils/__tests__/diffDependencies.test.tsfrontend/common/utils/diffDependencies.tsfrontend/web/components/feature-dependencies/useDependencyChanges.tsfrontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequest.tsxfrontend/web/components/modals/create-feature/tabs/FeatureDependenciesTab/PendingChangeRequests/PendingChangeRequests.scssfrontend/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.
| // 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, |
There was a problem hiding this comment.
🎯 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/FeatureDependenciesTabRepository: 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.
docs/if required so people know about the feature.Changes
Contributes to #8450
The feature's Dependencies tab lists the prerequisite changes waiting in each open change request, linking to it.
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.+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.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.