GerritUrlReader: Implemented "readTree"
"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>
This commit is contained in:
Vendored
+5
@@ -108,6 +108,11 @@ export interface Config {
|
||||
* @visibility frontend
|
||||
*/
|
||||
baseUrl?: string;
|
||||
/**
|
||||
* The base url for cloning repos.
|
||||
* @visibility frontend
|
||||
*/
|
||||
cloneUrl?: string;
|
||||
/**
|
||||
* The username to use for authenticated requests.
|
||||
* @visibility secret
|
||||
|
||||
Reference in New Issue
Block a user