Skip to content

Commit

Permalink
Switch to modern dice by default
Browse files Browse the repository at this point in the history
Summary:
This has been stable for a while now, switch to it by default. Keeping
legacy dice as an option for a short period before deleting it.

Reviewed By: JakobDegen

Differential Revision: D59180407

fbshipit-source-id: 9e8c9c08fa3bca3053960283f34f2d5876e808de
  • Loading branch information
cjhopman authored and facebook-github-bot committed Jul 2, 2024
1 parent 6476d76 commit 7a34c8b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions app/buck2_build_api/src/configure_dice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn determine_which_dice(
}
}

Ok(WhichDice::Legacy)
Ok(WhichDice::Modern)
}

#[cfg(test)]
Expand Down Expand Up @@ -139,7 +139,7 @@ mod tests {
#[test]
fn test_determine_which_dice() -> anyhow::Result<()> {
assert_eq!(
WhichDice::Legacy,
WhichDice::Modern,
determine_which_dice(
Some(
&Cfg {
Expand Down Expand Up @@ -214,7 +214,7 @@ mod tests {
);

assert_eq!(
WhichDice::Legacy,
WhichDice::Modern,
determine_which_dice(
Some(
&Cfg {
Expand Down
4 changes: 2 additions & 2 deletions app/buck2_client_ctx/src/subscribers/simpleconsole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ where
}

async fn handle_tags(&mut self, tags: &TagEvent) -> anyhow::Result<()> {
if tags.tags.contains(&"which-dice:Modern".to_owned()) {
self.handle_stderr("Note: using experimental modern dice.")
if tags.tags.contains(&"which-dice:Legacy".to_owned()) {
self.handle_stderr("Note: using deprecated legacy dice.")
.await?;
}

Expand Down
2 changes: 1 addition & 1 deletion app/buck2_client_ctx/src/subscribers/superconsole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ mod tests {
test_session: Some(buck2_data::TestSessionInfo {
info: (0..100).map(|_| "a").collect(),
}),
modern_dice: false,
legacy_dice: false,
};

let full = SessionInfoComponent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ impl<'s> Component for SessionInfoComponent<'s> {
headers.push(Line::unstyled("Test UI:")?);
ids.push(Span::new_unstyled(info)?);
}
if self.session_info.modern_dice {
if self.session_info.legacy_dice {
headers.push(Line::unstyled("Note:")?);
ids.push(Span::new_unstyled(
"Using experimental modern dice".to_owned(),
"Using deprecated legacy dice".to_owned(),
)?);
}
// pad all headers to the max width.
Expand Down
6 changes: 3 additions & 3 deletions app/buck2_event_observer/src/event_observer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where
session_info: SessionInfo {
trace_id,
test_session: None,
modern_dice: false,
legacy_dice: false,
},
test_state: TestState::default(),
starlark_debugger_state: StarlarkDebuggerState::new(),
Expand Down Expand Up @@ -117,8 +117,8 @@ where
.update(event.timestamp(), snapshot)?;
}
TagEvent(tags) => {
if tags.tags.contains(&"which-dice:Modern".to_owned()) {
self.session_info.modern_dice = true;
if tags.tags.contains(&"which-dice:Legacy".to_owned()) {
self.session_info.legacy_dice = true;
}
}
SystemInfo(system_info) => {
Expand Down
2 changes: 1 addition & 1 deletion app/buck2_event_observer/src/session_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ use buck2_wrapper_common::invocation_id::TraceId;
pub struct SessionInfo {
pub trace_id: TraceId,
pub test_session: Option<buck2_data::TestSessionInfo>,
pub modern_dice: bool,
pub legacy_dice: bool,
}

0 comments on commit 7a34c8b

Please sign in to comment.