-
Notifications
You must be signed in to change notification settings - Fork 3
Add lab restart command and 1BRC validators #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
thearyanahmed
merged 15 commits into
master
from
v0.9-reset-project-and-improved-validator
Jan 31, 2026
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
37316df
Add restart lab response types
thearyanahmed ae79973
Add restart_lab API method
thearyanahmed 9123cbb
Add clear_progress method for lab restart
thearyanahmed e7e7e87
Add lab restart command
thearyanahmed 8b86fb2
Bump version to 0.7.0
thearyanahmed 61d9004
Add E2E tests against local API
thearyanahmed 7c0681a
Update Cargo.lock for version 0.7.0
thearyanahmed 39facb3
Add output_match and benchmark validators for 1BRC
thearyanahmed 926ef13
Export benchmark validators in validators module
thearyanahmed 3eaa412
Wire output_match and benchmark into validator DSL
thearyanahmed 17b47f1
Fix VERSION constant to match Cargo.toml
thearyanahmed 407618c
Add make e2e target for E2E tests
thearyanahmed dd08c2e
Remove block comment decorations
thearyanahmed 8f237c6
Simplify redundant assertion in whoami E2E test
thearyanahmed a830281
Refactor benchmark validator helpers
thearyanahmed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -197,3 +197,60 @@ pub fn set_workspace(workspace: &str) -> Result<()> { | |||||
|
|
||||||
| Ok(()) | ||||||
| } | ||||||
|
|
||||||
| /// handle `luxctl lab restart` | ||||||
| pub async fn restart() -> Result<()> { | ||||||
| let config = Config::load()?; | ||||||
| if !config.has_auth_token() { | ||||||
| UI::error( | ||||||
| "not authenticated", | ||||||
| Some("run `luxctl auth --token $token`"), | ||||||
| ); | ||||||
| return Ok(()); | ||||||
| } | ||||||
|
|
||||||
| let mut state = LabState::load(config.expose_token())?; | ||||||
|
|
||||||
| let lab = match state.get_active() { | ||||||
| Some(l) => l.clone(), | ||||||
| None => { | ||||||
| UI::error("no active lab", None); | ||||||
| UI::note("run `luxctl lab start --slug <SLUG>` first"); | ||||||
| return Ok(()); | ||||||
| } | ||||||
| }; | ||||||
|
|
||||||
| let client = LighthouseAPIClient::from_config(&config); | ||||||
|
|
||||||
| match client.restart_lab(&lab.slug).await { | ||||||
| Ok(response) => { | ||||||
| // refresh tasks from server | ||||||
| match client.lab_by_slug(&lab.slug).await { | ||||||
| Ok(refreshed_lab) => { | ||||||
| let tasks = refreshed_lab.tasks.as_deref().unwrap_or(&[]); | ||||||
| state.set_active( | ||||||
| &lab.slug, | ||||||
| &lab.name, | ||||||
| tasks, | ||||||
| &lab.workspace, | ||||||
| lab.runtime.as_deref(), | ||||||
| ); | ||||||
| state.save(config.expose_token())?; | ||||||
| } | ||||||
| Err(_) => { | ||||||
| // if refresh fails, just clear local progress | ||||||
|
||||||
| // if refresh fails, just clear local progress | |
| // If refresh fails, just clear local progress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected capitalization for 'refresh tasks from server' to 'Refresh tasks from server'.