Skip to content

Commit

Permalink
watchman: when project-metadata isn't provided, don't add it to the…
Browse files Browse the repository at this point in the history
… XDB query

Summary:
When `project-metadata` isn't provided in the watchman query, instead of adding `AND project_metadata = ""` to the XDB query, just don't add anything.

We then need to bubble up the project_metadata from the found saved state to where we construct the manifold path for the saved state.

Context: we need this for hack to be able to still get a saved state even when our config has changed.

Reviewed By: kmancini

Differential Revision: D61018325

fbshipit-source-id: b01b162adeed5a73fd10c2737c9da1115f0b333e
  • Loading branch information
Catherine Gasnier authored and facebook-github-bot committed Sep 9, 2024
1 parent 1b843c5 commit 9c9d9ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions watchman/telemetry/LogEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ struct SavedState {
std::string project;
std::string path;
int64_t commit_date = 0;
std::string metadata;
std::optional<std::string> projectMetadata;
std::string properties;
bool success = false;

Expand All @@ -169,8 +169,8 @@ struct SavedState {
event.addString("path", path);
}
event.addInt("commit_date", commit_date);
if (!metadata.empty()) {
event.addString("metadata", metadata);
if (projectMetadata.has_value()) {
event.addString("metadata", projectMetadata.value());
}
if (!properties.empty()) {
event.addString("properties", properties);
Expand Down

0 comments on commit 9c9d9ba

Please sign in to comment.