Commit Graph

188 Commits

Author SHA1 Message Date
Fredrik Adelöw dcd1a0c3f4 Do not unpack arguments directly on exported items
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-12-07 19:42:10 +01:00
Eric Peterson ef600b3c8c Review feedback.
Signed-off-by: Eric Peterson <i.am@eric.pe>
2021-12-05 16:50:09 -06:00
Eric Peterson 6e9e82b99d Review feedback.
Signed-off-by: Eric Peterson <i.am@eric.pe>
2021-11-28 13:40:51 -07:00
Eric Peterson e0930f578e en-US lowercase locale
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson ef04b09f75 Make cache readTimeout configurable.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson da0867f952 Account for legacy path casing in cache invalidation.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson 8cf4684a4e Remove cache invalidation endpoint from middleware.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson a3909d2c2f Invalidate stale cache entries on read for external builder config when cache is enabled.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson d011fd61ea Ensure DocsSynchronizer has access to cache client.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson 74ccd66e26 Add tests for cache middleware. Do not cache non-200 responses.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson a16dce0433 Tests for TechDocsCache class
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson 693db1da54 Review feedback.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson 790f02c898 Improve types/documentation.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:04 -07:00
Eric Peterson 0a44eb7d52 Initial implementation of TechDocs cache in backend plugin
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:16:03 -07:00
Eric Peterson 3e443e8e31 Express middleware for reading/writing data to cache.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-11-28 13:13:30 -07:00
MT Lewis 456bcce6ca Merge pull request #7943 from backstage/natasha/b2b-auth
Support backend to backend authentication
2021-11-26 15:31:52 +00:00
MT Lewis 87f1b59ff9 techdocs-backend: update TokenManager mock in collator test suite
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2021-11-26 12:16:38 +00:00
Fredrik Adelöw b055a6addc Align on usage of cross-fetch vs node-fetch in frontend vs backend packages
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-11-25 13:05:08 +01:00
Mike Lewis 4b6de2f872 backend-common: remove 'Server' from TokenManager method names
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-23 18:12:28 +00:00
Mike Lewis 8a001f8202 backend-common: TokenManager throws for invalid tokens rather than returning boolean
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
2021-11-23 17:55:47 +00:00
Nataliya Issayeva f04f38dbcd Fix collator tests
Signed-off-by: Nataliya Issayeva <nissayeva@users.noreply.github.com>
2021-11-18 07:57:53 -08:00
Joe Porpeglia 2a320c21b4 Pass auth token from document collators
Co-authored-by: Nataliya Issayeva <nissayeva@users.noreply.github.com>
Co-authored-by: Tim Hansen <timbonicus@gmail.com>
Signed-off-by: Joe Porpeglia <josephp@spotify.com>
2021-11-18 07:55:25 -08:00
Oliver Sand 106a5dc3ad Restore original casing for kind, namespace and name in DefaultTechDocsCollator
Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
2021-10-27 14:30:40 +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
Patrik Oldsberg 82a7349d29 Merge pull request #7640 from kuangp/refactor/searchResultTitles
refactor(search): display entity title for result items if defined
2021-10-21 00:21:34 +02:00
Patrik Oldsberg 36e67d2f24 more strict error type checking in most packages and backend plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-10-17 15:09:05 +02:00
Phil Kuang 177401b571 refactor(search): display entity title for result items if defined
Signed-off-by: Phil Kuang <pkuang@factset.com>
2021-10-15 14:44:50 -04:00
Patrik Oldsberg d0d78ebc7c Merge pull request #7181 from backstage/rugvip/descriptions
Add package descriptions + separate table for plugins in API reference
2021-09-15 17:25:27 +02:00
Jussi Hallila 9fb0503c15 Tweak lowecasing, export Optios type
Signed-off-by: Jussi Hallila <jussi@hallila.com>
2021-09-15 15:31:03 +02:00
Patrik Oldsberg 8142a8ecb2 packages,plugins: add package documentation
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2021-09-14 18:47:53 +02:00
Jussi Hallila 65a2d67735 Modify fromConfig to actually use the config. Update api-reports.
Signed-off-by: Jussi Hallila <jussi@hallila.com>
2021-09-13 09:54:12 +02:00
Jussi Hallila f7c06bcadd Add some more casing changes.
Modify DefaultTechDocsCollator to have a static constructor method.

Signed-off-by: Jussi Hallila <jussi@hallila.com>
2021-09-09 11:57:14 +02:00
Jussi Hallila 6f45fc7990 Modify TechDocsCollator to be aware of new urls
* Add boolean constructor param to define if to use legacy paths
* Swap urls to match new pattern
* Add few tests

Signed-off-by: Jussi Hallila <jussi@hallila.com>
2021-09-03 16:00:00 +02:00
Eric Peterson dc152e0da6 Merge pull request #6773 from SDA-SE/feat/techdocs-repo-url
[Techdocs] Set the correct edit_uri or repo_url for documentation pages that are hosted on GitHub and GitLab
2021-09-01 19:11:29 +02:00
Eric Peterson a42a142c2f Reduce log fatigue during startup.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-08-31 15:24:04 +02:00
Jussi Hallila 30ed662a35 Implement in-context search bar for tech docs. (#6651)
* Implement in-context search bar for tech docs

* Add in-context search functionality to tech docs
* Use the existing backend search functionality with tech docs specific filters
* Use material-ui autocomplete to display 10 first search results
* Add tests

Signed-off-by: Jussi Hallila <jussi@hallila.com>

* Remove context and replace it with `withSearch` prop.

Signed-off-by: Jussi Hallila <jussi@hallila.com>

* Bump search-common devp to latest

Signed-off-by: Jussi Hallila <jussi@hallila.com>

* Rename types file to not conflict with hardcoded types.d.ts.

Signed-off-by: Jussi Hallila <jussi@hallila.com>
2021-08-27 12:21:48 +02:00
Dominik Henneke 8b0f6f860f Set the correct edit_uri or repo_url for documentation pages that are hosted on GitHub and GitLab
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-08-27 09:00:37 +02:00
Fredrik Adelöw 923491eece run prettier formatting
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-08-09 11:54:38 +02:00
Dominik Henneke eabf5bb598 Merge remote-tracking branch 'upstream/master' into feat/relative-ref-tmp 2021-07-21 15:12:52 +02:00
Dominik Henneke ed6092f76a Handle and forward errors from the DocsBuilder instantiation to the user
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-21 12:42:24 +02:00
Dominik Henneke d32d01e5bc Introduce the annotation backstage.io/techdocs-ref: <relative-target> as an alias for backstage.io/techdocs-ref: dir:<relative-target>
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-16 10:16:32 +02:00
Jussi Hallila 9266b80ab3 Implement DefaultTechDocsCollator
* Implements a collator for tech docs.
   * Retrieves mkdocs created search index for entities that have documentation configured
* Registers collator to expose tech docs content to be searchable
* Adds pagination to example search
* Modifies example search to contain tech docs
   * Displays docs results with link to docs and the entity name as title.
* Creates a reusable type filter to be located in the search package.
* Add tests for type filter

Signed-off-by: Jussi Hallila <jussi@hallila.com>
2021-07-15 13:14:25 +02:00
Dominik Henneke 386e95b94c Add missing comment
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-13 16:56:30 +02:00
Dominik Henneke 246b1797e5 Merge remote-tracking branch 'upstream/master' into feat/techdocs-build-logs
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-13 16:49:33 +02:00
Eric Peterson 5176099c79 Allow either out-of-the-box or recommended configurations in TechDocs createRouter
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2021-07-12 16:41:39 +02:00
Dominik Henneke 221b3080f9 Fix warning
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-09 14:38:50 +02:00
Dominik Henneke 800445cca0 Move the logging one level up to send all logs and exceptions to the user
With this change, only failed builds are logged to the backend logger

Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-09 14:33:54 +02:00
Dominik Henneke 380a519b2d Add a warning to the deprecated non-eventsource sync endpoint
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-07 09:47:13 +02:00
Dominik Henneke 9b98328e99 Move the synchronization code into a dedicated class and still support non-eventstream responses
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-06 18:57:37 +02:00
Dominik Henneke f1200f44c8 Rewrite the /sync/:namespace/:kind/:name to return an event-stream
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-07-05 14:20:41 +02:00