Issue when calling PUT /api/v1/repositories/{repoID} to update a repository
ionutbalutoiu opened this issue · comments
I just did a fresh deployment with GARM using latest main
branch (last commit f12d93f as of today).
And I encountered a bug after calling PUT /api/v1/repositories/{repoID}
API endpoint.
The bug reproduction steps are:
-
Have two valid GitHub tokens configured as credentials in the GARM config file.
I'll be using
ionutbalutoiu
andionutbalutoiu-clone
(it's the same GitHub token but under different names). -
Start a fresh GARM server.
-
Do the init step via
garm-cli init ...
command. -
Create a repo via
garm-cli repo create ...
command. I created mine withionutbalutoiu
credentials first.After that, doing
garm-cli repo ls
, the following is shown:+--------------------------------------+---------------+----------------+------------------+------------------+ | ID | OWNER | NAME | CREDENTIALS NAME | POOL MGR RUNNING | +--------------------------------------+---------------+----------------+------------------+------------------+ | e9584f09-4eef-49b4-9871-9d9a3ecb2be6 | test-garm-org | test-garm-repo | ionutbalutoiu | true | +--------------------------------------+---------------+----------------+------------------+------------------+
Notice
POOL MGR RUNNING
beingtrue
, which is expected. -
Call the
PUT /api/v1/repositories/{repoID}
API endpoint to change thecredentials_name
field viacurl
:curl -X PUT -H $AUTH_HEADER https://garm.balutoiu.com/api/v1/repositories/${REPO_ID} -d '{"credentials_name": "ionutbalutoiu-clone"}'
After successful response from the GARM API, check
garm-cli repo ls
output:+--------------------------------------+---------------+----------------+---------------------+------------------+ | ID | OWNER | NAME | CREDENTIALS NAME | POOL MGR RUNNING | +--------------------------------------+---------------+----------------+---------------------+------------------+ | e9584f09-4eef-49b4-9871-9d9a3ecb2be6 | test-garm-org | test-garm-repo | ionutbalutoiu-clone | false | +--------------------------------------+---------------+----------------+---------------------+------------------+
Notice that
POOL MGR RUNNING
is switched tofalse
, and it stays like this until GARM server is restarted.
From my observation, POOL MGR RUNNING
being false
doesn't disturb the normal GARM server functionality. I was able to create a pool, runner instances, run workflows and see GARM maintain the idle pool of instances.
But, there are certain aspects in the code that will not work with that flag disabled, for example this:
Lines 1402 to 1405 in f12d93f