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

chore(UI): downsizing overview #2052

Merged
merged 119 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
b7d991a
channels
miguel-crespo-fdc Oct 10, 2024
66a3b82
PRogress on new endpoint
miguel-crespo-fdc Oct 11, 2024
f0f465d
Adapt rollout service for new app details
miguel-crespo-fdc Oct 14, 2024
aedf591
lint
miguel-crespo-fdc Oct 14, 2024
b57c420
linter
miguel-crespo-fdc Oct 14, 2024
2936020
Merge branch 'main' into mc/new-endpoint-rollout
miguel-crespo-fdc Oct 14, 2024
8bed2c5
remove repo metadata
miguel-crespo-fdc Oct 14, 2024
337e7e8
Merge branch 'mc/new-endpoint-rollout' of github.com:freiheit-com/kub…
miguel-crespo-fdc Oct 14, 2024
c8bbcac
team
miguel-crespo-fdc Oct 14, 2024
9ea51a6
final touches
miguel-crespo-fdc Oct 14, 2024
a42bc74
self PR review
miguel-crespo-fdc Oct 14, 2024
5f2773e
self review PR
miguel-crespo-fdc Oct 14, 2024
d68f2c9
reduce noise
miguel-crespo-fdc Oct 14, 2024
f8ccc9e
changed apps
miguel-crespo-fdc Oct 14, 2024
e40c48e
reducing noise
miguel-crespo-fdc Oct 14, 2024
cfad517
noise
miguel-crespo-fdc Oct 14, 2024
4a65847
Merge branch 'main' into mc/new-endpoint-rollout
miguel-crespo-fdc Oct 14, 2024
b6bb4bf
feat: new endpoint to get app details
sven-urbanski-freiheit-com Oct 2, 2024
60451a9
New endpoint
miguel-crespo-fdc Oct 3, 2024
c2acea9
small change to test
miguel-crespo-fdc Oct 3, 2024
f2d5c9b
Unit tests
miguel-crespo-fdc Oct 4, 2024
6b65d49
cleanup
miguel-crespo-fdc Oct 4, 2024
fe9402c
commit_deployments
miguel-crespo-fdc Oct 4, 2024
511b37a
rollout tests
miguel-crespo-fdc Oct 4, 2024
2f4d5db
redo sql, needs to get back locks by env, as group locks would be mer…
miguel-crespo-fdc Oct 7, 2024
bdd0727
start of ui changes
miguel-crespo-fdc Oct 3, 2024
6512478
docker compose
miguel-crespo-fdc Oct 3, 2024
453320f
no update
miguel-crespo-fdc Oct 8, 2024
42bfaa0
better no update
miguel-crespo-fdc Oct 8, 2024
a13fbba
Frontend implementation, missing tests
miguel-crespo-fdc Oct 10, 2024
88dc38d
restore files
miguel-crespo-fdc Oct 10, 2024
c7c5fb1
service lane tests
miguel-crespo-fdc Oct 10, 2024
cadee1a
trying to fix tests
miguel-crespo-fdc Oct 10, 2024
65aaed9
compiles
miguel-crespo-fdc Oct 14, 2024
4a0fdbe
Merge branch 'main' into mc/new-endpoint-rollout
miguel-crespo-fdc Oct 15, 2024
7e38be7
fixing UI tests
miguel-crespo-fdc Oct 15, 2024
f2a5b51
fixed tests
miguel-crespo-fdc Oct 15, 2024
d537166
pnpm
miguel-crespo-fdc Oct 15, 2024
0198524
warnings are compiling
miguel-crespo-fdc Oct 15, 2024
fb0f89c
Warnings are sort-of reactive
miguel-crespo-fdc Oct 16, 2024
754a387
Warnings are now reactive
miguel-crespo-fdc Oct 16, 2024
d25b806
style
miguel-crespo-fdc Oct 16, 2024
49be624
Merge branch 'main' into mc/app-details-ui
miguel-crespo-fdc Oct 16, 2024
808f58b
PR Concerns
miguel-crespo-fdc Oct 16, 2024
f68eca1
Merge branch 'mc/new-endpoint-rollout' of github.com:freiheit-com/kub…
miguel-crespo-fdc Oct 16, 2024
167a0fa
Flakeyness
miguel-crespo-fdc Oct 16, 2024
fa5d972
spinner margin
miguel-crespo-fdc Oct 16, 2024
d388041
Merge branch 'mc/app-details-ui' of github.com:freiheit-com/kuberpult…
miguel-crespo-fdc Oct 16, 2024
7309fcf
Merge branch 'main' into mc/new-endpoint-rollout
miguel-crespo-fdc Oct 16, 2024
d7a3698
revert
miguel-crespo-fdc Oct 16, 2024
14b80f7
Merge branch 'mc/new-endpoint-rollout' of github.com:freiheit-com/kub…
miguel-crespo-fdc Oct 16, 2024
e9946da
more overview tests
miguel-crespo-fdc Oct 16, 2024
237571f
more flakeyness
miguel-crespo-fdc Oct 16, 2024
d187236
Merge branch 'main' into mc/new-endpoint-rollout
miguel-crespo-fdc Oct 16, 2024
6356ae3
Merge branch 'main' into mc/app-details-ui
miguel-crespo-fdc Oct 16, 2024
66123ac
Fixed broken tests
miguel-crespo-fdc Oct 16, 2024
e74c19b
Merge branch 'mc/app-details-ui' of github.com:freiheit-com/kuberpult…
miguel-crespo-fdc Oct 16, 2024
2b4f0c0
linter and flakeyness
miguel-crespo-fdc Oct 16, 2024
eb38285
removing top level app
miguel-crespo-fdc Oct 16, 2024
ddfd0a9
PR concerns from Hannes
miguel-crespo-fdc Oct 16, 2024
989b26e
merge with origin
miguel-crespo-fdc Oct 16, 2024
4b3d49b
rename lightweight apps fields
miguel-crespo-fdc Oct 17, 2024
24e54fb
Merge branch 'main' into mc/app-details-ui
miguel-crespo-fdc Oct 17, 2024
3177198
restore applications
miguel-crespo-fdc Oct 17, 2024
0666ebb
Merge branch 'mc/app-details-ui' of github.com:freiheit-com/kuberpult…
miguel-crespo-fdc Oct 17, 2024
3f47200
remove unecessary changes
miguel-crespo-fdc Oct 17, 2024
179cd87
revert faulty merge
miguel-crespo-fdc Oct 17, 2024
bff3332
more reverts
miguel-crespo-fdc Oct 17, 2024
dd0c11e
final reverts
miguel-crespo-fdc Oct 17, 2024
715050d
lint
miguel-crespo-fdc Oct 17, 2024
f76e545
overview
miguel-crespo-fdc Oct 17, 2024
3e8396a
merge with main
miguel-crespo-fdc Oct 17, 2024
61ba666
remove noise
miguel-crespo-fdc Oct 17, 2024
d0b37b7
grpc call success
miguel-crespo-fdc Oct 17, 2024
79d46bb
noise
miguel-crespo-fdc Oct 17, 2024
4581f1c
Update services/frontend-service/src/ui/components/ServiceLane/Servic…
miguel-crespo-fdc Oct 21, 2024
5adedfc
PR concerns
miguel-crespo-fdc Oct 21, 2024
55bf369
Merge branch 'mc/app-details-ui' of github.com:freiheit-com/kuberpult…
miguel-crespo-fdc Oct 21, 2024
f73ee6d
test
miguel-crespo-fdc Oct 21, 2024
59038c6
imports
miguel-crespo-fdc Oct 21, 2024
7695127
prettier
miguel-crespo-fdc Oct 21, 2024
8d06ed4
Merge branch 'main' into mc/app-details-ui
miguel-crespo-fdc Oct 21, 2024
0d5bf7c
sort on server side
miguel-crespo-fdc Oct 21, 2024
0f8566f
Merge branch 'mc/app-details-ui' of github.com:freiheit-com/kuberpult…
miguel-crespo-fdc Oct 21, 2024
2e5d3c5
Sort in backend
miguel-crespo-fdc Oct 21, 2024
8c60456
Merge branch 'main' into mc/app-details-ui
miguel-crespo-fdc Oct 21, 2024
eef9cfc
Update pkg/api/v1/api.proto
miguel-crespo-fdc Oct 21, 2024
08763e2
flakey
miguel-crespo-fdc Oct 21, 2024
3bb186b
Merge branch 'mc/app-details-ui' of github.com:freiheit-com/kuberpult…
miguel-crespo-fdc Oct 21, 2024
d980ab0
restore test
miguel-crespo-fdc Oct 21, 2024
8f25074
removed top level app and fixed version caching
miguel-crespo-fdc Oct 17, 2024
b72ce75
remove unused
miguel-crespo-fdc Oct 17, 2024
7e4fd17
fix compilation issues
miguel-crespo-fdc Oct 17, 2024
f8cd260
adding taem and app locks to the environment
miguel-crespo-fdc Oct 17, 2024
385017d
locks now use the general locks
miguel-crespo-fdc Oct 17, 2024
117c6e0
fixed getting al locks
miguel-crespo-fdc Oct 17, 2024
16cbbdf
first steps to delete env app
miguel-crespo-fdc Oct 18, 2024
003ed37
Removed Environment Application. Fixed frontend tests
miguel-crespo-fdc Oct 21, 2024
2d72258
fixed cd service tests
miguel-crespo-fdc Oct 21, 2024
f46080b
fixed pkg tests
miguel-crespo-fdc Oct 21, 2024
f32fe5b
fixed date issues
miguel-crespo-fdc Oct 21, 2024
05b2d9e
fix argo tets
miguel-crespo-fdc Oct 21, 2024
7efc6b8
mapper tests
miguel-crespo-fdc Oct 21, 2024
35552b0
tagged story reference to fix tests
miguel-crespo-fdc Oct 21, 2024
a925b0f
unused code
miguel-crespo-fdc Oct 22, 2024
ce5a86d
Fix after rebase
miguel-crespo-fdc Oct 22, 2024
c2efef2
merge with main
miguel-crespo-fdc Oct 22, 2024
135a0d0
removed duplicate
miguel-crespo-fdc Oct 22, 2024
92e6914
adapted get app summary
miguel-crespo-fdc Oct 22, 2024
0e32e9d
flakey test again...
miguel-crespo-fdc Oct 22, 2024
819f469
trying to resolve flakeyness
miguel-crespo-fdc Oct 22, 2024
be1b80f
grpc call success
miguel-crespo-fdc Oct 22, 2024
d0103ac
linter
miguel-crespo-fdc Oct 22, 2024
eb9c40f
Self review PR concerns
miguel-crespo-fdc Oct 22, 2024
fb259cc
moving tests
miguel-crespo-fdc Oct 22, 2024
6a58379
Update services/cd-service/pkg/service/overview_test.go
miguel-crespo-fdc Oct 22, 2024
085a355
PR concerns
miguel-crespo-fdc Oct 22, 2024
486dd53
Merge branch 'mc/overview-diet' of github.com:freiheit-com/kuberpult …
miguel-crespo-fdc Oct 22, 2024
ee8dd0a
remove unused
miguel-crespo-fdc Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 3 additions & 36 deletions pkg/api/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ message OverviewApplication {
}

message GetOverviewResponse {
map<string, Application> applications = 2;
repeated EnvironmentGroup environment_groups = 3;
string git_revision = 4;
string branch = 5;
Expand Down Expand Up @@ -563,45 +562,13 @@ message UpstreamNotDeployed {
}

message Environment {

message Application {
message ArgoCD {
message SyncWindow {
string kind = 1; // "allow" or "deny"
string schedule = 2; // crontab format
string duration = 3; // duration the window is open (or closed)
}
repeated SyncWindow sync_windows = 1;
}
message DeploymentMetaData {
string deploy_author = 1;
// we use a string here, because the UI cannot handle int64 as a type.
// the string contains the unix timestamps in seconds (utc)
string deploy_time = 2;
}

string name = 1;
// version=0 means "nothing is deployed"
uint64 version = 2;
map<string, Lock> locks = 3;
// "version" describes the currently deployed version. "queuedVersion" describes a version that was to be deployed, but a lock stopped the deployment:
// "queuedVersion" has nothing to do with queue.go
// queued_version=0 means "nothing is queued"
uint64 queued_version = 4;
// google.protobuf.Timestamp deploy_date = 5; // This is never used
bool undeploy_version = 6;
ArgoCD argo_cd = 7;
DeploymentMetaData deployment_meta_data = 8;
map<string, Lock> team_locks = 9; //Keep in mind that team lock information will be duplicated if there is a team with more than one application (which is usually the case)
string team = 10;
}

string name = 1;
EnvironmentConfig config = 2;
map<string, Lock> locks = 3;
map<string, Application> applications = 4;
map<string, Lock> locks = 3; //Environment Locks. Lock ID -> Lock
uint32 distance_to_upstream = 5;
Priority priority = 6;
map<string, Locks> app_locks = 7; //Application Locks. AppName -> []Locks
map<string, Locks> team_locks = 8; //Team Locks. TeamName -> []Locks
}

message Release {
Expand Down
11 changes: 5 additions & 6 deletions pkg/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -1120,10 +1120,7 @@ func (h *DBHandler) DBInsertRelease(ctx context.Context, transaction *sql.Tx, re
previousEslVersion+1,
err)
}
err = h.UpdateOverviewRelease(ctx, transaction, release)
if err != nil {
return err
}

logger.FromContext(ctx).Sugar().Infof(
"inserted release: app '%s' and version '%v' and eslVersion %v",
release.App,
Expand Down Expand Up @@ -1979,7 +1976,10 @@ func processAllLatestDeploymentsForApp(rows *sql.Rows) (map[string]Deployment, e
}
return nil, fmt.Errorf("Error scanning deployments row from DB. Error: %w\n", err)
}

err = json.Unmarshal(([]byte)(jsonMetadata), &curr.Metadata)
if err != nil {
return nil, fmt.Errorf("Error during json unmarshal in deployments. Error: %w. Data: %s\n", err, jsonMetadata)
}
miguel-crespo-fdc marked this conversation as resolved.
Show resolved Hide resolved
if releaseVersion.Valid {
curr.Version = &releaseVersion.Int64
}
Expand Down Expand Up @@ -5661,7 +5661,6 @@ func (h *DBHandler) ReadLatestOverviewCache(ctx context.Context, transaction *sq
result := &api.GetOverviewResponse{
Branch: "",
ManifestRepoUrl: "",
Applications: map[string]*api.Application{},
LightweightApps: []*api.OverviewApplication{},
EnvironmentGroups: []*api.EnvironmentGroup{},
GitRevision: "",
Expand Down
159 changes: 88 additions & 71 deletions pkg/db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"go.uber.org/zap"
"google.golang.org/protobuf/types/known/timestamppb"
)

type errMatcher struct {
Expand Down Expand Up @@ -2578,7 +2577,7 @@ func TestReadWriteOverviewCache(t *testing.T) {
Name string
Overviews []*api.GetOverviewResponse
}

//TODO: This test suite has some commented out sections. These should be resolved in Ref: SRX-9PBRYS.
tcs := []TestCase{
{
Name: "Read and write",
Expand All @@ -2597,36 +2596,42 @@ func TestReadWriteOverviewCache(t *testing.T) {
Argocd: &api.EnvironmentConfig_ArgoCD{},
EnvironmentGroup: &dev,
},
Applications: map[string]*api.Environment_Application{
"test": {
Name: "test",
Version: 1,
DeploymentMetaData: &api.Environment_Application_DeploymentMetaData{
DeployAuthor: "[email protected]",
DeployTime: "1",
},
Team: "team-123",
},
},
//Applications: map[string]*api.Environment_Application{
// "test": {
// Name: "test",
// Version: 1,
// DeploymentMetaData: &api.Environment_Application_DeploymentMetaData{
// DeployAuthor: "[email protected]",
// DeployTime: "1",
// },
// Team: "team-123",
// },
//},
Priority: api.Priority_YOLO,
},
},
Priority: api.Priority_YOLO,
},
},
Applications: map[string]*api.Application{
"test": {
//Applications: map[string]*api.Application{
// "test": {
// Name: "test",
// Releases: []*api.Release{
// {
// Version: 1,
// SourceCommitId: "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
// SourceAuthor: "example <[email protected]>",
// SourceMessage: "changed something (#678)",
// PrNumber: "678",
// CreatedAt: &timestamppb.Timestamp{Seconds: 1, Nanos: 1},
// },
// },
// Team: "team-123",
// },
//},
LightweightApps: []*api.OverviewApplication{
{
Name: "test",
Releases: []*api.Release{
{
Version: 1,
SourceCommitId: "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
SourceAuthor: "example <[email protected]>",
SourceMessage: "changed something (#678)",
PrNumber: "678",
CreatedAt: &timestamppb.Timestamp{Seconds: 1, Nanos: 1},
},
},
Team: "team-123",
},
},
Expand All @@ -2651,36 +2656,42 @@ func TestReadWriteOverviewCache(t *testing.T) {
Argocd: &api.EnvironmentConfig_ArgoCD{},
EnvironmentGroup: &dev,
},
Applications: map[string]*api.Environment_Application{
"test": {
Name: "test",
Version: 1,
DeploymentMetaData: &api.Environment_Application_DeploymentMetaData{
DeployAuthor: "[email protected]",
DeployTime: "1",
},
Team: "team-123",
},
},
//Applications: map[string]*api.Environment_Application{
// "test": {
// Name: "test",
// Version: 1,
// DeploymentMetaData: &api.Environment_Application_DeploymentMetaData{
// DeployAuthor: "[email protected]",
// DeployTime: "1",
// },
// Team: "team-123",
// },
//},
Priority: api.Priority_YOLO,
},
},
Priority: api.Priority_YOLO,
},
},
Applications: map[string]*api.Application{
"test": {
//Applications: map[string]*api.Application{
// "test": {
// Name: "test",
// Releases: []*api.Release{
// {
// Version: 1,
// SourceCommitId: "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
// SourceAuthor: "example <[email protected]>",
// SourceMessage: "changed something (#678)",
// PrNumber: "678",
// CreatedAt: &timestamppb.Timestamp{Seconds: 1, Nanos: 1},
// },
// },
// Team: "team-123",
// },
//},
LightweightApps: []*api.OverviewApplication{
{
Name: "test",
Releases: []*api.Release{
{
Version: 1,
SourceCommitId: "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
SourceAuthor: "example <[email protected]>",
SourceMessage: "changed something (#678)",
PrNumber: "678",
CreatedAt: &timestamppb.Timestamp{Seconds: 1, Nanos: 1},
},
},
Team: "team-123",
},
},
Expand All @@ -2700,36 +2711,42 @@ func TestReadWriteOverviewCache(t *testing.T) {
Argocd: &api.EnvironmentConfig_ArgoCD{},
EnvironmentGroup: &dev,
},
Applications: map[string]*api.Environment_Application{
"test2": {
Name: "test2",
Version: 1,
DeploymentMetaData: &api.Environment_Application_DeploymentMetaData{
DeployAuthor: "[email protected]",
DeployTime: "1",
},
Team: "team-123",
},
},
//Applications: map[string]*api.Environment_Application{
// "test2": {
// Name: "test2",
// Version: 1,
// DeploymentMetaData: &api.Environment_Application_DeploymentMetaData{
// DeployAuthor: "[email protected]",
// DeployTime: "1",
// },
// Team: "team-123",
// },
//},
Priority: api.Priority_CANARY,
},
},
Priority: api.Priority_CANARY,
},
},
Applications: map[string]*api.Application{
"test2": {
//Applications: map[string]*api.Application{
// "test2": {
// Name: "test2",
// Releases: []*api.Release{
// {
// Version: 1,
// SourceCommitId: "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
// SourceAuthor: "example <[email protected]>",
// SourceMessage: "changed something (#678)",
// PrNumber: "678",
// CreatedAt: &timestamppb.Timestamp{Seconds: 1, Nanos: 1},
// },
// },
// Team: "team-123",
// },
//},
LightweightApps: []*api.OverviewApplication{
{
Name: "test2",
Releases: []*api.Release{
{
Version: 1,
SourceCommitId: "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef",
SourceAuthor: "example <[email protected]>",
SourceMessage: "changed something (#678)",
PrNumber: "678",
CreatedAt: &timestamppb.Timestamp{Seconds: 1, Nanos: 1},
},
},
Team: "team-123",
},
},
Expand Down
Loading
Loading