-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fetch current user's issues & a specific repository's issues #28
Conversation
|
||
public let locked: Bool | ||
public let comments: Int | ||
public let pullRequest: PullRequest? |
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.
Identation
Slowly getting there, I'm having a hard time wrapping my head around Argo 😁 |
Let me know if you need any help! |
I think I do! I'll push my work (I've added a couple of new things, like an actually passing test) and maybe we can take things from here, I'm having a hard time with mapping some dates (updated/created and closed because the last one is nil) Beside that I think it should be ready quickly because most of the work was already there. :) |
// <*> j <| "milestone" | ||
<*> j <| "locked" | ||
<*> j <| "comments" | ||
// <*> (j <|? "closed_at" >>- toNSDate) |
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.
@mdiep do you see something wrong with this ? Somehow it fails at mapping the date, saying the keys closed_at, updated_at and created at don't exist when they do (but the closed_at is null).
I've updated the decode()
method temporarily to print the error when mapping fails)
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.
When I run the test you added with the fixture data, the createdAt
and updatedAt
fields are correctly decoded. 😕
(Sorry I didn't look at this sooner!)
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.
Yeah it seems to be working, but it fails because of a "MissingKey" error, see the log:
Returning date: 2016-05-24 23:38:39 +0000
Returning date: 2016-05-24 23:38:39 +0000
decoded = Failure(MissingKey(created_at))
Am I missing something?
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.
Oooooh, I think the created_at
error does not come from the Issue but probably something else!
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.
When I remove the mapping User
part by commenting out the user argument, it works. Could this be a bug in Argo..? I read the relationship were supposed to be working auto-magically... 😁
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.
Yeah! That makes it easier to review and discuss. 😄
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.
Are you still interested in pursuing this?
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 just come back from vacations, sorry I should have warned you. I'm still interested in working on this, but if you think you can tackle the user refactoring part relatively soon, it'll probably be better since I'm finding my ways in Tentacle. 😄
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 sounded like a nice break from reviewing PRs, so I did it tonight: #31. 😄
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.
Cool! I'll rebase my branch and keep working on this this week! Thanks 😋
@mdiep I'm sorry but I have one more issue with Argo / Curry. In the current Issue I'm using in my test, the "closed_at" is Otherwise I've started using Tentacle to fetch Issues in my app and it works well 👌 |
@mdiep I just added support for Milestone and PullRequest so I think this is ready for a deeper code review. Let me know if you want me to squash my branch first! |
7A1A82551CF3DBAC0076E2DD /* Issue.swift */, | ||
7A1A82571CF3DE4C0076E2DD /* Label.swift */, | ||
7A1A82591CF3DEEA0076E2DD /* Milestone.swift */, | ||
7A1A825D1CF3E5B60076E2DD /* PullRequest.swift */, |
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.
Could you alphabetize the new files in the Xcode project navigator? 🙏
public let id: Int | ||
|
||
/// The URL to view this issue in a browser | ||
public let url: NSURL? |
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 should be URL
.
I'm not wild about doing that. Let me think about it. |
Sure, let me know 😄 |
&& lhs.updatedAt == rhs.updatedAt | ||
&& lhs.labels == rhs.labels | ||
&& lhs.milestone == rhs.milestone | ||
&& lhs.pullRequest == rhs.pullRequest |
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.
Indentation is off here. &&
lines should be indented another level.
Here's a Color initializer that we can use: import AppKit
typealias Color = NSColor
extension Color {
convenience init(hex: String) {
precondition(hex.characters.count == 6)
let scanner = NSScanner(string: hex)
var rgb: UInt32 = 0
scanner.scanHexInt(&rgb)
let r = CGFloat((rgb & 0xff0000) >> 16) / 255.0
let g = CGFloat((rgb & 0x00ff00) >> 8) / 255.0
let b = CGFloat((rgb & 0x0000ff) >> 0) / 255.0
self.init(red: r, green: g, blue: b, alpha: 1)
}
} (You'll need to add some Would you mind adding some tests for it? These cases should be a decent start: Color(hex: "ffffff")
Color(hex: "aa0000")
Color(hex: "00aa00")
Color(hex: "0000aa")
Color(hex: "000000") |
Done, done, done and done. Slowly getting there! |
This is great! Thank you for all the work you put in on this! ⚡ ⚡ ⚡ |
Wouhou, cool! 🎉 |
Hello !
It's a WIP, but I figured I should open a PR just in case somebody is working on this too 😉
I'll update this soon!