-
Notifications
You must be signed in to change notification settings - Fork 586
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
Refactor GitHub API #1726
Refactor GitHub API #1726
Conversation
- Changed CreateRelease to allow the user to explicitly set each of the release parameters on creation. - Add CreateDraftWithNotes with same signature as old createDraft func - Add / fix comments, ensure param names are consistent - Change functions to Pascal Case
Will need some advice on how to fix the build given this is a breaking change to the API. If I change |
When bootstrapping you can assume that |
OK - and then we remove the conditionals once merged? Sounds good. Sorry, a bit new to this! |
No problem, actually this is quite new as I was running into the same problem several times already ;) |
/// - `tagName` - the name of the tag to use for this release | ||
/// - `setParams` - function used to override the default release parameters | ||
/// - `client` - GitHub API v3 client | ||
let CreateRelease owner repoName tagName setParams (client : Async<GitHubClient>) = |
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.
question is if we should add owner
repoName
and tagName
to the record as well. It "might" help to provide same script internal defaults if you create releases to multiple repos with the same owner.
I don't have a strong opinion on that, just something that crosses my mind. Question is if we can provide reasonable defaults for any of those parameter (but we already have APIs which have mandatory arguments in the record without default)
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 had considered, but thought as we had no defaults & they were required that it was better to explicitly call out they were required. I suppose it's nice that you could do CreateRelease "owner" "repo" "v1.0" id ...
and it would just work.
Struggling a bit with this bootstrapping. I've got the
But it's failing with messages that imply it doesn't have
I've pushed the change anyway. |
OK, I think I've found it. |
d0268b1
to
e69cb72
Compare
e69cb72
to
38fe9c5
Compare
Actually we have two command lines:
The command lines differ. I failed at not noticing that Thanks for taking care of this. Your change (ie removing |
The primary change here is to allow the user to specify the release property values explicitly when creating a GitHub release. The previous
createDraft
/createRelease
API enforced that the release name matched the tag name and that the body was set to a newline delimited set of release notes.CreateRelease
uses a similar pattern to a lot of Fake modules in that you can override the default params where required.CreateDraftWithNotes
DraftNewRelease
keeps the previous opinionated behaviour ofcreateDraft
for users who are happy with that.As this is a breaking change and Fake 5 is as-yet unreleased, I also pascal cased the functions to be more consistent with the rest of the Fake modules. Happy to revert this if the prevailing opinion is to the contrary.
Closes #1723