forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesktop_flow_contract.py
More file actions
55 lines (45 loc) · 2.45 KB
/
Copy pathdesktop_flow_contract.py
File metadata and controls
55 lines (45 loc) · 2.45 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
52
53
54
55
"""Shared ownership for the files consumed by desktop E2E flow validation."""
from __future__ import annotations
from pathlib import Path
_DESKTOP_MACOS_DIR = Path(__file__).resolve().parent.parent
_SOURCES_DIR = _DESKTOP_MACOS_DIR / "Desktop" / "Sources"
def _bridge_action_sources() -> tuple[str, ...]:
"""Every `DesktopAutomationBridge*.swift`, found rather than listed.
Naming the base file alone is what let this list go stale: bridge actions moved into
`DesktopAutomationBridge+Notifications.swift`, nobody added it here, and the lint then
reported the flows that used them as referencing unknown actions — failing the push gate
on every branch while the actions themselves were registered correctly all along.
Discovery is scoped to this one filename prefix on purpose. The registration pattern the
lint matches (`name: "…"`) is common enough to appear in `APIClient`, `AuthService` and
`ChatBubble`, so scanning the whole tree would feed the lint action names that are not
actions. The prefix belongs to the bridge and nothing else.
"""
return tuple(
sorted(
path.relative_to(_DESKTOP_MACOS_DIR).as_posix()
for path in _SOURCES_DIR.glob("DesktopAutomationBridge*.swift")
)
)
# Paths are relative to desktop/macos. Keep the flow lint reader and CI impact
# resolver on this single list so an added bridge action cannot skip its flow
# validation route.
ACTION_SOURCE_RELATIVE_PATHS = _bridge_action_sources() + (
"Desktop/Sources/FloatingControlBar/RealtimeHubController.swift",
"Desktop/Sources/Rewind/Core/RewindArtifactGauntlet.swift",
"Desktop/Sources/DesktopAutomationOpenOmiShortcutQA.swift",
"Desktop/Sources/ProactiveAssistants/ContextBucketDirectorProbeRegistration.swift",
"Desktop/Sources/Automation/DesktopAutomationHomeStageActions.swift",
"Desktop/Sources/Automation/DesktopAutomationActivationActions.swift",
"Desktop/Sources/Automation/DesktopAutomationAskOmiActions.swift",
"Desktop/Sources/Automation/DesktopAutomationPTTRecoveryActions.swift",
"Desktop/Sources/MainWindow/Pages/TasksPage.swift",
"Desktop/Sources/MainWindow/Pages/MemoriesPage.swift",
)
FLOW_LINT_INPUTS = frozenset(
{
"desktop/macos/scripts/desktop-core-harness.sh",
"desktop/macos/scripts/desktop-flow-lint.py",
"desktop/macos/scripts/desktop_flow_contract.py",
*(f"desktop/macos/{path}" for path in ACTION_SOURCE_RELATIVE_PATHS),
}
)