Currently, `integrations` is retrieved at catalog-import to check
configured integrations.
This could fail if there was no config below `integrations` which has `@visibility frontend`.
This happened if no integration or only non-Github integrations without
frontend visible properties like `integrations.bitbucketCloud` are used.
After this change, at least `integrations` will always be visible to the frontend.
Closes: #11700
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
"readTree" has been implemented for the "GerritUrlReader". Gerrit have
a REST API's to download repo contents but there are a number of
limitations that makes it unusable.
This implementation works as follows:
* The project and branch is parsed from the url.
* The current revision is fetched from the Gerrit REST API.
* The revision string is used as "etag".
* If the etag has changed a temporary directory is created.
* The project is cloned to the temporary directory.
* The cloned content is read into a "Readable Stream".
* The temporary directory is removed.
* "readTree" returns a response using "fromTarArchive" as read from the
temporary directory.
Also added an option to specify the base "cloneUrl" has been added to the
gerrit integration config.
Signed-off-by: Niklas Aronsson <niklasar@axis.com>
Split `integrations.bitbucket` into `integrations.bitbucketCloud`
and `integrations.bitbucketServer`
while staying backwards compatible for now
(== `BitbucketIntegration` loads from the new configs, too, if the old is not used).
Relates-to: #9923
Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
* Rename "apiBaseUrl" to the more suitable "baseUrl".
* Removed the Gerrit location doc (will be added later together
with the "urlReader" implementation.
* Fixed the line number handling in Gerrit/resolveUrl.
Signed-off-by: Niklas Aronsson <niklasar@axis.com>
If the apiBaseUrl is not set assume that the gerrit instance
uses https and can be reached on the address specified by the
"host" option.
Signed-off-by: Niklas Aronsson <niklasar@axis.com>
A new ScmIntegration has been added for reading entities from
gits hosted by Gerrit. The UrlReader implementation will be done
in an upcoming patch.
The Gerrit configuration supports the following values:
* host (required) : The host of the gerrit instance to use.
* apiBaseUrl (required): The base url of the gerrit api.
* username (optional): The username to use during authentication.
* password (optional): The password or http token to use for
authentication.
Signed-off-by: Niklas Aronsson <niklasar@axis.com>