-
Notifications
You must be signed in to change notification settings - Fork 0
release manager recover my testing environment
Cesar Celis Hernandez edited this page Jun 13, 2023
·
12 revisions
To recover my testing environment and recover the context.
- En el navegador abre el Repositorio por si lo necesitas, esta en la primer tab de tus favoritos:
- Ve a tu repo en donde tienes tu PR para el BE:
cd /Users/cniackz/release-manager
git rev-parse --abbrev-ref HEAD
La PR se llama:
$ git rev-parse --abbrev-ref HEAD
add-ui-4-enterprise-2
- Comienza por construir el binario:
cd /Users/cniackz/release-manager
make build
El binario se crea:
$ ls -all release-manager
-rwxr-xr-x 1 cniackz staff 39870866 9 May 13:53 release-manager
- Ahora abre IntelliJ, en el proyecto de release-manager
![Screenshot 2023-05-09 at 2 00 11 PM](https://private-user-images.githubusercontent.com/6667358/237181012-e6dafda0-355b-4677-99e9-f2fb0d3b2bdc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxODM3ODYsIm5iZiI6MTcyNTE4MzQ4NiwicGF0aCI6Ii82NjY3MzU4LzIzNzE4MTAxMi1lNmRhZmRhMC0zNTViLTQ2NzctOTllOS1mMmZiMGQzYjJiZGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDFUMDkzODA2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YWE5NThlYzc5YmE5ZDRlMDQ2OTI5ZmQ5OTkwNzU0MGMxNThmYTFhOGE2YzFhNDgzMWVkN2NhMTBmNThkMTAzZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.sG5yR-zUnCrmSIDVjUQ-Gt-Tvi9dI0kPRoKNJbpW2kQ)
- Conectate a tu base de datos:
psql -h localhost -U postgres
Then connect to the DB:
\connect change-manager
\dt
- Ya que todo esta en su lugar, dale Debug o Play(Run) para que el servidor corra
GOROOT=/opt/homebrew/Cellar/go/1.20.3/libexec #gosetup
GOPATH=/Users/cniackz/go:/usr/local/go #gosetup
/opt/homebrew/Cellar/go/1.20.3/libexec/bin/go build -o /private/var/folders/zd/nyb3wq795xd33szx568z3tym0000gn/T/GoLand/___go_build_github_com_miniohq_change_manager_cmd_change_manager -gcflags all=-N -l . #gosetup
"/Users/cniackz/Library/Application Support/JetBrains/IntelliJIdea2022.1/plugins/go/lib/dlv/macarm/dlv" --listen=127.0.0.1:63127 --headless=true --api-version=2 --check-go-version=false --only-same-user=false exec /private/var/folders/zd/nyb3wq795xd33szx568z3tym0000gn/T/GoLand/___go_build_github_com_miniohq_change_manager_cmd_change_manager -- server
API server listening at: 127.0.0.1:63127
debugserver-@(#)PROGRAM:LLDB PROJECT:lldb-1403.0.17.64
for arm64.
Got a connection, launched process /private/var/folders/zd/nyb3wq795xd33szx568z3tym0000gn/T/GoLand/___go_build_github_com_miniohq_change_manager_cmd_change_manager (pid = 73598).
log: 2023/05/02 10:50:19 main.go:114: starting
Serving change manager at http://[::]:7676
- Luego abre la UI para ver el CURL u otras APIs:
cd /Users/cniackz/release-manager/web-app
yarn install
yarn start
- URL is: http://localhost:7007/login
- User is: daniel@min.io
- Password is: testing123
- Dado que estas probando el BE, con curl prueba la API que quieres agregar:
- You got this curl command from the Browser and changed the endpoint from release to enterprise:
curl 'http://localhost:7007/api/v1/enterprise?offset=0&filters=' \
-H 'Accept: */*' \
-H 'Accept-Language: en-CA,en-GB;q=0.9,en-US;q=0.8,en;q=0.7' \
-H 'Connection: keep-alive' \
-H 'Cookie: idp-refresh-token=; argocd.token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhcmdvY2QiLCJzdWIiOiJhZG1pbjpsb2dpbiIsImV4cCI6MTY4MTkyNzE2NSwibmJmIjoxNjgxODQwNzY1LCJpYXQiOjE2ODE4NDA3NjUsImp0aSI6IjJjNDYxNjY4LTI1NzgtNGFhYi1hM2QwLTkyNWUzNDQ0Mjc2MyJ9.47Npz1h9kJLpdU47daq5EcCdy4Lk_FZ1ceMbUBf2_mA; ChangeManager-token=a8ecd8b7-1b43-4359-823b-62a940a72afb' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
--compressed
- As a result you will hit the breakpoint if enabled:
- OR a result if breakpoint is disabled:
{"count":3,"results":[{"id":3,"name":"hernandez"},{"id":1,"name":"cesar"},{"id":2,"name":"celis"}]}
- Insert something in releases for testing:
INSERT INTO releases (id,name,tag_name,description,released,released_change_notes,repository) VALUES (1,'cesar','cesar','cesar','f','cesar','cesar');
It should look like this:
change-manager=# select * from releases;
-[ RECORD 1 ]---------+---------------------------
id | 1
name | cesar
tag_name | cesar
description | cesar
released | f
released_change_notes | cesar
repository | cesar
release_metadata |
github_id |
published_at |
sys_created | 2023-05-15 16:17:49.052566
sys_created_by |
sys_updated |
sys_updated_by |
And it should look like this:
![Screenshot 2023-05-15 at 4 19 17 PM](https://private-user-images.githubusercontent.com/6667358/238463966-f038698a-b848-46ef-a400-42314b717023.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUxODM3ODYsIm5iZiI6MTcyNTE4MzQ4NiwicGF0aCI6Ii82NjY3MzU4LzIzODQ2Mzk2Ni1mMDM4Njk4YS1iODQ4LTQ2ZWYtYTQwMC00MjMxNGI3MTcwMjMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkwMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MDFUMDkzODA2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjMzNGNhN2JkNDg3NmZlM2ViYjNmNjAzYWQxNGZhMjQxY2M1YzkxNzdiNzAzOGMxYjE4ZDZhNGY4MzFmMGFhMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.LNEQv5VsVcgdLbqUluA-RHL8QqjK9OQC_5P3mdvKBz0)
INSERT INTO enterprise_test_results(id, enterprise_version, operator_version, minio_version, test_state, is_recommended)
VALUES (1, 'ENTERPRISE.2022-05-03T03-00Z', 'v4.4.22', 'RELEASE.2022-05-26T05-48-41Z', 'FAILED', false);
INSERT INTO enterprise_test_results(id, enterprise_version, operator_version, minio_version, test_state, is_recommended)
VALUES (2, 'ENTERPRISE.2022-07-03T03-00Z', 'v4.4.27', 'RELEASE.2022-07-30T05-21-40Z', 'FAILED', false);
INSERT INTO enterprise_test_results(id, enterprise_version, operator_version, minio_version, test_state, is_recommended)
VALUES (3, 'ENTERPRISE.2022-09-03T03-00Z', 'v4.5.0', 'RELEASE.2022-09-25T15-44-53Z', 'PASSED', false);
INSERT INTO enterprise_test_results(id, enterprise_version, operator_version, minio_version, test_state, is_recommended)
VALUES (4, 'ENTERPRISE.2022-11-03T03-00Z', 'v4.5.4', 'RELEASE.2022-11-08T05-27-07Z', 'PASSED', true);
INSERT INTO enterprise_test_results(id, enterprise_version, operator_version, minio_version, test_state, is_recommended)
VALUES (5, 'ENTERPRISE.2023-01-03T03-00Z', 'v4.5.6', 'RELEASE.2023-01-02T09-40-09Z', 'IN_PROGRESS', false);
curl -X POST 'http://localhost:7007/api/v1/enterprise-test-results' \
-H 'Accept: */*' \
-H 'Accept-Language: en-CA,en-GB;q=0.9,en-US;q=0.8,en;q=0.7' \
-H 'Connection: keep-alive' \
-H 'Cookie: argocd.token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhcmdvY2QiLCJzdWIiOiJhZG1pbjpsb2dpbiIsImV4cCI6MTY4MTkyNzE2NSwibmJmIjoxNjgxODQwNzY1LCJpYXQiOjE2ODE4NDA3NjUsImp0aSI6IjJjNDYxNjY4LTI1NzgtNGFhYi1hM2QwLTkyNWUzNDQ0Mjc2MyJ9.47Npz1h9kJLpdU47daq5EcCdy4Lk_FZ1ceMbUBf2_mA; token=AG+YD5mrZ2h/oYueGMLPyk8Hq/t3zs8XFy9fdXyy1EytE/ImCO3ZJX3PD+tAkKFYVFwnLX1mgxc/T6dok1aJ4fHSE+fUFtSIH/edeTdjtLP55hCHd7nu51IDf95W9gVcojnrrsp0yqFMR70TVTyfJvqDc+cjX6RSpiAWPAt1Im7u+cOGbLRmAKm2aJtOgZjEY2jXq23V2KvF/oh9TtFXhIXD+TqTex0Qaue6m0lD71HhnB+p8sCGB/pyVL4Y9i3YaHSwlp6IACZznOMYK4+IktIjDkXSirvBRtArZLISMupc9fRHCbey6QkOazc002vTSxqduiS4ErrmCgMkIhwxrI27fmbpl6PsdZmh5m2O7M+4XWYj9zieaC++YUR93f0So9tT78x/3OgiBrMGbdIEC8LcJyNhiH8ZikR0O+GtGFdexnJrlsAsQQcCeIM4Cnst4D0fvI23X/iIL+uCE4YLtYtnLoKaDIAeod9Bb47rPXx58HrkrHpiKv5hMyBsaVqi7CIYnc+DAe9SvQF3ji6j1JGqGqIVED9AbehL7FM0FN2ru23PG13YU4L6r/GRO7F2XR1joXjgwWS2NONHYng9/Esx3qpFp6c7JoxNUUeX3v4i9IK+GH+mFQMOd5Lmazb4vXsDVArK1Oo2PZNinAYcK+v3lQIefeF4B7jedM0rvKRgFD/XxVpVm1Sl1d7u0CICRG7cKqp8hUAt7cbToqSwBqwcxqgnhZom5I43baW6392GjWA0RYJEzODc+gv5iKZbASn18DEQqx/npuHZuDpfs9sdlDj9Gy4YbWpBjrAv/0cclhRQRvxAJJeIGK4wBk1pofe1xjeaeMcWDGHmnVyj7er9dW+tZnxAIipewAfy1UMQDKDP5TU8/Q6UUcBR29gATHvKso26XtVqrDZBgY1nlF/9oXFo08fXDMZad3ptHAL2C7vKvI7QOFRPgGrA5RHgGODWkZvhitUBLUerY02fnm5hOLWgEwea4WxJa3cWU00kOIJolNOCvG8e93Fzev1mpRbqTYYfjzT6u34fkqWmJ0V/IMhH3iU2SbqgtGIn9Ehm4T+PG+5r6LZsv+msTBQDuaE723jyy9KbgPMUi1g8UVsfW7YE8u2xIj4d8tL8WOHI4yNHZNd3OARWPcW5cO8hMfo+ioKjA47O6py7LHHixuEIRx/hVjBvjgK83CIGUbbQxPfyOPYloLN5teqylFprGs5hs7pWc2s5gTnn/P3GMtf4XNlGtcw8JezF97r2cqxDSzeLHqwhKOqyhqztiGse/tOFfZp+dlIy7Tx7lX/8zJR50hXeJN6141H8NXD2N2yJ85efvDY1ZwizpEZjagezi8XVd0sQNFLcVQ==; ChangeManager-token=e4b1ef7e-ace9-4067-9003-b76608ddac90' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' \
-H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'sec-ch-ua-platform: "macOS"' \
-H 'content-type: application/json' \
--data-raw $'{"result":"FAILED", "minio":"RELEASE.2023-06-09T07-32-12Z", "operator":"v5.0.5", "enterprise":"ENTERPRISE.2023-06-13T01-11Z"}' \
--compressed
Then you will see the record inserted:
change-manager=# select * from enterprise_test_results;
id | enterprise_version | operator_version | minio_version | test_state | is_recommended
----+------------------------------+------------------+------------------------------+-------------+----------------
1 | ENTERPRISE.2022-05-03T03-00Z | v4.4.22 | RELEASE.2022-05-26T05-48-41Z | FAILED | f
2 | ENTERPRISE.2022-07-03T03-00Z | v4.4.27 | RELEASE.2022-07-30T05-21-40Z | FAILED | f
3 | ENTERPRISE.2022-09-03T03-00Z | v4.5.0 | RELEASE.2022-09-25T15-44-53Z | PASSED | f
4 | ENTERPRISE.2022-11-03T03-00Z | v4.5.4 | RELEASE.2022-11-08T05-27-07Z | PASSED | t
5 | ENTERPRISE.2023-01-03T03-00Z | v4.5.6 | RELEASE.2023-01-02T09-40-09Z | IN_PROGRESS | f
6 | ENTERPRISE.2022-05-03T03-00Z | v4.4.22 | RELEASE.2022-05-26T05-48-41Z | FAILED | f
7 | ENTERPRISE.2022-05-03T03-00Z | v4.4.22 | RELEASE.2022-05-26T05-48-41Z | FAILED | f
8 | ENTERPRISE.2022-05-03T03-00Z | v4.4.22 | RELEASE.2022-05-26T05-48-41Z | FAILED | f
9 | ENTERPRISE.2022-05-03T03-00Z | v4.4.22 | RELEASE.2022-05-26T05-48-41Z | FAILED | f
10 | ENTERPRISE.2022-05-03T03-00Z | v4.4.22 | RELEASE.2022-05-26T05-48-41Z | FAILED | f
11 | ENTERPRISE.2022-05-03T03-00Z | v4.4.22 | RELEASE.2022-05-26T05-48-41Z | FAILED | f
(11 rows)