Skip to content
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

[beta] Automaticaly calculate beta prerelease numbers #47396

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

alexcrichton
Copy link
Member

This commit automatically calculates the beta prerelease number meaning we'll no
longer need to manually change the beta version. Instead beta will automatically
deploy any time a backport is merged, ensuring that backports are released for
testing ASAP. More details about this can be found on the internal forums

The only bit of trickiness here was that on CI we do shallow clones by default
but the git history probing here requires some more information. Do cope with
that this commit chooses the strategy of converting the repository to a full
clone via the --unshallow flag to git. That way this should work for local
developers as well as CI changes.

Note that this commit is coming first to the beta branch to test it, and if
successful we can go back and land it on master.

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive
Copy link
Collaborator

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against beta. Please double check that you specified the right target!

@alexcrichton
Copy link
Member Author

r? @kennytm

@rust-highfive rust-highfive assigned kennytm and unassigned aturon Jan 12, 2018
@shepmaster
Copy link
Member

FWIW code looks reasonable to me.

@shepmaster shepmaster added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 13, 2018
@bors
Copy link
Contributor

bors commented Jan 13, 2018

☔ The latest upstream changes (presumably #47399) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Jan 13, 2018

🔒 Merge conflict

self.try_run_quiet(
Command::new("git")
.arg("fetch")
.arg("--unshallow"),
Copy link
Member

@kennytm kennytm Jan 13, 2018

Choose a reason for hiding this comment

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

Since the bootstrap is running inside Docker where the repository is mount as read-only, I'm not sure if git fetch --unshallow will succeed.

This command may need to be run before the docker is built (before src/ci/docker/run.sh finishes), but it should only be run in the beta channel.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gah right good point, what a bummer! I think I may try to fold this into the init_repo.sh script perhaps.

@alexcrichton alexcrichton force-pushed the beta-next branch 2 times, most recently from edd1a2f to 8152a1c Compare January 13, 2018 19:08
@alexcrichton
Copy link
Member Author

re r? @kennytm

@kennytm
Copy link
Member

kennytm commented Jan 13, 2018

Travis's still failing. Try git fetch origin --unshallow beta master?

Copy link
Member

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

r=me after Travis can successfully run tidy (or is green).

@alexcrichton
Copy link
Member Author

@bors: r=kennytm

alright let's see if that works

@bors
Copy link
Contributor

bors commented Jan 14, 2018

📌 Commit 41bd3ce has been approved by kennytm

@kennytm
Copy link
Member

kennytm commented Jan 14, 2018

@bors r-

Travis is still failing

.arg("origin")
.arg("beta")
);
let beta = beta.trim().split(' ').next().unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps use split_whitespace() here. The parts are separated by tabs.

[00:02:47] fatal: Not a valid object name bb9be9ecc0b2501802e50a5c35be14e539be1638	refs/heads/beta
[00:02:47] thread 'main' panicked at 'command did not execute successfully: "git" "merge-base" "bb9be9ecc0b2501802e50a5c35be14e539be1638\trefs/heads/beta" "e6072a7b3835f1875e81c9fd27799f9b20a0770c\trefs/heads/master"

@alexcrichton
Copy link
Member Author

@bors: r=kennytm

Oops indeed!

@bors
Copy link
Contributor

bors commented Jan 14, 2018

📌 Commit a57032f has been approved by kennytm

@@ -346,6 +348,7 @@ impl Build {

/// Executes the entire build, as configured by the flags and configuration.
pub fn build(&mut self) {
println!("{}", self.beta_prerelease_version());
Copy link
Member

Choose a reason for hiding this comment

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

This is not essential, but maybe remove this println!?

Copy link
Member Author

Choose a reason for hiding this comment

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

Er sorry yeah that was just debugging

This commit automatically calculates the beta prerelease number meaning we'll no
longer need to manually change the beta version. Instead beta will automatically
deploy any time a backport is merged, ensuring that backports are released for
testing ASAP. More details about this can be found on the internal [forums]

The only bit of trickiness here was that on CI we do shallow clones by default
but the git history probing here requires some more information. Do cope with
that this commit chooses the strategy of converting the repository to a full
clone via the `--unshallow` flag to `git`. That way this should work for local
developers as well as CI changes.

Note that this commit is coming first to the beta branch to test it, and if
successful we can go back and land it on master.

[forums]: https://internals.rust-lang.org/t/tweaking-how-betas-are-produced/6526
@alexcrichton
Copy link
Member Author

@bors: r=kennytm

@bors
Copy link
Contributor

bors commented Jan 14, 2018

📌 Commit 9426dda has been approved by kennytm

@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 14, 2018
@kennytm kennytm removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 14, 2018
@kennytm
Copy link
Member

kennytm commented Jan 17, 2018

@bors p=4

@bors
Copy link
Contributor

bors commented Jan 17, 2018

⌛ Testing commit 9426dda with merge 3732f64354c3b77ee728a0797a1a496724d47eea...

@bors
Copy link
Contributor

bors commented Jan 18, 2018

💔 Test failed - status-travis

@alexcrichton
Copy link
Member Author

@bors: retry

[01:42:02] test [run-pass] run-pass/zero-sized-linkedlist-push.rs has been running for over 60 seconds

[01:42:02] test [run-pass] run-pass/zero-sized-tuple-struct.rs has been running for over 60 seconds



No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received

I think those macs are having a bad day...

@bors
Copy link
Contributor

bors commented Jan 18, 2018

⌛ Testing commit 9426dda with merge 597549e...

bors added a commit that referenced this pull request Jan 18, 2018
[beta] Automaticaly calculate beta prerelease numbers

This commit automatically calculates the beta prerelease number meaning we'll no
longer need to manually change the beta version. Instead beta will automatically
deploy any time a backport is merged, ensuring that backports are released for
testing ASAP. More details about this can be found on the internal [forums]

The only bit of trickiness here was that on CI we do shallow clones by default
but the git history probing here requires some more information. Do cope with
that this commit chooses the strategy of converting the repository to a full
clone via the `--unshallow` flag to `git`. That way this should work for local
developers as well as CI changes.

Note that this commit is coming first to the beta branch to test it, and if
successful we can go back and land it on master.

[forums]: https://internals.rust-lang.org/t/tweaking-how-betas-are-produced/6526
@bors
Copy link
Contributor

bors commented Jan 18, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: kennytm
Pushing 597549e to beta...

@bors bors merged commit 9426dda into rust-lang:beta Jan 18, 2018
@alexcrichton alexcrichton deleted the beta-next branch January 18, 2018 15:07
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 18, 2018
We got rust-lang#47396 merged but it looks like rcs failed to deploy the beta because
when it tried to calculate the beta version its cwd was different. Let's try to
fix this bug and fix auto-deploy by explicitly setting the `current_dir` for git
commands.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 18, 2018
We got rust-lang#47396 merged but it looks like rcs failed to deploy the beta because
when it tried to calculate the beta version its cwd was different. Let's try to
fix this bug and fix auto-deploy by explicitly setting the `current_dir` for git
commands.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants