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

refactor(build)!: move build from types and nest the object #1111

Merged
merged 9 commits into from
Apr 24, 2024

Conversation

ecrupper
Copy link
Contributor

@ecrupper ecrupper commented Apr 18, 2024

Follow up from #1106, #1095, and #997

Of note:

  • Migrated the inline types for database resources (i.e. type Build struct inside database/build/build.go) to a database/types package. This was sad but necessary due to import cycles when attempting to leverage Gorm SQL migration in the tests.
  • Created a testutils/api_resources.go file. This was to prevent the duplication of API object instantiation that existed across the database package for testing.
  • continued to prune cases where we only brought in the repo object because it had info tied to a build we wouldn't have had previously. Notable exception is compiler engine because we can compile without a build.
  • ListBuildsForDashboardRepo does not include repo preloading because I didn't see the point. Would not mind changing that if someone preferred it.

database/service/get_build.go Show resolved Hide resolved
api/webhook/post.go Show resolved Hide resolved
Copy link

codecov bot commented Apr 18, 2024

Codecov Report

Attention: Patch coverage is 91.03068% with 114 lines in your changes are missing coverage. Please review.

Project coverage is 67.75%. Comparing base (71bfd94) to head (30627be).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1111      +/-   ##
==========================================
+ Coverage   65.97%   67.75%   +1.77%     
==========================================
  Files         383      391       +8     
  Lines       12310    13035     +725     
==========================================
+ Hits         8122     8832     +710     
- Misses       3666     3696      +30     
+ Partials      522      507      -15     
Files Coverage Δ
api/build/restart.go 0.00% <ø> (ø)
api/types/executor.go 100.00% <100.00%> (ø)
api/types/queue_build.go 100.00% <100.00%> (ø)
api/types/worker.go 100.00% <100.00%> (ø)
compiler/native/compile.go 71.63% <100.00%> (ø)
compiler/native/environment.go 85.71% <100.00%> (ø)
compiler/native/native.go 87.95% <100.00%> (ø)
database/build/build.go 52.63% <ø> (ø)
database/build/clean.go 100.00% <100.00%> (ø)
database/build/delete.go 100.00% <100.00%> (ø)
... and 78 more

@ecrupper ecrupper marked this pull request as ready for review April 22, 2024 20:31
@ecrupper ecrupper requested a review from a team as a code owner April 22, 2024 20:31
Copy link
Collaborator

@wass3r wass3r left a comment

Choose a reason for hiding this comment

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

nice. some minor things. tested locally with WIP branches in sdk-go + worker. will need some tweak in UI to be able to parse new response, but looks good otherwise.

ListBuildsForDashboardRepo does not include repo preloading because I didn't see the point. Would not mind changing that if someone preferred it.

tripped me up at first, but i think it makes sense the way it is

api/build/auto_cancel.go Show resolved Hide resolved
database/build/build.go Outdated Show resolved Hide resolved
database/build/get.go Outdated Show resolved Hide resolved
mock/server/build.go Show resolved Hide resolved
wass3rw3rk
wass3rw3rk previously approved these changes Apr 24, 2024
@wass3rw3rk wass3rw3rk dismissed their stale review April 24, 2024 14:41

using wass3r

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.

4 participants