Small refactor, I am actually not sure it's worth it, so feel free to close as long term we want to move to konflux and a lot of this will probably go away. But maybe it is still useful.
worker: add endpoint() helper that cannot fail and use it
Small commit to (hopefully) make the intent of the code more
clear when serverURL.Parse() is used. In most cases it is
used to generate an endpoint URL. As this is a realtive path
we do not need Parse() but can use JoinPath() instead which
has the nice benefit that it cannot error or panic.
worker: extract newServerURL() helper and add tests
Also explain why serverURL.JoinPath() cannot be used here.
Small refactor, I am actually not sure it's worth it, so feel free to close as long term we want to move to konflux and a lot of this will probably go away. But maybe it is still useful.
worker: add
endpoint()
helper that cannot fail and use itSmall commit to (hopefully) make the intent of the code more clear when
serverURL.Parse()
is used. In most cases it is used to generate an endpoint URL. As this is a realtive path we do not needParse()
but can useJoinPath()
instead which has the nice benefit that it cannot error or panic.worker: extract
newServerURL()
helper and add testsAlso explain why serverURL.JoinPath() cannot be used here.