Skip to content

refactor(internal): consolidate FDv2 dependency tracker into internal/toposort - #404

Merged
kinyoklion merged 1 commit into
v7from
rlamb/sdk-2655/toposort-dependency-tracker
Jul 8, 2026
Merged

refactor(internal): consolidate FDv2 dependency tracker into internal/toposort#404
kinyoklion merged 1 commit into
v7from
rlamb/sdk-2655/toposort-dependency-tracker

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Jul 7, 2026

Copy link
Copy Markdown
Member

Moves the FDv2 dependency tracker from internal/datasystem/data_model_dependencies.go into internal/toposort as an exported (internal-only) DependencyTracker, next to the Vertex/Neighbors/GetNeighbors primitives it is built on. The FDv2 store switches to the new location; behavior is unchanged and the existing tests move with it.

The tracker is about to gain a second consumer: the flag-override layer needs the same dependency fan-out to compute which flags are affected when override entries change, and it should not reach into internal/datasystem for it. The near-identical unexported copy in internal/datasource (FDv1) is deliberately left alone; it goes away with FDv1.

No public API or behavior change.

SDK-2655


Note

Low Risk
Pure internal move with exported methods mirroring the old unexported API; FDv1 duplicate remains separate and tests were relocated unchanged.

Overview
Moves the FDv2 dependency tracker out of internal/datasystem into internal/toposort as an exported DependencyTracker (with NewDependencyTracker, UpdateDependenciesFrom, Reset, and AddAffectedItems), colocated with the existing Vertex / Neighbors / GetNeighbors helpers. internal/datasystem/data_model_dependencies.go is deleted; the FDv2 Store now holds *toposort.DependencyTracker and calls the new exported API—flag change fan-out behavior is unchanged.

Existing dependency-tracker tests move to internal/toposort/dependency_tracker_test.go (toposort_test package) with the same scenarios; a small fullDataSetToMap helper is added there for sort tests. The parallel unexported tracker in internal/datasource (FDv1) is intentionally untouched.

Reviewed by Cursor Bugbot for commit 6d6f30a. Bugbot is set up for automated code reviews on this repo. Configure here.

@kinyoklion
kinyoklion merged commit 2dc28a3 into v7 Jul 8, 2026
35 checks passed
@kinyoklion
kinyoklion deleted the rlamb/sdk-2655/toposort-dependency-tracker branch July 8, 2026 19:36
tanderson-ld added a commit that referenced this pull request Aug 18, 2026
Reviewers rejected exposing extended-regime timing knobs on the SDK's
public builders -- those would put a test-harness bypass in the
customer-facing surface. Delete every public addition while preserving
the RETRY-spec behavior.

Removed:
- Builder.Internal() accessors and *Internal types
- DefaultExtendedInitialReconnectDelay, DefaultRetryResetInterval,
  DefaultExtendedInitialPollInterval public constants
- testhelpers/datasourcetest/ package
- Servicedef ExtendedInitialDelayMS / ResetThresholdMS fields
  (matches sdk-test-harness PR #404 refactor)

Kept: full RETRY behavior (401/403/other-4xx no longer terminal;
extended regime engages), all defaults unchanged (5-min
extended-initial, 60s activeSince reset). Contract test capabilities
retry-conformance-fdv1-streaming and retry-conformance-fdv1-polling
remain declared.

Added: defaultExtendedInitialPollDelay fallback in internal/datasource
so removing the public constant doesn't silently drop the 5-min default.
Streaming already had the equivalent fallback pre-refactor.

E2E tests exercising 401 retry now use a test-local ComponentConfigurer
(streaming) or default polling config (polling) instead of the deleted
datasourcetest helpers.

Also tidied polling_strategy_test.go to reference the new fallback
constant instead of scattered 5*time.Minute literals where semantics
matched.

Validated: full RETRY-conformance suite (13 leaf tests, 9 streaming +
4 polling) passed against the sdk-test-harness PR #404 branch with
-enable-long-running-tests at real production 5-minute extended-regime
timing.
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