Repository navigation
Implement static typing for previews and clean up usage declarations - #1001
Merged
Merged
Conversation
marcoferrer
commented
Dec 15, 2020
Comment on lines
+2965
to
+2969
| root.createRequest() | ||
| .withPreview(BAPTISTE) | ||
| .withUrlPath("/repos/" + full_name) | ||
| .fetchInto(this) | ||
| .wrap(root); |
Contributor
Author
There was a problem hiding this comment.
This was a product of the formater
marcoferrer
commented
Dec 15, 2020
Comment on lines
+440
to
+443
| public B withPreview(Previews preview) { | ||
| return withPreview(preview.mediaType()); | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
This overload of the withPreview method was defined to prevent us from having to update every usage of the method after Previews was converted to an enum. This was an attempt at minimizing noise in the PR
marcoferrer
commented
Dec 15, 2020
| * Previews</a> | ||
| */ | ||
| static final String BAPTISE = "application/vnd.github.baptiste-preview+json"; | ||
| BAPTISTE("application/vnd.github.baptiste-preview+json"), |
Contributor
Author
There was a problem hiding this comment.
Typo fixed throughout the codebase
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces the following changes:
Previewsconst class into an enum to prevent string constants from being used at@Previewuse sites.@Previewto include references toPreviewsenum constants.Things to consider
Previews.ANTMAN->Previews.ANTMAN.mediaType()@Previewis also being used to denote sdk specific beta APIs in some cases. I suggest, when appropriate we migrate those usages to use a new annotation as to not conflate the two 'Preview' use cases. Something along the lines of@Hub4jBetaApior@SdkBetaApi. After that we should have no issue making preview media types a hard requirement.Before submitting a PR:
We love getting PRs, but we hate asking people for the same basic changes every time.
master. Create your PR from that branch.mvn clean compilelocally. This may reformat your code, commit those changes.mvn -D enable-ci clean install sitelocally. If this command doesn't succeed, your change will not pass CI.When creating a PR: