Add Epiphany watcher invalidation inputs
This commit is contained in:
parent
81ae5aeaac
commit
52732cb2dc
45 changed files with 2613 additions and 50 deletions
|
|
@ -1886,6 +1886,17 @@ mod tests {
|
|||
note: "Graph freshness is stale; frontier has 1 dirty path(s), 1 open question id(s), and 0 open gap id(s)."
|
||||
.to_string(),
|
||||
},
|
||||
watcher: v2::ThreadEpiphanyInvalidationInput {
|
||||
status: v2::ThreadEpiphanyInvalidationStatus::Changed,
|
||||
watched_root: Some(PathBuf::from("/repo")),
|
||||
observed_at_unix_seconds: Some(1_744_500_123),
|
||||
changed_path_count: 1,
|
||||
changed_paths: vec![PathBuf::from("src/router.rs")],
|
||||
graph_node_ids: vec!["router-flow".to_string()],
|
||||
active_frontier_node_ids: vec!["router-flow".to_string()],
|
||||
note: "Watcher observed 1 recent changed path(s) touching 1 mapped graph node(s), including 1 active frontier node(s)."
|
||||
.to_string(),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -1917,6 +1928,16 @@ mod tests {
|
|||
"openQuestionCount": 1,
|
||||
"openGapCount": 0,
|
||||
"note": "Graph freshness is stale; frontier has 1 dirty path(s), 1 open question id(s), and 0 open gap id(s)."
|
||||
},
|
||||
"watcher": {
|
||||
"status": "changed",
|
||||
"watchedRoot": "/repo",
|
||||
"observedAtUnixSeconds": 1744500123,
|
||||
"changedPathCount": 1,
|
||||
"changedPaths": ["src/router.rs"],
|
||||
"graphNodeIds": ["router-flow"],
|
||||
"activeFrontierNodeIds": ["router-flow"],
|
||||
"note": "Watcher observed 1 recent changed path(s) touching 1 mapped graph node(s), including 1 active frontier node(s)."
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -4172,6 +4172,7 @@ pub struct ThreadEpiphanyFreshnessResponse {
|
|||
pub state_revision: Option<u64>,
|
||||
pub retrieval: ThreadEpiphanyRetrievalFreshness,
|
||||
pub graph: ThreadEpiphanyGraphFreshness,
|
||||
pub watcher: ThreadEpiphanyInvalidationInput,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
|
|
@ -4243,6 +4244,36 @@ pub struct ThreadEpiphanyGraphFreshness {
|
|||
pub note: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub enum ThreadEpiphanyInvalidationStatus {
|
||||
Unavailable,
|
||||
Clean,
|
||||
Changed,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ThreadEpiphanyInvalidationInput {
|
||||
pub status: ThreadEpiphanyInvalidationStatus,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional = nullable)]
|
||||
pub watched_root: Option<PathBuf>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional = nullable)]
|
||||
pub observed_at_unix_seconds: Option<i64>,
|
||||
pub changed_path_count: u32,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub changed_paths: Vec<PathBuf>,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub graph_node_ids: Vec<String>,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub active_frontier_node_ids: Vec<String>,
|
||||
pub note: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
|
|
|
|||
Reference in a new issue