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(deployment): add deployment table #323

Merged
merged 18 commits into from
Dec 22, 2023
Merged

Conversation

claire1618
Copy link
Contributor

When a repo has a lot of deployments historically, viewing them in the UI is cumbersome and slow.

The loading of deployments on the deployments tab in Vela takes a few more seconds to load than the other pages (schedules, secrets, audits...) even when there are no deployments for a repo. This is due to the way deployments are stored and retrieved.

The changes made in this pull request add a new database table so that we can store deployment information instead of having to go to the scm to retrieve them. This (plus the implementation in server) greatly improve the time it takes for the deployments page to load.

@claire1618 claire1618 requested a review from a team as a code owner October 2, 2023 19:50
@claire1618 claire1618 added the v0.22.0 Content slotted for v0.22.0 release label Oct 2, 2023
database/deployment.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (1eae2f5) 96.12% compared to head (41884d1) 96.20%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #323      +/-   ##
==========================================
+ Coverage   96.12%   96.20%   +0.07%     
==========================================
  Files          67       68       +1     
  Lines        7229     7370     +141     
==========================================
+ Hits         6949     7090     +141     
  Misses        205      205              
  Partials       75       75              
Files Coverage Δ
database/build.go 100.00% <100.00%> (ø)
database/deployment.go 100.00% <100.00%> (ø)
library/build.go 100.00% <100.00%> (ø)
webhook.go 100.00% <ø> (ø)
library/deployment.go 96.21% <93.61%> (+0.67%) ⬆️

@wass3rw3rk
Copy link
Member

release and other merges caused some conflicts, so you'll have to resolve that first

@wass3rw3rk wass3rw3rk changed the title Feat/deployment table feat(deployment): add deployment table Oct 6, 2023
@wass3rw3rk
Copy link
Member

wass3rw3rk commented Oct 6, 2023

also, we will want to add tests in /database

library/hook_test.go Outdated Show resolved Hide resolved
library/hook_test.go Outdated Show resolved Hide resolved
database/deployment.go Outdated Show resolved Hide resolved
timhuynh94
timhuynh94 previously approved these changes Dec 19, 2023
database/deployment.go Outdated Show resolved Hide resolved
Copy link
Contributor

@ecrupper ecrupper left a comment

Choose a reason for hiding this comment

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

A few random things I noticed + thoughts on giving library.Deployment its own Environment() method? I can imagine that could be useful to some users.

constants/table.go Outdated Show resolved Hide resolved
database/build.go Outdated Show resolved Hide resolved
database/build.go Outdated Show resolved Hide resolved
database/deployment.go Outdated Show resolved Hide resolved
database/deployment_test.go Outdated Show resolved Hide resolved
database/deployment_test.go Outdated Show resolved Hide resolved
library/build.go Outdated Show resolved Hide resolved
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.

one suggestion.. got a little confused with ID and Number 😵‍💫 let me know what you think - looks like Easton mentioned this also :disappear:

library/build.go Outdated Show resolved Hide resolved
library/build_test.go Show resolved Hide resolved
library/build_test.go Show resolved Hide resolved
Copy link
Contributor

@plyr4 plyr4 left a comment

Choose a reason for hiding this comment

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

looks great.

RepoID *int64 `json:"repo_id,omitempty"`
URL *string `json:"url,omitempty"`
User *string `json:"user,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious, why'd we remove User?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because I added a CreatedBy field instead

Copy link
Contributor

@KellyMerrick KellyMerrick left a comment

Choose a reason for hiding this comment

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

lgtm

@claire1618 claire1618 merged commit 26e54c8 into main Dec 22, 2023
10 checks passed
@claire1618 claire1618 deleted the feat/deploymentTable branch December 22, 2023 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.22.0 Content slotted for v0.22.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants