Commit 1e2fd62
committed
feat(SDK): Surface upcoming scheduled changes in the environment document
Add an opt-in `include_scheduled` query param to the SDK environment-document
endpoint. When set, each feature state additionally carries a
`scheduled_change` field (`live_from`/`enabled`/`feature_state_value`)
describing its next not-yet-live version, if any — sourced from both a future
FeatureState/EnvironmentFeatureVersion already in the DB and a committed but
not-yet-materialised VersionChangeSet diff, with an earliest-wins rule when
both exist.
This lets SDKs running in local-evaluation mode resolve a scheduled change's
maturity from an already-cached document, without waiting for a new poll
after `live_from` passes — and keeps a fleet of instances in sync at the same
moment, since every instance resolves maturity from its own clock rather than
from when it happened to last poll.
Fully backward compatible: the field is omitted entirely when not requested,
so existing SDKs and cached documents are byte-for-byte unchanged.
Test names follow the repo's test_{subject}__{condition}__{expected}
convention with Given/When/Then comments, as flat functions per the
flagsmith-lint-tests pre-commit hook. The SDK API reference page for this
endpoint is regenerated from the updated OpenAPI spec.1 parent a7b0d21 commit 1e2fd62
8 files changed
Lines changed: 1368 additions & 32 deletions
File tree
- api
- environments
- sdk
- tests/unit/util/mappers
- util
- engine_models/features
- mappers
- docs/docs/sdk-api
- sdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
| 537 | + | |
| 538 | + | |
537 | 539 | | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
538 | 561 | | |
539 | 562 | | |
540 | 563 | | |
541 | 564 | | |
542 | 565 | | |
543 | | - | |
544 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
545 | 572 | | |
546 | 573 | | |
547 | 574 | | |
| |||
559 | 586 | | |
560 | 587 | | |
561 | 588 | | |
| 589 | + | |
| 590 | + | |
562 | 591 | | |
563 | | - | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
564 | 599 | | |
565 | | - | |
566 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
567 | 604 | | |
568 | 605 | | |
569 | 606 | | |
| |||
575 | 612 | | |
576 | 613 | | |
577 | 614 | | |
| 615 | + | |
| 616 | + | |
578 | 617 | | |
579 | 618 | | |
580 | 619 | | |
| |||
611 | 650 | | |
612 | 651 | | |
613 | 652 | | |
614 | | - | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
615 | 656 | | |
616 | 657 | | |
617 | 658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
21 | 40 | | |
22 | 41 | | |
23 | 42 | | |
| |||
31 | 50 | | |
32 | 51 | | |
33 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
34 | 69 | | |
35 | 70 | | |
36 | 71 | | |
| |||
42 | 77 | | |
43 | 78 | | |
44 | 79 | | |
| 80 | + | |
45 | 81 | | |
46 | 82 | | |
47 | 83 | | |
| |||
0 commit comments