Commit Graph

150 Commits

Author SHA1 Message Date
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
Joe Porpeglia 709589a839 Rename service catalog to software catalog, excluding blog posts
Signed-off-by: Joe Porpeglia <josephp@spotify.com>
2021-06-21 11:48:43 -04:00
Fredrik Adelöw a88073c29a Update copyright headers
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-18 20:26:42 +02:00
Dominik Henneke 2b9d30b153 Fix minor issues from the review comments
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-06-17 10:23:41 +02:00
Dominik Henneke fea7fa0ba6 Return a 304 Not Modified from the /sync/:namespace/:kind/:name endpoint if nothing was built
Signed-off-by: Dominik Henneke <dominik.henneke@sda-se.com>
2021-06-17 10:23:00 +02:00
Patrik Oldsberg d458690f5c Merge pull request #5754 from TejasQ/tejask/3333
TechDocs: Support configurable working directory as temp dir
2021-06-16 18:54:47 +02:00
Tejas Kumar 20d9c7d384 Address review comments
Signed-off-by: Tejas Kumar <tejask@spotify.com>
2021-06-16 10:09:06 +02:00
Fredrik Adelöw 3108ff7bfd Make yarn dev for backends respect the PLUGIN_PORT env var
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-06-14 14:46:19 +02:00
Tejas Kumar d93a3f9853 Refactor to use optional string
Signed-off-by: Tejas Kumar <tejask@spotify.com>
2021-05-20 16:34:04 +02:00
Tejas Kumar a345a2e019 Use backend.workingDir for techdocs
Signed-off-by: Tejas Kumar <tejask@spotify.com>
2021-05-20 16:32:31 +02:00
Tejas Kumar d2329e7486 Use stringifyEntityRef in place of deprecated
Signed-off-by: Tejas Kumar <tejask@spotify.com>
2021-05-20 16:23:13 +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
Oliver Sand cba5944fcd Change the response status of metadata endpoints in case a documentation is not available to 404 NOT FOUND
Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
2021-04-07 16:55:39 +02:00
Chongyang Adrian, Ke aaeb7ecf3c TechDocs: show outdated docs and asnyc build new
Signed-off-by: Chongyang Adrian, Ke <ftt.adrian.ke@grabtaxi.com>
2021-03-25 10:26:11 +08:00
Himanshu Mishra 8fdb4d8e00 techdocs: backend responds with an error if publisher type is not supported
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-03-12 11:40:12 +01:00
Himanshu Mishra 75941ca364 techdocs: techdocs_metadata.json could be missing, ignore the error
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-03-12 11:30:00 +01:00
Himanshu Mishra 11242ac41e Apply suggestions from code review
Co-authored-by: Adam Harvey <adam.harvey@dxc.com>
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-03-12 08:55:17 +01:00
Himanshu Mishra 784d39894a techdocs: Replace res.send with res.json
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-03-12 01:32:59 +01:00
Himanshu Mishra cf1b10f651 techdocs: When builder is set to local
1. Do not check for updates if a check has been done in last 60 seconds
2. Use stored etag from techdocs_metadata.json instead of in-memory storage
3. Enable re-building docs when in a mix of basic and recommended setup i.e. local builder with external storage

Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-03-12 01:11:08 +01:00
Fredrik Adelöw 8686eb38cf Introduce the @backstage/errors package.
Encode thrown errors in the backend as a JSON payload using a facility in that package, and render helpful frontend displays of those errors.

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-03-11 14:31:21 +01:00
Fredrik Adelöw 702b837b8b Remove all dot-folder imports everywhere
We aren't supposed to import from '.' or '../..' etc; point to the actual node being imported instead. I did allow e.g. '../../bigfolder' however. Going all the way to the individual file could be done too, but is a matter of taste perhaps.

Also ran Organize Imports on all the touched files :)

No changeset since there are no functional changes at all - only the imports changed

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-03-10 13:43:59 +01:00
dependabot[bot] 7616988312 chore(deps): bump knex from 0.21.18 to 0.95.1
Bumps [knex](https://github.com/knex/knex) from 0.21.18 to 0.95.1.
- [Release notes](https://github.com/knex/knex/releases)
- [Changelog](https://github.com/knex/knex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/knex/knex/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2021-03-08 10:26:45 +01:00
Himanshu Mishra ea3d406038 Merge pull request #4714 from erdoganoksuz/feature/OpenStackSwiftPublisher 2021-03-05 07:57:36 +00:00
Adam Harvey 26e23b2c7d Refactor logging
Signed-off-by: Adam Harvey <adam.harvey@dxc.com>
2021-03-04 14:23:01 -05:00
erdoganoksuz e36ef00fd0 router case added and hasDocsBeenGenerated fixed
Signed-off-by: Mert Can Bilgiç <mert.bilgic@trendyol.com>
2021-03-03 11:46:12 +03:00
Patrik Oldsberg ae30b916df Merge pull request #4731 from erikxiv/fix/techdocs-static-url
Techdocs static docs should use external url
2021-03-01 19:26:25 +01:00
Patrik Oldsberg 570d310c90 Merge pull request #4621 from nhidtran/enhancement/4423
Enhancement/4423: remove the usage of res.send() for res.json()
2021-03-01 17:54:09 +01:00
Erik Larsson 74534a0f8c Move auth token to contrib 2021-03-01 12:29:59 +01:00
Erik Larsson f18b51d932 set and use access-token cookie 2021-03-01 12:29:59 +01:00
Erik Larsson e937c1b4f0 fix: use external url for static docs 2021-02-28 23:34:21 +01:00
NHI TRAN ac67aab5dd PR updates
PR updates

fix failing test
2021-02-22 10:23:26 -05:00
NHI TRAN e6fe13c675 upstream master 2021-02-21 13:21:37 -05:00
NHI TRAN f43192207a enhancement: 4423 switch sending back data from server to res.json() instead of res.send()
changeset
2021-02-19 17:05:14 -05:00
Himanshu Mishra b16b096f58 TechDocs: Add etag to techdocs_metadata.json 2021-02-15 19:38:07 +01:00
Himanshu Mishra b73b0fe979 techdocs: don't swallow errors other than NotModifiedError 2021-02-10 12:21:14 +01:00
Himanshu Mishra 08142b2568 TechDocs: Add changesets for deprecation and proper caching 2021-02-10 11:02:40 +01:00
Himanshu Mishra f8a4a30fb0 TechDocs: Update tests for proper url preparer caching 2021-02-10 11:02:40 +01:00
Himanshu Mishra 50fcdc48b4 TechDocs: Warn when using legacy git preparer and dir preparer in backstage.io/techdocs-ref
Context: https://github.com/backstage/backstage/issues/4409
2021-02-10 11:02:40 +01:00
Himanshu Mishra 057af3cac0 TechDocs: Implement etag based caching for git preparer
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-02-10 11:02:40 +01:00