What is the int key in Issues data of the fake driver ?
Closed this issue · 10 comments
go-scm/scm/driver/fake/data.go
Lines 5 to 7 in 049a2db
I thought it was the issue ID at first but then the value should be an issue, not an array of issues right ?
Am i missing something ?
I honestly have no idea! @jstrachan, do you know?
here's a little helper method used in some unit tests that creates a PR and registers it into the fake data so you can query it via the go-scm PullRequest API:
https://github.com/jenkins-x/jx-preview/blob/master/pkg/fakescms/fakescm.go#L11
Thanks !
I still don't really understand why the value is an array though. For cases where a PR has multiple issues ?
I am probably biased, reasoning in terms of github but maybe the model is different for other providers...
I just checked the fake code and there's no real reason right now for the map[int][]*scm.Issue
- we could just make it a []*scm.Issue
I suspect! - or just a map[int]*scm.Issue
How about making a map[string][]*scm.Issue
? The string
key being the repository.
ah yeah - thats probably what it should have been ;)
/close
Closing as the question has been answered.
@eddycharly: Closing this issue.
In response to this:
/close
Closing as the question has been answered.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the jenkins-x/lighthouse repository.