Commit Graph

180 Commits

Author SHA1 Message Date
Joao Paulo Moreira Antunes e37c71b5a4 catalog azure server 2020 for use with old tfs
Signed-off-by: Joao Paulo Moreira Antunes <joaopaulo.m@terra.com.br>
2022-05-30 19:00:12 -03:00
svc.appcenter 0f314e2da5 fix/Add Repo part for user azure server 2020
Signed-off-by: Joao Paulo Moreira Antunes <joaopaulo.m@terra.com.br>
2022-05-30 19:00:12 -03:00
Niklas Aronsson 72dfcbc8bf Added scaffolder support for publishing to Gerrit
This patch enables support for publishing the workspace content to new
project in Gerrit.

This can be broken down to three things:

* "resolveUrl" for the Gerrit integration have been updated to handle
  absolute paths correctly.
* "RepoUrlPicker" has been updated to handle gerrit hosts.
* A new scaffolder action has been added that will publish the workspace
  content to a newly created Gerrit project.

Signed-off-by: Niklas Aronsson <niklasar@axis.com>
2022-05-16 09:43:59 +02:00
Antonio Musolino e295ce87de feat: allow repositories with nested namespace
Signed-off-by: Antonio Musolino <antoniomusolino007@gmail.com>
2022-05-11 11:51:59 +02:00
Niklas Aronsson 6673babab9 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>
2022-04-22 14:52:02 +02:00
Johan Haals 3feeeef3b6 Merge pull request #10669 from anicke/gerrit-entity-provider
New plugin: "plugin-catalog-backend-module-gerrit"
2022-04-21 14:20:23 +02:00
Niklas Aronsson 566407bf8a New plugin: "plugin-catalog-backend-module-gerrit"
The "plugin-catalog-backend-module-gerrit" exports an entity
provider for discovering catalog entities from Gerrit
repositories. The provider uses the "List Projects" API in Gerrit
to get a list of repositories and will automatically ingest all
"catalog-info.yaml" files stored in the root of the matching
projects.

Also added the "getGerritProjectsApiUrl" function to the Gerrit
integration. This returns the url to the "List Projects" API for
a given integration.

Signed-off-by: Niklas Aronsson <niklasar@axis.com>
2022-04-21 07:33:40 +02:00
Patrick Jungermann 1b4e1e2306 feat: split integrations.bitbucket -> bitbucketCloud / bitbucketServer
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>
2022-04-19 19:20:55 +02:00
Emma Indal d26e1b0146 [TechDocs Addons] Give Feedback Addon (#10733)
* give feedback addon implementation

Co-authored-by: Camila Belo <camilaibs@gmail.com>
Co-authored-by: Anders Näsman <andersn@spotify.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* export replaceUrlType from @backstage/integration-reacte

Co-authored-by: Camila Belo <camilaibs@gmail.com>
Co-authored-by: Anders Näsman <andersn@spotify.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* export give feedback addon

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* add hooks used for give feedback addon

Co-authored-by: Camila Belo <camilaibs@gmail.com>
Co-authored-by: Anders Näsman <andersn@spotify.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* replaceUrlType -> replaceGitLabUrlType

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* clarify template + template builder types

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* feedback fixups

Signed-off-by: Emma Indal <emma.indahl@gmail.com>

Co-authored-by: Camila Belo <camilaibs@gmail.com>
Co-authored-by: Anders Näsman <andersn@spotify.com>
2022-04-11 08:55:54 +02:00
Niklas Aronsson b7436743cb GerritUrlReader added that implements "readUrl"
The url used by "readUrl" is supposed to be human friendly url that can
be opened in the browser. This makes the Gerrit configuration a bit more
complicated since there is no built in support to browse a git in Gerrit.
Instead this is handled by separate services that can be deployed at a
different host then the Gerrit instance. This implementation supports
Gitiles as the code browser tool. The dependency to Gitiles is optional,
it is perfectly possible to integrate Gerrit with Backstage but it will
not be possible to open the "human readable links" found in different
places of the Backstage gui.

A new optional config field has been added to Gerrit integration where
the base url of the Gitiles installation can be set. This is needed to
create a working link to some git content.

A new "url reader" has been added that reads content from Gerrit, as of
now only "readUrl" is implemented ("readTree" will soon follow). The
format of url is the format used by Gitiles. Gerrit's "readUrl" is
pretty simple, it's a single API call to Gerrit that returns the content
base64 encoded.

What is a bit different to other "urlReaders" is the predicate
function in that is not matching the host of the Gerrrit API. The "host"
variable in the config is the Gerrit host. The address where  Gitiles is
 installed may be on the same host but it could be on a separate host.
For example a Gerrit instance could be hosted on
"gerrit-review.company.com" but the repos could be browsable on a
separate host, e.g. "gerrit.company.com" and the human readable URL would
then not point to the API host.

Signed-off-by: Niklas Aronsson <niklasar@axis.com>
2022-03-24 14:43:39 +01:00
Jussi Hallila b70bdac610 Modify based on code review comments.
Signed-off-by: Jussi Hallila <jussi@hallila.com>
2022-03-17 08:44:20 +01:00
Iain Billett 1e10a3f9ef Merge remote-tracking branch 'upstream/master' into add-external-id-to-s3-integration 2022-03-15 16:57:27 +00:00
Niklas Aronsson 0885854ff3 Fixed review comments
* 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>
2022-03-14 10:34:53 +01:00
Niklas Aronsson b0c0fccacf Gerrit config: Make the apiBaseUrl optional
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>
2022-03-11 13:35:23 +01:00
Iain Billett a8c5f1a08f Add an optional external Id field
Signed-off-by: Iain Billett <iain@roadie.io>
2022-03-10 14:41:07 +00:00
Niklas Aronsson 403837cbac Added a ScmIntegration for Gerrit
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>
2022-03-08 10:13:09 +01:00
Patrik Oldsberg 6ed03eeacb Merge pull request #9782 from Bonial-International-GmbH/PJ_bitbucket_default-apiBaseUrl
feat(bitbucket): ensure apiBaseUrl, replace hardcoded cases
2022-03-02 17:35:12 +01:00
Patrick Jungermann 34af86517c feat(bitbucket): ensure apiBaseUrl, replace hardcoded cases
Ensure presence of apiBaseUrl for bitbucket
integrations for both cases Bitbucket Cloud and
Bitbucket Server by setting the default for
Bitbucket Server at the integration config, too.

Replace hardcoded uses of the default apiBaseUrl
with the use of the integration config's value.

Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2022-02-25 15:18:17 +01:00
Patrick Jungermann 33d5e79822 fix(bitbucket): fix line number references
Use the actual line number syntax for Bitbucket Cloud
and Bitbucket Server.

Closes: #9764

Signed-off-by: Patrick Jungermann <Patrick.Jungermann@gmail.com>
2022-02-25 00:59:31 +01:00
Edgar Silva 1bc8c55822 Changed repoIDLookup to url.origin
Changed the repoIDLookup concatenation from 'url.protocol + url.host' to
'url.origin', which does essentially the same but is simpler.

Signed-off-by: Edgar Silva <edgar.silva@cross-join.com>
2022-02-17 12:50:23 +00:00
Edgar Silva 2f1050ec10 Updated gitlab integration to include port
Updated integration module to allow for the use of a custom port, which
is often the case in self hosted gitlab instances

Removed host.includes(':') check in config.ts to allow for users to
include the port in the host
Changed url.hostname to url.host in core.ts to include the port in the
api call (otherwise it'll result in an error when trying to import a new
component)

Signed-off-by: Edgar Silva <edgar.silva@cross-join.com>
2022-02-16 19:18:38 +00:00
Iain Billett 0e76e264e9 Return undefined rather than an empty string
Signed-off-by: Iain Billett <iain@roadie.io>
2022-01-18 18:32:19 +00:00
Iain Billett 2030b5e80d Return an empty token where an installation owner is not allowed
While this is less obvious to the user this facilitates anonymous access
to (public) files where the app is installed but the owner is not in the
allowed list.

Signed-off-by: Iain Billett <iain@roadie.io>
2022-01-18 18:02:47 +00:00
Brian Fletcher bc5f67627c Merge branch 'master' of github.com:backstage/backstage into readersprocessorstasks 2022-01-10 14:40:04 +00:00
Fredrik Adelöw 5333451def Got rid of the last brace-typed and hyphen-less params etc
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2022-01-10 09:48:12 +01:00
Brian Fletcher ce82656901 removes some breaking compatability changes
Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-07 14:13:54 +00:00
Brian Fletcher 95b369d808 use scm integrations interface rather than implementation
Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-06 14:21:56 +00:00
Brian Fletcher ffda3d4490 tweaks to remove uneeded differences
Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-06 12:11:05 +00:00
Brian Fletcher be15350198 change single instance provider back to the way it was
there was no changes to it, so there was no need for it.

Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-06 11:57:04 +00:00
Brian Fletcher 0a21e4bcc4 Make the credentials provider optional..
..and other review comments improvements.

Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-06 11:46:39 +00:00
Brian Fletcher fb8ca7c1bf remove code accidently added in
Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-06 11:46:23 +00:00
Brian Fletcher 2f1d27133b use single instance provider in default one
Also changes how the GitHub url is parsed.

Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-05 13:53:14 +00:00
Brian Fletcher 595dab2935 Creates new provider for compatability
There is now two credentials providers:
 - SingleInstanceGithubCredentialsProvider can be created with a single
   GitHubIntegrationConfig.
 - DefaultGithubCredentialsProvider is created from the full integrations
   config.

Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-05 08:25:52 +00:00
Brian Fletcher 7af4986af8 remove factory signature from gh creds provider
This change required the SingleInstanceGithubCredentialsProvider to be
changed to allow it to look up the credentials from the whole list of
integrations.

As such all places where it was used I have updated.

Signed-off-by: Brian Fletcher <brian@roadie.io>
2022-01-04 15:30:07 +00:00
Leon Stein ca52cf8b28 add aws s3 custom endpoint config test
Signed-off-by: Leon Stein <leons727@gmail.com>
2021-12-29 08:42:06 -05:00
Leon Stein 0dd1971d4a fix tests
Signed-off-by: Leon Stein <leons727@gmail.com>
2021-12-29 08:36:25 -05:00
Leon Stein c2d09d8c17 cleanup
Signed-off-by: Leon Stein <leons727@gmail.com>
2021-12-28 11:49:10 -05:00
Leon Stein e662ee528b remove AMAZON_AWS_HOST export, fix regex per review feedback
Signed-off-by: Leon Stein <leons727@gmail.com>
2021-12-28 11:42:23 -05:00
Leon Stein bc78cc3dca use endpoint/s3ForcePathStyle instead of validateHost/ssl per PR feedback
Signed-off-by: Leon Stein <leons727@gmail.com>
2021-12-28 10:24:12 -05:00
Leon Stein e74854410d initial
Signed-off-by: Leon Stein <leons727@gmail.com>
2021-12-24 17:49:48 -05:00
Brian Fletcher 57261f7e86 discovery processor to use gh creds interface
Signed-off-by: Brian Fletcher <brian@roadie.io>
2021-12-23 15:15:12 +00:00
Brian Fletcher 7d4b4e937c addressing review comments
Signed-off-by: Brian Fletcher <brian@roadie.io>
2021-12-23 12:31:09 +00:00
Brian Fletcher b2d67bde04 adds factory type for creds provider and rename default
Signed-off-by: Brian Fletcher <brian@roadie.io>
2021-12-20 13:58:39 +00:00
Brian Fletcher 6984c4988a moves types and interfaces to specific types file
Signed-off-by: Brian Fletcher <brian@roadie.io>
2021-12-20 11:06:37 +00:00
Brian Fletcher 7228b18c0f create an interface for gh creds provider
We plan to build on this later to allow the credentials provider to
be passed into the scaffolder tasks, the processors, and the url
readers.

Signed-off-by: Brian Fletcher <brian@roadie.io>
2021-12-17 11:26:05 +00:00
Fredrik Adelöw 47619da24c give the same treatment to catalog-backend too
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-11-25 13:05:11 +01:00
Fredrik Adelöw 8eedc159ae fix up errors too
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-10-26 16:55:36 +02:00
Fredrik Adelöw a15d028517 more api fixes, in integration and theme
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-10-26 16:24:13 +02:00
Johan Haals f1e96dc5b1 chore/cli: Replace msw with setupRequestMockHandlers
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2021-10-26 10:54:47 +02:00
Connor Younglund dd9cf64dd5 replace \n with newline for GitHub App private key
Signed-off-by: Connor Younglund <younglund_connor@bah.com>
2021-10-13 15:15:55 -04:00