-
-
Notifications
You must be signed in to change notification settings - Fork 235
ref(vcs): Make extract_pr_{base,head}_sha_from_event match #2893
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
base: master
Are you sure you want to change the base?
Conversation
710b5ee to
6f869fa
Compare
a7e8a8d to
83c7be1
Compare
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.
lgtm, thank you for explaining the reasoning here.
One reason we might wish to crash instead of just logging a debug message: If GitHub ever changes the schema of the JSON event payload, in a way that this function would fail to extract the SHA, this would fail silently (debug messages are not logged at all by default, as the default log level is WARN). But, I'll leave it up to you to decide which way to go.
83c7be1 to
e12162c
Compare
e12162c to
254f4e6
Compare
254f4e6 to
354e2db
Compare
sg! Is it enough to call |
Make functions
extract_pr_{base,head}_sha_from_eventmatch exactly except forSHA they extract. Previously they have different APIs (
Result<Option<String>>vsOption<String>). We chooseOption<String>since there seems little point forcingusers to handle the case of Github returning invalid json. Better options are:
panic!)We switch both
extract_pr_head_sha_from_eventandextract_pr_base_sha_from_eventto panic.