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

enhance(repo)!: add topics field to build env and repo #807

Merged
merged 19 commits into from
Apr 17, 2023

Conversation

ecrupper
Copy link
Contributor

@ecrupper ecrupper commented Apr 6, 2023

Closes go-vela/community#774

Adds topics to build env and repo object. Dependent on go-vela/types#285

I noticed that we utilize GetRepoForOrg twice in the PostWebhook function even though we do not update the repo object at all between those two calls. Therefore, I decided to remove the second DB call.

I also took the liberty of abstracting repository event handling in our webhook API func. I saw it as very messy and distracting (it's ok to say that because I wrote it)

I wanted to retroactively adjust repos that have been enabled prior to this change by adding a topics setter call to Repo.Topics in the scm/github/webhook.go process functions. The go-github library only has Topics available for events other than push: google/go-github#2742. Once there is another release, we can add this same functionality to push events.

@ecrupper ecrupper self-assigned this Apr 6, 2023
@ecrupper ecrupper changed the title enhance(repo): add topics field to build env and repo enhance(repo)!: add topics field to build env and repo Apr 7, 2023
@ecrupper ecrupper marked this pull request as ready for review April 7, 2023 17:15
@ecrupper ecrupper requested a review from a team as a code owner April 7, 2023 17:15
@codecov
Copy link

codecov bot commented Apr 7, 2023

Codecov Report

Merging #807 (e43b59f) into main (f37d973) will decrease coverage by 0.13%.
The diff coverage is 3.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #807      +/-   ##
==========================================
- Coverage   57.91%   57.79%   -0.13%     
==========================================
  Files         263      263              
  Lines       15862    15908      +46     
==========================================
+ Hits         9187     9194       +7     
- Misses       6261     6300      +39     
  Partials      414      414              
Impacted Files Coverage Δ
api/webhook.go 0.00% <0.00%> (ø)
database/repo/table.go 100.00% <ø> (ø)
scm/github/repo.go 76.42% <100.00%> (+0.05%) ⬆️
scm/github/webhook.go 86.30% <100.00%> (+0.20%) ⬆️

api/webhook.go Outdated Show resolved Hide resolved
api/webhook.go Outdated Show resolved Hide resolved
Co-authored-by: dave vader <[email protected]>
plyr4
plyr4 previously approved these changes Apr 14, 2023
api/webhook.go Outdated Show resolved Hide resolved
api/webhook.go Outdated Show resolved Hide resolved
api/webhook.go Outdated Show resolved Hide resolved
api/webhook.go Outdated Show resolved Hide resolved
api/webhook.go Show resolved Hide resolved
wass3rw3rk
wass3rw3rk previously approved these changes Apr 14, 2023
Copy link
Member

@wass3rw3rk wass3rw3rk left a comment

Choose a reason for hiding this comment

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

thanks

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.

Make repository topics/tags accessible in builds
3 participants