forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount_cutover.py
More file actions
51 lines (39 loc) · 1.61 KB
/
Copy pathaccount_cutover.py
File metadata and controls
51 lines (39 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
"""Server-owned defaults for whole-account cohort cutover.
LIFECYCLE: permanent
Minimum supported builds default to zero so accounts remaining ``legacy`` keep
current main behavior. Operators raise these only after the mandatory bridge
release ships. The code-owned empty enrollment set means this foundation never
migrates a user by itself.
"""
from __future__ import annotations
# Empty by design: enrollment is an explicit operator/ceremony action outside
# this foundation PR. ``AccountCutoverCoordinator.begin`` refuses any uid that
# is not a member, so an empty set migrates no user.
ACCOUNT_CUTOVER_COHORT: frozenset[str] = frozenset()
# Per-platform integer build floors. Zero means no force-upgrade for that
# platform until operators configure a bridge-release floor.
MINIMUM_SUPPORTED_BUILDS: dict[str, int] = {
'ios': 0,
'android': 0,
'macos': 0,
'windows': 0,
'linux': 0,
'web': 0,
}
# Product-traffic generations advertised to bridge clients. Legacy accounts
# continue to see generation 0 until cutover begins.
DEFAULT_UI_GENERATION = 0
DEFAULT_API_GENERATION = 0
# Schema for the persisted account cutover control document.
ACCOUNT_CUTOVER_SCHEMA_VERSION = 1
def is_account_cutover_cohort_member(uid: object) -> bool:
"""Return whether ``uid`` is explicitly enrolled for whole-account cutover."""
return bool(uid) and isinstance(uid, str) and uid in ACCOUNT_CUTOVER_COHORT
__all__ = [
'ACCOUNT_CUTOVER_COHORT',
'ACCOUNT_CUTOVER_SCHEMA_VERSION',
'DEFAULT_API_GENERATION',
'DEFAULT_UI_GENERATION',
'MINIMUM_SUPPORTED_BUILDS',
'is_account_cutover_cohort_member',
]