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

EVEREST-107 | API server code refactor & RBAC unit tests #896

Draft
wants to merge 69 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
698928d
move from api to internal/server
mayankshah1607 Nov 29, 2024
db27989
wip: handlers
mayankshah1607 Dec 4, 2024
e762058
wip: rbac handler
mayankshah1607 Dec 4, 2024
c902c02
wip
mayankshah1607 Dec 4, 2024
d96d714
wip
mayankshah1607 Dec 4, 2024
0fb6a1d
implement rbac handler
mayankshah1607 Dec 9, 2024
ef1c141
k8s handler wip
mayankshah1607 Dec 9, 2024
9005c5c
update consts
mayankshah1607 Dec 9, 2024
5042c8d
update k8s client
mayankshah1607 Dec 9, 2024
5b013a4
wip: k8s handler
mayankshah1607 Dec 9, 2024
2875063
update go mod
mayankshah1607 Dec 9, 2024
cb0bbdc
wip: finishing k8s handler
mayankshah1607 Dec 9, 2024
d815524
update k8s interface
mayankshah1607 Dec 9, 2024
41e7957
finishing k8s handler
mayankshah1607 Dec 9, 2024
53202fa
wip: validate handler
mayankshah1607 Dec 9, 2024
ba690ea
wip: validations
mayankshah1607 Dec 10, 2024
275e6f8
implement validator handlers
mayankshah1607 Dec 10, 2024
b5319b7
wip: refactor server
mayankshah1607 Dec 10, 2024
d70cf1a
finishing refactor
mayankshah1607 Dec 10, 2024
3685ea4
minor bugs
mayankshah1607 Dec 10, 2024
6c92744
add mock handler
mayankshah1607 Dec 10, 2024
c3301ad
formatting
mayankshah1607 Dec 10, 2024
6e7b7f3
update error handler
mayankshah1607 Dec 10, 2024
f6117d1
make fileadapter generic
mayankshah1607 Dec 10, 2024
034305c
Add test for ListBackupStorages
mayankshah1607 Dec 10, 2024
c052d5e
update rbac tests
mayankshah1607 Dec 10, 2024
719a48d
linting
mayankshah1607 Dec 11, 2024
930278b
go mod tidy
mayankshah1607 Dec 11, 2024
2f4d583
update tiltfile
mayankshah1607 Dec 11, 2024
097d789
fix error handling
mayankshah1607 Dec 11, 2024
ac2ad63
update test
mayankshah1607 Dec 11, 2024
c5f9feb
update error handling
mayankshah1607 Dec 11, 2024
bac95cc
fix tests
mayankshah1607 Dec 11, 2024
10e2969
fix tests
mayankshah1607 Dec 11, 2024
8c9eb52
linting and code clean-up
mayankshah1607 Dec 11, 2024
22cf6ab
fix restore tests
mayankshah1607 Dec 11, 2024
3919cb6
add back unit tests
mayankshah1607 Dec 12, 2024
a832f87
centralized error handling + add logging
mayankshah1607 Dec 12, 2024
08023cc
resolve conflict
mayankshah1607 Dec 12, 2024
aed9007
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 16, 2024
8822903
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 16, 2024
ab39f7c
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 18, 2024
2948e43
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 19, 2024
e3a65dd
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 25, 2024
49e5421
go mod tidy
mayankshah1607 Dec 25, 2024
41899a2
wip: migrating unit tests
mayankshah1607 Dec 25, 2024
05da02a
update go mod
mayankshah1607 Dec 25, 2024
02e3513
migrate validation tests
mayankshah1607 Dec 26, 2024
f0a7a43
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 26, 2024
2d6ffbc
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 30, 2024
c23d786
Update internal/server/handlers/validation/handler.go
mayankshah1607 Dec 31, 2024
ae7256c
check monitoring config in use before deletion
mayankshah1607 Dec 31, 2024
aa2b9df
fix tests
mayankshah1607 Dec 31, 2024
6844006
remove newline
mayankshah1607 Dec 31, 2024
e9a983e
remove index.html
mayankshah1607 Dec 31, 2024
02d0b61
consistent import naming
mayankshah1607 Dec 31, 2024
cdb43b3
move code to kubernetes.go
mayankshah1607 Dec 31, 2024
c95c554
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 31, 2024
d0251ae
update dev chart
mayankshah1607 Dec 31, 2024
60004a8
add dist
mayankshah1607 Dec 31, 2024
b2d963e
remove redundant functions in monitoring instance validations
mayankshah1607 Dec 31, 2024
40a69d9
split validation_test.go
mayankshah1607 Dec 31, 2024
f0c1899
fix validation
mayankshah1607 Dec 31, 2024
f406c3b
fix tests: use configmap adapter
mayankshah1607 Dec 31, 2024
416a450
use consistent naming
mayankshah1607 Dec 31, 2024
bf87804
fix error types
mayankshah1607 Dec 31, 2024
6a9997e
remove todo comment
mayankshah1607 Dec 31, 2024
3b9f7b4
add engine RBAC in create database cluster call
mayankshah1607 Dec 31, 2024
39d8a6c
Merge branch 'main' into EVEREST-107-api-refactoring
mayankshah1607 Dec 31, 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
2 changes: 1 addition & 1 deletion api-tests/tests/backup-storages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ test('create backup storage failures', async ({request}) => {
secretKey: 'ssdssdssdssd',
allowedNamespaces: [testsNs]
},
errorText: 'Region is required',
errorText: 'region is required',
},
{
payload: {
Expand Down
2 changes: 1 addition & 1 deletion api-tests/tests/database-cluster-backups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test('dbcluster not found', async ({ request, page }) => {
})

expect(response.status()).toBe(400)
expect(await response.text()).toContain('{"message":"Database cluster not-existing-cluster does not exist"}')
expect(await response.text()).toContain('database cluster not-existing-cluster does not exist')

await th.deleteBackupStorage(page, request, bsName, testsNs)
})
Expand Down
6 changes: 3 additions & 3 deletions api-tests/tests/database-cluster-restores.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ test('create/update/delete database cluster restore', async ({ request, page })
data: restore,
})
expect(response.status()).toBe(400)
expect(await response.text()).toContain('{"message":"Database cluster not-existing-cluster does not exist"}')
expect(await response.text()).toContain('database cluster not-existing-cluster does not exist')

// delete restore
await request.delete(`/v1/namespaces/${testsNs}/database-cluster-restores/${restoreName}`)
Expand Down Expand Up @@ -194,7 +194,7 @@ test('create restore: validation errors', async ({ request, page }) => {
})

expect(response.status()).toBe(400)
expect(await response.text()).toContain('{"message":"Database cluster not-existing-cluster does not exist"}')
expect(await response.text()).toContain('database cluster not-existing-cluster does not exist')

// empty spec
const payloadEmptySpec = {
Expand All @@ -209,7 +209,7 @@ test('create restore: validation errors', async ({ request, page }) => {
data: payloadEmptySpec,
})
expect(response.status()).toBe(400)
expect(await response.text()).toContain('{"message":".spec cannot be empty"}')
expect(await response.text()).toContain('spec.dataSource.dbClusterBackupName cannot be empty')

await th.deleteBackup(page, request, backupName)
await th.deleteDBCluster(request, page, clName)
Expand Down
4 changes: 2 additions & 2 deletions api-tests/tests/monitoring-instances.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ test('delete monitoring instance', async ({ request, page }) => {
await checkError(response)

// list of the monitoring-instances is not updated immediately, there is some kind of cache
await page.waitForTimeout(500)
await page.waitForTimeout(1000)

response = await request.get(`/v1/namespaces/${testsNs}/monitoring-instances`)
await checkError(response)
Expand Down Expand Up @@ -239,7 +239,7 @@ test('patch monitoring instance type fails on missing key', async ({ request, pa

const getJson = await updated.json()

expect(getJson.message).toMatch('Pmm key is required')
expect(getJson.message).toMatch('pmm key is required')
await deleteInstances(request, prefix)
})

Expand Down
Loading
Loading