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

Issue 329 #333

Merged
merged 4 commits into from Oct 3, 2018

Conversation

Projects
None yet
2 participants
@xd009642
Copy link
Contributor

xd009642 commented Oct 3, 2018

This pr closes #329 by adding a URL to the report into the create and run comment. It does this using the Host header in the HTTP request and then passes it down to commands::run as an additional argument.

Tested on with my own craterbot-jr and a test repo. You can see the correct link created here though that link will stop working when I the ngrok url runs out!

xd009642 added some commits Oct 3, 2018

Added report URL to github issue comments
Takes the Host header value and passes it down to commands so that the issue comments now link to the report.
Corrected markdown and removed extra links.
Fixed the markdown in the link issue, added http:// so it didn't think it was a page embedded in the issue and removed the link from edit and retry commands
@pietroalbini
Copy link
Member

pietroalbini left a comment

You need to run rustfmt (and clippy) stable to get the CI to pass. Also, I'd personally add the link in another line, along with an URL to the queue, like so:

:mag: You can check out [the queue](https://crater.rust-lang.org) and [this experiment's details](https://crater.rust-lang.org/ex/beta-1.30-2).
Preview

🔍 You can check out the queue and this experiment's details.

@@ -37,14 +37,14 @@ pub fn run(host: &str, data: &Data, issue: &Issue, args: RunArgs) -> Result<()>
Message::new()
.line(
"ok_hand",
format!("Experiment **`[{}]({})`** created and queued.", name, host),
format!("Experiment [**`{}`**](http://{}/ex/{0}) created and queued.", name, host),

This comment has been minimized.

@pietroalbini

pietroalbini Oct 3, 2018

Member

Hmm, I would use https by default here. It's what Crater uses in prod, and ngrok also provides https urls.

let host = headers
.get("Host")
.and_then(|h| h.to_str().ok())
.ok_or("mission header Host\n")?;

This comment has been minimized.

@pietroalbini

pietroalbini Oct 3, 2018

Member

Typo: mission -> missing (and I don't think the \n is needed here)

This comment has been minimized.

@xd009642

xd009642 Oct 3, 2018

Author Contributor

so the \n is present in the previous lines error strings so I felt it was best to be consistent. If I remove it should I remove the others?

This comment has been minimized.

@pietroalbini

pietroalbini Oct 3, 2018

Member

Nope, my bad, the \n is actually needed here. Sorry!

xd009642 added some commits Oct 3, 2018

Responded to review comments.
Rustfmt ran, typo fixed and https URL
Updated comment format
Now add another line with the links to useful places as per review

@pietroalbini pietroalbini merged commit 29d2aeb into rust-lang-nursery:master Oct 3, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pietroalbini

This comment has been minimized.

Copy link
Member

pietroalbini commented Oct 3, 2018

Thanks!

@pietroalbini

This comment has been minimized.

Copy link
Member

pietroalbini commented Oct 3, 2018

Changes deployed to production and announced in the changelog 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.