Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions dev-tools/releng/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const TUF_PACKAGES: [&PackageName; 12] = [
&PackageName::new_const("probe"),
];

const HELIOS_REPO: &str = "https://pkg.oxide.computer/helios/2/dev/";
const HELIOS_PKGREPO: &str = "https://pkg.oxide.computer/helios/2/dev/";
const HELIOS_REPO: &str = "https://github.com/oxidecomputer/helios.git";

static WORKSPACE_DIR: LazyLock<Utf8PathBuf> = LazyLock::new(|| {
// $CARGO_MANIFEST_DIR is at `.../omicron/dev-tools/releng`
Expand Down Expand Up @@ -329,13 +330,13 @@ async fn main() -> Result<()> {
// HEAD in a remote repository refers to the default
// branch, even if the default branch is renamed.
// `--no-write-fetch-head` avoids modifying FETCH_HEAD.
.args(["fetch", "--no-write-fetch-head", "origin", "HEAD"])
.args(["fetch", HELIOS_REPO, "HEAD"])
.ensure_success(&logger)
.await?;
let upstream_commit = git_resolve_commit(
&args.git_bin,
&args.helios_dir,
"origin/HEAD",
"FETCH_HEAD",
&logger,
)
.await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason we used --no-write-fetch-head is to avoid overwriting FETCH_HEAD in the user's repository without telling them. Maybe we really want git ls-remote here?

$ git ls-remote --exit-code https://github.com/oxidecomputer/helios.git HEAD
25b5bf1a445524e698a7a1d095184d6a7ced16e4        HEAD

More of a pain to parse but avoids modifying the repo without the user knowing. I can implement this if you'd like.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm kind of used to FETCH_HEAD being fairly transient, but that could be because it gets updated whenever we pull a change in from gerrit to look at it etc.
Yes, please feel free to take this and implement it with ls-remote, which does look like a better option.
I just realised that quite a few of us don't have origin pointing to where you might expect in our $HOME/helios checkouts, and so we weren't benefitting from the out-of-date check.

Expand All @@ -355,7 +356,7 @@ async fn main() -> Result<()> {
} else {
info!(logger, "cloning helios to {}", args.helios_dir);
Command::new(&args.git_bin)
.args(["clone", "https://github.com/oxidecomputer/helios.git"])
.args(["clone", HELIOS_REPO])
.arg(&args.helios_dir)
.ensure_success(&logger)
.await?;
Expand Down Expand Up @@ -674,7 +675,7 @@ async fn main() -> Result<()> {
if !args.helios_local {
image_cmd = image_cmd
.arg("-p") // use an external package repository
.arg(format!("helios-dev={HELIOS_REPO}"))
.arg(format!("helios-dev={HELIOS_PKGREPO}"))
}

// helios-build experiment-image
Expand Down
Loading