Skip to content

Add helper to get runID from Custom Deployment Protection Rule Event #3476

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

Merged
merged 19 commits into from
Feb 13, 2025

Conversation

pputman-clabs
Copy link
Contributor

@pputman-clabs pputman-clabs commented Feb 12, 2025

Added Helper Function with test to get the RunID from the DeploymentCallbackURL and convert it to an int64.

Fixes: #3473.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link

google-cla bot commented Feb 12, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gmlewis gmlewis changed the title Pputman/add helper function Add helper to get runID from Custom Deployment Protection Rule Event Feb 12, 2025
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.02%. Comparing base (f867d00) to head (af36bac).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
github/github.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3476      +/-   ##
==========================================
- Coverage   91.04%   91.02%   -0.02%     
==========================================
  Files         179      179              
  Lines       15551    15561      +10     
==========================================
+ Hits        14158    14165       +7     
- Misses       1221     1223       +2     
- Partials      172      173       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @pputman-clabs.

It might be nice to add a comment to the other functions that required a runID that this new helper can be used to easily extract the value from the event.

@pputman-clabs
Copy link
Contributor Author

Okay I made the requested changes, thanks for the feedback! Let me know if there's anything else programming wise you think I should change and if not I'll start adding the documentation for it to the other method docs.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert changes to go.mod and go.sum, as this helper and its tests should not require any more dependencies than we already have.

@pputman-clabs
Copy link
Contributor Author

Fixed, I didn't even notice those had updated, sorry. Thanks for the feedback, I'm learning as I go here.

pputman-clabs and others added 4 commits February 13, 2025 01:31
…s/go-github into pputman/add-helper-function
…the use of the new helper function
@pputman-clabs
Copy link
Contributor Author

Made requested changes, and added a comment to the actions_workflow_runs.go methods that they can use this helper function to easily pull out the RunID

…s/go-github into pputman/add-helper-function
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @pputman-clabs!
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@stevehipwell - might you have time for a code review? Thank you!

Copy link
Contributor

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whups, sorry I spoke too soon. It looks like the linter is having issues.
@pputman-clabs - can you please take a look when you get a chance?

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @pputman-clabs and @stevehipwell!
Merging.

@gmlewis gmlewis merged commit 6c46d71 into google:master Feb 13, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support pulling only runID from Custom Deployment Protection Rule Events
3 participants