Skip to content
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

feat(hook): add hook id to hook object #239

Merged
merged 6 commits into from Mar 28, 2022
Merged

feat(hook): add hook id to hook object #239

merged 6 commits into from Mar 28, 2022

Conversation

ecrupper
Copy link
Contributor

@ecrupper ecrupper commented Mar 3, 2022

Couple related issues: go-vela/community#459 and go-vela/community#416

The hook_id is the field needed from GitHub to not only reach that deliveries page but also interact with any of their API endpoints related to hook deliveries. A hook_id is unique to any one hook within a repo, but since we already have an id field as well as a repo_id field, I chose address as the name. If anyone has a suggestion for another name, I am all ears!

I also cleaned up a couple of typos I noticed in the comments of build.go

@ecrupper ecrupper requested a review from a team as a code owner March 3, 2022 17:33
@ecrupper ecrupper self-assigned this Mar 3, 2022
@codecov
Copy link

codecov bot commented Mar 3, 2022

Codecov Report

Merging #239 (b396bb0) into master (f85f4c1) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head b396bb0 differs from pull request most recent head a4a1c96. Consider uploading reports for the commit a4a1c96 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #239      +/-   ##
==========================================
+ Coverage   97.16%   97.17%   +0.01%     
==========================================
  Files          54       54              
  Lines        5828     5850      +22     
==========================================
+ Hits         5663     5685      +22     
  Misses        122      122              
  Partials       43       43              
Impacted Files Coverage Δ
library/build.go 100.00% <ø> (ø)
database/hook.go 100.00% <100.00%> (ø)
library/hook.go 100.00% <100.00%> (ø)

@JordanSussman
Copy link
Collaborator

I chose address as the name. If anyone has a suggestion for another name, I am all ears!

I'm thinking hook_id would be less confusing compared to address.

library/hook.go Outdated Show resolved Hide resolved
@plyr4
Copy link
Contributor

plyr4 commented Mar 9, 2022

i agree with sussman on hook_id, consistent with the others repo_id etc

@plyr4
Copy link
Contributor

plyr4 commented Mar 9, 2022

although i see the scenario for hook.GetHookID and it not returning the ID of the hook to be confusing.

@plyr4
Copy link
Contributor

plyr4 commented Mar 9, 2022

some options, not all of them good

  • hook_id
  • delivery_id
  • scm_id
  • webhook_id
  • payload_id
  • address_id

@plyr4
Copy link
Contributor

plyr4 commented Mar 9, 2022

i kind of like delivery_id to be less ambiguous with "hook"

edit: i like webhook_id most, added "web" makes it easier to read than hook

Copy link
Contributor

@jbrockopp jbrockopp left a comment

Choose a reason for hiding this comment

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

LGTM

@ecrupper ecrupper merged commit 94648e7 into master Mar 28, 2022
@ecrupper ecrupper deleted the i459/add-hook-id branch March 28, 2022 14:52
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.

None yet

4 participants