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

Posts the comment URL to the CLI #573

Merged
merged 3 commits into from
Apr 24, 2018
Merged

Posts the comment URL to the CLI #573

merged 3 commits into from
Apr 24, 2018

Conversation

orta
Copy link
Member

@orta orta commented Apr 24, 2018

Fixes #572 - also sets the clicky link in the status to be that comment

@orta
Copy link
Member Author

orta commented Apr 24, 2018

Works correct:
screen shot 2018-04-24 at 10 02 39 am

Copy link
Member

@sunshinejr sunshinejr left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

return true
// We want to make a URL like:
// https://bitbucket.org/atlassian/jiraconnect-ios/pull-requests/4/crash-groups/diff#comment-426
// But I don't see
Copy link
Member

Choose a reason for hiding this comment

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

Did you forget to add the rest of the comment? 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

lol yep, took a while to figure out how to make the link

}

return true
return issue && issue.html_url
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 a really smart way of avoiding accessing a property on null, although it wasn't very clear to me at first so I had to play with it to confirm that it does what I think it does 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, this is definitely a JS-ism

@@ -227,13 +227,14 @@ export class GitHub implements Platform {
* @param {string} newComment string value of comment
* @returns {Promise<boolean>} success of posting comment
*/
async updateOrCreateComment(dangerID: string, newComment: string): Promise<boolean> {
async updateOrCreateComment(dangerID: string, newComment: string): Promise<string | undefined> {
Copy link
Member

Choose a reason for hiding this comment

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

Sorry if obvious, but why is there an undefined type here instead of null?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's very little difference between undefined and null, but they are semantically different:x = {} and x = {a:undefined} respond the same to x.a but {a: null} is different. So I use null to define a conscious missing value - vs undefined which is kinda "not there", if you're doing an if(x.a) they're all the same, but some libs will treat null different from undefind

@orta orta merged commit 7f1cdda into master Apr 24, 2018
@orta orta deleted the add_urls_to_fails branch April 24, 2018 12:32
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.

None yet

2 participants