-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add referenced workflows to WorkflowRun #2975
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
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.
path and sha are required in the response schema, so they can be
string
instead of*string
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.
Just FYI - overall, we've been very lax on the "receive-side" of responses from the GitHub server over the years in terms of what the official docs say will definitely be returned versus what optionally might be returned.
One of the reasons we've done this is first, it has not always been clear from the documentation what will or will not be sent back, and we've also discovered experientially that there are sometimes surprises depending on where a particular struct is embedded (for example, if we were to add this to a different method's return struct).
Additionally, years back we added the helper methods to get field values that are pointers which help tremendously to avoid panics if something was expected but didn't show up in the response.
So I believe our official stance is to try and be super careful about the
omitempty
on the request side of the usage, but on the response side, we are happy to err on the side of more fields with pointers (rather than fewer).So if @WillAbides had not mentioned this, I would have allowed this to go through, however I'm fine also with making the change since the official docs are hopefully correct and will not change soon.
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.
Thanks. That's good to read. I didn't realize the distinction between request and response fields.
I'm going to change my review to ✅ as soon as I hit submit on this comment. Then I might make a PR adding a note about this to CONTRIBUTING.md.
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.
So I wrote "official stance" above and that was probably too strongly worded 😄 .
The above is my "unofficial understanding" of how we are guiding the maintenance of this repo based upon years of observation.
The final authority is the original author of this repo, Will Norris, a friend and former coworker of mine, who asked me many years ago to help maintain this repo. I'm sure he listens in, as I hear from him every now and then, but I hate to ping him unless absolutely necessary. 😄
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.
@gmlewis thanks for the walkthrough in the past :) I'm happy to make any changes necessary. The reason I made them pointers is just to follow a patten with other required fields in
WorkflowRun
.