Skip to content

Add the build link bisect tool to the website#3902

Merged
Keavon merged 5 commits intomasterfrom
bisect-tool
Mar 15, 2026
Merged

Add the build link bisect tool to the website#3902
Keavon merged 5 commits intomasterfrom
bisect-tool

Conversation

@Keavon
Copy link
Member

@Keavon Keavon commented Mar 15, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the developer experience by integrating web-based tools directly into the cargo run command-line utility. It introduces an explore subcommand that provides quick access to a new interactive build bisect tool and the existing editor structure outline on the project's website. This streamlines the process of debugging regressions and understanding the codebase by making these valuable resources more readily available from the terminal.

Highlights

  • New explore command for cargo run: Introduced a new explore command to the cargo run tool, enabling quick access to web-based developer utilities.
  • Interactive Build Bisect Tool: Integrated a new interactive build bisect tool into the website, accessible via cargo run explore bisect, to help pinpoint commit-introduced regressions or features.
  • Editor Structure Outline Access: Added editor subcommand under cargo run explore to quickly launch the editor structure outline on the project's website.
  • Cross-platform URL Opening Utility: Implemented a new open_url utility function in cargo-run for cross-platform opening of URLs.
  • Website Documentation Updates: Updated website documentation to include instructions for using the new explore commands and details about the bisect tool.
Changelog
  • tools/cargo-run/src/lib.rs
    • Added Explore(Option<String>) variant to the Action enum.
    • Modified Task::new to parse the explore command and its optional argument.
    • Implemented a new open_url function for cross-platform URL opening.
  • tools/cargo-run/src/main.rs
    • Updated the usage message to include the new explore command.
    • Added an explore_usage function to detail explore subcommands.
    • Extended run_task to handle the Explore action, opening specific URLs based on the subcommand.
    • Added unreachable!() arms for Action::Explore in run_task's match statements.
  • website/content/about.md
    • Added an id="extras" attribute to a div element.
  • website/content/volunteer/guide/codebase-overview/debugging-tips.md
    • Included CSS and JavaScript dependencies for the new bisect tool.
    • Added a new "Build bisect tool" section with an interactive UI.
    • Updated Rust debug! macro usage to log::debug!.
  • website/content/volunteer/guide/codebase-overview/editor-structure.md
    • Added a cargo run explore editor command snippet for quick access.
  • website/content/volunteer/guide/starting-a-task/code-quality-guidelines.md
    • Updated an example for naming conventions for clarity.
  • website/sass/page/about.scss
    • Added styling for buttons within the #extras section.
  • website/sass/page/contributor-guide/bisect-tool.scss
    • Created new SCSS styles for the interactive bisect tool.
  • website/static/js/page/contributor-guide/bisect-tool.js
    • Added new JavaScript logic for the interactive GitHub commit bisect tool, including API calls and UI management.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new cargo run explore command and a web-based build bisect tool, which is a great addition for debugging. The implementation looks solid, with new Rust logic to open URLs, and a comprehensive JavaScript-powered interactive tool on the website. My review includes a couple of suggestions to improve the robustness of the new functionality: one for the URL opening logic in Rust to handle special characters correctly, and another for the JavaScript to perform more complete HTML escaping.

Comment on lines +79 to +87
pub fn open_url(url: &str) -> Result<(), Error> {
#[cfg(target_os = "windows")]
let command = format!("cmd /c start {url}");
#[cfg(target_os = "macos")]
let command = format!("open {url}");
#[cfg(not(any(target_os = "windows", target_os = "macos")))]
let command = format!("xdg-open {url}");
run(&command)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The current implementation of open_url uses the run function, which splits the command string by whitespace. This is not robust for URLs, as they can contain special characters (like &) that are misinterpreted by the shell, or could in the future contain characters that cause incorrect splitting. A better approach is to construct the std::process::Command directly, passing the URL as a distinct argument. This ensures it's handled correctly across different platforms.

pub fn open_url(url: &str) -> Result<(), Error> {
	let status = {
		#[cfg(target_os = "windows")]
		{
			// The empty string argument is a workaround for `start` to correctly handle URLs with ampersands.
			process::Command::new("cmd").args(["/C", "start", "", url]).status()
		}
		#[cfg(target_os = "macos")]
		{
			process::Command::new("open").arg(url).status()
		}
		#[cfg(not(any(target_os = "windows", target_os = "macos")))]
		{
			process::Command::new("xdg-open").arg(url).status()
		}
	}
	.map_err(|e| Error::Io(e, format!("failed to run command to open url: {url}")))?;

	if !status.success() {
		return Err(Error::Command(format!("open url command for '{url}'"), status));
	}

	Ok(())
}


function messageToHtml(/** @type {string} */ message) {
if (!message) return "";
const escaped = message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The HTML escaping is incomplete. It handles &, <, and > but misses other characters like single and double quotes. While this may not be a security issue here since the output is not used within an HTML attribute, it's less robust. A more complete escaping would prevent potential rendering issues if commit messages contain these characters.

Suggested change
const escaped = message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
const escaped = message.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

3 issues found across 9 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="website/static/js/page/contributor-guide/bisect-tool.js">

<violation number="1" location="website/static/js/page/contributor-guide/bisect-tool.js:192">
P1: Paginate the initial `/commits` window. With only page 1 loaded here, dense date ranges can omit the requested hash or nearest commit and start the bisect from the wrong point.</violation>

<violation number="2" location="website/static/js/page/contributor-guide/bisect-tool.js:357">
P2: Handle boundary-search exhaustion explicitly. If the issue is still present on the oldest available commit, this path keeps re-testing commit 0 forever.</violation>
</file>

<file name="tools/cargo-run/src/lib.rs">

<violation number="1" location="tools/cargo-run/src/lib.rs:79">
P2: Pass the URL to `Command` as an argument instead of formatting a shell command string. The current helper loses argument boundaries via `split_whitespace()`, and `cmd /c start` will misparse common Windows URLs containing `&`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="website/static/js/page/contributor-guide/bisect-tool.js">

<violation number="1" location="website/static/js/page/contributor-guide/bisect-tool.js:378">
P1: This stop condition misreports the oldest available commit as the introducing commit when no known-good commit exists yet.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions github-actions bot requested a deployment to graphite-dev (Preview) March 15, 2026 11:17 Abandoned
@github-actions github-actions bot requested a deployment to graphite-dev (Preview) March 15, 2026 11:26 Abandoned
@Keavon Keavon merged commit 187650a into master Mar 15, 2026
7 checks passed
@Keavon Keavon deleted the bisect-tool branch March 15, 2026 12:14
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.

1 participant