Commit Graph

364 Commits

Author SHA1 Message Date
github-actions[bot] df31bdca8f Version Packages 2021-05-12 09:39:51 +00:00
Eric Peterson 6e0be00e1d Wrap cache clients in a Backstage-specific CacheClient to handle key normalization and error handling + allow us the freedom to move away from cache-manager in the future if necessary.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-05-09 15:24:47 +02:00
Eric Peterson 93ff8275dd WIP store-agnostic cache manager.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-05-09 15:24:40 +02:00
Johan Haals 0bfcc4323a Merge pull request #5587 from backstage/mob/wire-locationservice
catalog/next: Wire API with locationStore, fix filtering
2021-05-06 13:30:28 +02:00
github-actions[bot] d397eb470f Version Packages 2021-05-06 08:25:18 +00:00
Johan Haals 1f1511e768 catalog/next: Wire API with locationStore, fix filtering
Co-authored-by: Ben Lambert <ben@blam.sh>
Co-authored-by: Fredrik Adelöw <freben@users.noreply.github.com>
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2021-05-05 16:38:14 +02:00
Dominik Henneke 42f2adadc8 Merge pull request #5415 from SDA-SE/feat/rundocker-api
Refactor the runDockerContainer function to a ContainerRunnerApi interface
2021-05-05 12:00:40 +02:00
Johan Haals 45ca6c7699 Refactor StateManager into the ProcessingEngine
And add some tests

Co-authored-by: Ben Lambert <ben@blam.sh>
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2021-05-04 09:39:00 +02:00
Dominik Henneke e0bfd3d448 Refactor the runDockerContainer function to a ContainerRunner interface.
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-05-03 14:16:28 +02:00
Fredrik Adelöw 2b59ff4299 Merge pull request #5556 from backstage/dependabot/npm_and_yarn/octokit/auth-app-3.4.0
chore(deps): bump @octokit/auth-app from 2.10.5 to 3.4.0
2021-05-03 12:58:55 +02:00
Fredrik Adelöw 38ca051682 The default @octokit/rest dependency was bumped to "^18.5.3".
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-05-03 11:15:22 +02:00
Fredrik Adelöw b99ac3f6e1 Minor composability etc docs changes
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-05-02 22:13:05 +02:00
Eric Peterson a99e0bc42c [Search] Improvements to DefaultCatalogCollator (#5491)
* Add owner/lifecycle to default catalog document and allow location to be configured by integrators.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>

* Test the DefaultCatalogCollator

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>

* Changeset.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-04-29 11:38:21 +02:00
Patrik Oldsberg cfdc972ea2 Merge pull request #5454 from RoadieHQ/docker/fix-dockerfile
[docker] Fix error in docker build
2021-04-28 10:58:38 +02:00
Emma Indal 50b15bfeb3 imports and exports
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
2021-04-26 16:44:32 +02:00
Emma Indal 9dff1a9839 use scheduler and fix tests
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
2021-04-26 16:43:58 +02:00
Martina Iglesias Fernandez 43db3d6892 [docker] Fix error in docker build
Before:
```
Step 7/8 : RUN tar xzf bundle.tar.gz && rm bundle.tar.gz
 ---> Running in 91107ee4a847
tar (child): bundle.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now
```

Signed-off-by: Martina Iglesias Fernandez <martina@roadie.io>
2021-04-26 10:06:51 +02:00
Emma Indal cdda9c671d move refresh loop to builder and use configured refreshInterval
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
2021-04-23 15:03:32 +02:00
github-actions[bot] 034998d537 Version Packages 2021-04-22 13:19:35 +00:00
Emma Indal b9b2b4b766 [Search] Lunr search engine support (#5290)
* add lunr package

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

* add search translator type and search engine interface

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

* (wip) add support for lunr search engine

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

* lunr search engine support

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

* clean up todo comments

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

* typing and cleanups

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

* move lunr type package from dev deps to deps

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

* check if documents exist to index

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

* test fixup

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

* changeset

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

* move LunrSearchEngine.ts to /engines and add tests

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

* update imports

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

* update error message

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

* add comment to index rotation

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

* Update plugins/search-backend-node/src/types.ts

Signed-off-by: Fredrik Adelöw freben@gmail.com

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>

* Update plugins/search-backend-node/src/engines/LunrSearchEngine.ts

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

Co-authored-by: Fredrik Adelöw <freben@gmail.com>

* Update plugins/search-backend-node/src/engines/LunrSearchEngine.ts

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

Co-authored-by: Fredrik Adelöw <freben@gmail.com>

* fix imports

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

* use type assertion to specify more specific ConcreteLunrQuery type

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

* fix imports

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

* consistent naming

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

* change search engine to be parameter of constructor in indexBuilder

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

* make engine required in router options and pass it through in createRouter used in standalone server

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

* fix tests

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

* delete import

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

* add types to SearchQuery interface to make it possible to scope to specific index + test

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

* clean up tests

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

* handle case when a filter is added on a field that does not exist on all documents + test

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

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
2021-04-22 15:03:10 +02:00
alde e7d2fb93f0 Create code-coverage plugin
In order to use this plugin, you must set the
`backstage.io/code-coverage` annotation on your entity.

```yaml
backstage.io/code-coverage: enabled
```

There's a feature to only include files that are in SCM in the coverage
report, this is helpful to not count generated files for example. To
enable this set the `backstage.io/code-coverage` annotation to
`scm-only`.

```yaml
backstage.io/code-coverage: scm-only
```

The backend plugin provides API endpoints for submitting code-coverage
reports. Currently jacoco and cobertura are supported. These reports
are normalized to a json format that is stored in the database.

```json
// curl -X POST -H "Content-Type:text/xml" -d @cobertura.xml "localhost:7000/api/code-coverage/Component/default/entity-name?coverageType=cobertura"
{
    "links": [
        {
            "href": "http://localhost:7000/api/code-coverage/Component/default/entity-name",
            "rel": "coverage"
        }
    ]
}
```

It also provides some additional API endpoints:
* Viewing the latest report
* Viewing a more condensed history of code coverage values
* Retrieving file contents from source-control, used by the UI

Provides a graph of code coverage change over time, as well as a file
view where you can see the highlighted lines.

Co-authored-by: nissayeva <natashaaay@gmail.com>
Signed-off-by: alde <r.dybeck@gmail.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-04-21 12:58:18 +02:00
Patrik Oldsberg df8e6f1dc4 Merge pull request #5372 from backstage/mob/catalog-refactor
Initial iteration of the next software catalog
2021-04-20 11:44:44 +02:00
Johan Haals ec43f706c7 Copy migrations to migrationsv2 before migration
Co-authored-by: Fredrik Adelöw <freben@users.noreply.github.com>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2021-04-19 10:53:57 +02:00
Johan Haals 8f6a17c04c Add experimental option to start the new catalog
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2021-04-14 10:47:10 +02:00
Dominik Henneke d541d9fd07 Include review comments
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-04-12 18:50:15 +02:00
Patrik Oldsberg da2281df89 Merge pull request #5088 from ntgussoni/fix/DOCS-remove_add_for_copy
[DOCS/CLI, DOCKER] Fixes untar not happening under certain conditions
2021-04-08 12:48:56 +02:00
github-actions[bot] 8e00ab7e63 Version Packages 2021-03-31 12:21:12 +00:00
Ben Lambert 80e92b8f48 Merge pull request #5034 from lunarway/feature/catalog-mode
Add readonly mode to catalog-backend
2021-03-26 15:13:56 +01:00
Crevil f1b2c1d2c2 Add readonly mode to catalog
This change includes a new `mode` concept to the catalog backend. This gives us
the handle to configure catalog in a `readonly` mode as discussed in #3348.

The new `catalog.mode` field configures that catalog in either `readwrite` or
`readonly`.

- `readwrite` is the current mode that allows users to register components at
  startup through `catalog.locations` and with eg. plugin `catalog-import`

- `readonly` is the new mode which, for now, disables the mutating `location`
  APIs

Signed-off-by: Crevil <bjoern.soerensen@gmail.com>
2021-03-25 20:59:33 +01:00
github-actions[bot] 844da89090 Version Packages 2021-03-25 17:46:13 +00:00
Eric Peterson bb378ac6f2 Merge pull request #4515 from backstage/iameap/search-indexer
[Search] Foundation: plugins and types
2021-03-25 13:15:33 +01:00
Nicolas Torres 2ae8cf4608 Fixes untar not happening under certain occasions
Signed-off-by: Nicolas Torres <nicolast@backbase.com>
2021-03-25 09:00:10 +01:00
dependabot[bot] d42f055d48 chore(deps): bump express-promise-router from 3.0.3 to 4.1.0
Bumps [express-promise-router](https://github.com/express-promise-router/express-promise-router) from 3.0.3 to 4.1.0.
- [Release notes](https://github.com/express-promise-router/express-promise-router/releases)
- [Changelog](https://github.com/express-promise-router/express-promise-router/blob/trunk/CHANGELOG.md)
- [Commits](https://github.com/express-promise-router/express-promise-router/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-23 04:26:33 +00:00
Eric Peterson fb2ff7dfb0 Provide useful logging in the IndexBuilder.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:49 +01:00
Eric Peterson 44ec2571b6 Use Catalog REST API instead of assuming local process.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:49 +01:00
Eric Peterson 3560405cab Call a builder a builder.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:49 +01:00
Anders Näsman 5a045906c2 remove singleton pattern from indexer
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:49 +01:00
Anders Näsman 51fc8de48c Tweak Collator/Decorator to be classes instead of methods
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:48 +01:00
Anders Näsman 124b93bff4 rename plugin-search-indexer to plugin-search-backend-node
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:45 +01:00
Anders Näsman 0057692401 move collation to search plugin
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:04 +01:00
Anders Näsman b7cb59dd7b standard TODO syntax
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:03 +01:00
Eric Peterson 3e9d8427b6 Illustrate potential software catalog indexing.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:42:00 +01:00
Eric Peterson b7b4cc319c Wire up search backend to app backend testbed.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-03-19 09:41:15 +01:00
Andreas Stenius 5a09c681d7 badges: refactoring to use badge factories to create dynamic badges.
Signed-off-by: Andreas Stenius <andreas.stenius@svenskaspel.se>
2021-03-19 08:41:13 +01:00
Andreas Stenius 6a68e79217 badges-backend: drop support for defining badges in app config.
Signed-off-by: Andreas Stenius <andreas.stenius@svenskaspel.se>
2021-03-19 08:41:13 +01:00
Andreas Stenius ac17aeb35d badges: load default badges from code rather than config. #4457.
Signed-off-by: Andreas Stenius <git@astekk.se>
2021-03-19 08:41:12 +01:00
Andreas Stenius 798002ee03 badges-backend: refactor to use badge definitions in config. #4457
Signed-off-by: Andreas Stenius <git@astekk.se>
2021-03-19 08:41:11 +01:00
Andreas Stenius 61078ba14d badges: introduce badges field on entity about card.
Signed-off-by: Andreas Stenius <git@astekk.se>
2021-03-19 08:41:11 +01:00
github-actions[bot] 718eea4f08 Version Packages 2021-03-18 12:31:44 +00:00
Patrik Oldsberg 2eeb884353 todo-backend: implement TodoScmReader
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-03-11 18:02:02 +01:00