-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
User can assign him/herself to issue when pushing a new branch. #59
User can assign him/herself to issue when pushing a new branch. #59
Conversation
035599d
to
32d4398
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start!
32d4398
to
fbf9635
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job! But I see one problem: we now get the issue info twice in the new
command. I would like to avoid that and to reuse the issue info that is fetched in the new
command anyway. That means that in attempAssigment
you don't need to use issue'
function.
da08c53
to
a42950d
Compare
@vrom911 Please let me know what you think. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StevenXL , unfortunately, it doesn't work for me. Did you have a chance to test it somehow?
Also, I noticed that a bunch of old behaviour is broken now. From what I noticed the issues displayed in a different way know. I continue to test what else is broken now.
@chshersh, we need some tests asap, cause I'm sure this is because of the new version of the GitHub. The token is not working for me now, I don't know why.
@vrom911 @StevenXL When I call
This doesn't work for me either, unfortunately 😞 Regarding tests: need to think how to make tests automatic. Maybe not for all commands. But should be possible. At least for |
Hm... I think this exposes a problem with the For example, if I run
However, if I run the same command, but simply upgrade github package to 0.21, I get this output:
So, my code is surely wrong, but the I will keep looking, but let me know if you all have some thoughts. |
@StevenXL, I don't think that your code is wrong. It looks like that the new GitHub library is broken, and the error it returns looks very much like JSON parsing error, which means that they broke some encoders/decoders in the new release. I think we could try to create an issue there with the minimal example of this behaviour. Do you want to do this? 🙂 |
Hello! I will try to provide a minimal, reproducible example on the |
@vrom911 I couldn't write a small enough reproduction. (I was trying to use the script interpreter feature of This is a link to the issue in the |
@StevenXL I see that the issue is fixed (at least is says so) and |
Hi! I can work on this starting on June 6th. I’ll get back in touch then.
On June 25, 2019 at 8:58:44 PM, Dmitrii Kovanikov (notifications@github.com) wrote:
@StevenXL <https://github.com/StevenXL> I see that the issue is fixed (at
least is says so) and github-0.22 is released. Can you try this with the
newer github version?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#59?email_source=notifications&email_token=ABYMRSIDYI6J3ZYARQDY423P4LLOHA5CNFSM4G27OE2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYSFK4Q#issuecomment-505697650>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABYMRSPZIHW2MN6NZMQQ4Z3P4LLOHANCNFSM4G27OE2A>
.
|
Sorry - I meant July 6th.
…On Wed, Jun 26, 2019 at 9:58 AM Steven Leiva ***@***.***> wrote:
Hi! I can work on this starting on June 6th. I’ll get back in touch then.
On June 25, 2019 at 8:58:44 PM, Dmitrii Kovanikov (
***@***.***) wrote:
@StevenXL <https://github.com/StevenXL> I see that the issue is fixed (at
least is says so) and github-0.22 is released. Can you try this with the
newer github version?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#59?email_source=notifications&email_token=ABYMRSIDYI6J3ZYARQDY423P4LLOHA5CNFSM4G27OE2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYSFK4Q#issuecomment-505697650>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABYMRSPZIHW2MN6NZMQQ4Z3P4LLOHANCNFSM4G27OE2A>
.
--
Steven Leiva
305.528.6038
leiva.steven@gmail.com
http://www.linkedin.com/in/stevenleiva
|
a42950d
to
b9dcffe
Compare
@chshersh Hi! I am trying to add
I don't know how to proceed from here. Any help would be greatly appreciated. |
b9dcffe
to
cba73c3
Compare
@StevenXL I can start building the project using the following resolver: lts-13.27
extra-deps:
- relude-0.5.0
- shellmet-0.0.1
- github-0.22
- binary-orphans-1.0.1 # for github
- binary-instances-1 # for github
- time-compat-1.9.2.2 # for github |
@chshersh I was able to build with your suggestion. Thank you. Will continue to work on this. |
cba73c3
to
ec6e2b9
Compare
ec6e2b9
to
77a0e80
Compare
@chshersh OK I think the functionality is finally working. Let me know your thoughts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like progress 👍 And I have some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! I have one minor comment. Also, CI is failing because of HLint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I have a couple of questions/suggestion
@@ -62,7 +62,7 @@ library | |||
|
|||
build-depends: base-noprelude ^>= 4.12.0.0 | |||
, ansi-terminal >= 0.8 | |||
, github ^>= 0.20 | |||
, github ^>= 0.22 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should carefully check if this version broke something else again...
assignToIssue issue = withOwnerRepo assignAction >>= \case | ||
Left err -> errorMessage (T.pack $ show err) >> exitFailure | ||
Right AlreadyAssigned -> successMessage "Already assigned to issue" | ||
Right NewlyAssigned -> successMessage "Assigned to issue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add the issue number and name in here (ideally the link as well, so the user could just click and go there).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great idea but would like that change to be an separate issue / pr.
a2fe9f8
to
56e5200
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is okay. But I still see two problems with the implementation:
- The issue number is displayed in a wrong way under the
hit issue
command
➤ [#IssueNumber 81] Implement `hit diff` command with pretty diff
➤ [#IssueNumber 80] Add `hit uncommit` command
- I see the following error when trying to assign myself to an issue:
HTTPError (HttpExceptionRequest Request {
host = "api.github.com"
port = 443
secure = True
requestHeaders = [("User-Agent","github.hs/0.21"),("Accept","application/vnd.github.v3+json"),("Authorization","<REDACTED>")]
path = "/repos/kowainik/hit-on/issues/79"
queryString = ""
method = "PATCH"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
(StatusCodeException (Response {responseStatus = Status {statusCode = 500, statusMessage = "Internal Server Error"}, responseVersion = HTTP/1.1, responseHeaders = [("Date","Wed, 17 Jul 2019 05:09:02 GMT"),("Content-Type","application/json; charset=utf-8"),("Content-Length","0"),("Server","GitHub.com"),("Status","500 Internal Server Error"),("X-RateLimit-Limit","5000"),("X-RateLimit-Remaining","4994"),("X-RateLimit-Reset","1563343672"),("X-OAuth-Scopes","read:discussion, read:gpg_key, read:org, read:public_key, read:repo_hook, repo, user"),("X-Accepted-OAuth-Scopes",""),("X-GitHub-Media-Type","github.v3; format=json"),("Access-Control-Expose-Headers","ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type"),("Access-Control-Allow-Origin","*"),("Strict-Transport-Security","max-age=31536000; includeSubdomains; preload"),("X-Frame-Options","deny"),("X-Content-Type-Options","nosniff"),("X-XSS-Protection","1; mode=block"),("Referrer-Policy","origin-when-cross-origin, strict-origin-when-cross-origin"),("Content-Security-Policy","default-src 'none'"),("X-GitHub-Request-Id","AFC4:2B04:1FE60A:29B1E1:5D2EAD6E")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) ""))
My initial guess would be that this is because I don't have enough permissions for my token. But I checked it at GitHub and as you can see in this response, the token has repo
permission. So I don't know why this is happening 🤔 It would be nice to specify, what permissions from the token are required for this to work.
it sounds like y’all are experiencing the same problem with the github package as we did. We think it has something to do with the encoding where some fields are optional but the package puts in a |
@piq9117 Parsing in |
Hey @StevenXL, do you have plans for this PR? |
Resolves #15