Skip to content

feat: Add dependency state check for cached snapshots - #486

Draft
lukasmi93 wants to merge 1 commit into
Tinder:masterfrom
lukasmi93:fix/snapshot-cache-dependency-check
Draft

feat: Add dependency state check for cached snapshots#486
lukasmi93 wants to merge 1 commit into
Tinder:masterfrom
lukasmi93:fix/snapshot-cache-dependency-check

Conversation

@lukasmi93

Copy link
Copy Markdown

Add dependency state check for cached snapshots

Add dependency state check for cached snapshots
@lukasmi93
lukasmi93 force-pushed the fix/snapshot-cache-dependency-check branch from 7f9fe00 to 19bf8f5 Compare September 7, 2026 15:34
Comment thread src/server.rs
}
respond_json(request, 200, &metrics(state))
}
"/impacted_targets" | "/impacted_targets_with_distances" | "/dependency_edges" => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this route /dependency_edges removed?

Comment thread src/server.rs
}
};
let kind = match path {
"/dependency_edges" => QueryKind::DepEdges,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, why are we removing routes?

Comment thread src/server.rs
.filter(|types| !types.is_empty())
}

fn compute_query(state: &Arc<State>, inputs: QueryInputs, kind: QueryKind) -> Result<Value> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets revert this, use the enum

Comment thread src/server.rs
let resolve_started = Instant::now();
let (from_sha, to_sha) = resolve_both(state, &inputs.from, &inputs.to)?;
let resolve_millis = resolve_started.elapsed().as_millis() as u64;
if matches!(kind, QueryKind::DepEdges) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure why this was deleted, bring it back

Comment thread src/server.rs
let exclude_external = state.config.hash_options.bazel.is_bzlmod_enabled();
let impacted =
impacted_with_module_changes(&from, &to, Some(&state.config.hash_options.bazel))?;
let impacted_value = if matches!(kind, QueryKind::Distances) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the enum over your bool trap

Comment thread src/server.rs
modified_filepaths: BTreeSet::new(),
profile: true,
};
let result = compute_query(&state, inputs, QueryKind::Distances).unwrap();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is so much overwritten here, can we find a way to make this easier to reason about. Ask your agent maybe to optimize for review over reformatting the whole file and rearranging the logic

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