server
server copied to clipboard
feat(api/build): add endpoint to get build by id
Getting build by ID will be very helpful in a number of ways, but the reason at the top of mind is using this endpoint to retrieve a build that corresponds with a hook on the hooks page in the UI.
One endpoint is for users who have at least read
access to the repo in question, and the other is for admins which bypasses that repo check.
Part of the effort for https://github.com/go-vela/community/issues/610 as well.
Codecov Report
Merging #646 (af2a9d0) into main (09e827e) will decrease coverage by
0.07%
. The diff coverage is41.30%
.
@@ Coverage Diff @@
## main #646 +/- ##
==========================================
- Coverage 54.66% 54.59% -0.08%
==========================================
Files 216 216
Lines 16086 16178 +92
==========================================
+ Hits 8794 8832 +38
- Misses 6908 6962 +54
Partials 384 384
Impacted Files | Coverage Δ | |
---|---|---|
api/build.go | 1.56% <0.00%> (-0.08%) |
:arrow_down: |
database/postgres/hook.go | 92.59% <ø> (ø) |
|
database/sqlite/hook.go | 92.59% <ø> (ø) |
|
database/postgres/build.go | 95.86% <100.00%> (+0.62%) |
:arrow_up: |
database/sqlite/build.go | 95.86% <100.00%> (+0.62%) |
:arrow_up: |
Yeah, I'm not really sure why I chose write
. I think complete parity with the current form of getting a build is the way we want to go. I'll change that now