Commit Graph

130 Commits

Author SHA1 Message Date
Himanshu Mishra 15d23c004e Merge remote-tracking branch 'origin/master' into orkohunter/techdocs-publish-to-cloud-storage 2020-12-10 21:12:31 +01:00
github-actions[bot] cf187484bf Version Packages 2020-12-10 11:25:39 +00:00
Himanshu Mishra ac88ca2038 Merge branch 'master' into orkohunter/techdocs-publish-to-cloud-storage 2020-12-09 20:17:06 +01:00
Himanshu Mishra 24bcdd0829 techdocs: Use googleGcs for publisher type instead of google_gcs 2020-12-09 18:58:12 +01:00
Himanshu Mishra 9bd130a73a techdocs: Use 'local' and 'external' for alternatives for techdocs.builder config
Co-authored-by: freben <freben@gmail.com>
2020-12-09 12:31:40 +01:00
Frieder Bluemle cbd3a44c09 Fix typos (#3646) 2020-12-09 07:50:41 +01:00
Adam Harvey 8b395bee26 Add standard NPM metadata 2020-12-08 13:42:23 -05:00
David Tuite 03e264519a Fix techdocs for url locations (#3589)
Pasting a URL like `https://github.com/RoadieHQ/sample-service/blob/master/catalog-info-1.yaml`
into the Register Existing Component input creates an Entity with the
the `backstage.io/managed-by-location` annotation set to the `type` of
`url.

The TechDocs perparer does not handle this type.

```ts
    switch (type) {
      case 'github':
      case 'gitlab':
      case 'azure/api': {
        // ...
      }

      case 'file':
        // ...
      default:
        throw new InputError(`Unable to resolve location type ${type}`);
    }
  }
```

Thus, docs are never generated and we see the following error when
trying to view then in Backstage.

```
InputError: Unable to resolve location type url at DirectoryPreparer.resolveManagedByLocationToDir (webpack-internal:///../../node_modules/@backstage/plugin-techdocs-backend/src/techdocs/stages/prepare/dir.ts:63:15) at DirectoryPreparer.prepare (webpack-internal:///../../node_modules/@backstage/plugin-techdocs-backend/src/techdocs/stages/prepare/dir.ts:73:51) at DocsBuilder.build (webpack-internal:///../../node_modules/@backstage/plugin-techdocs-backend/src/service/helpers.ts:74:45) at eval (webpack-internal:///../../node_modules/@backstage/plugin-techdocs-backend/src/service/router.ts:141:25) at processTicksAndRejections (internal/process/task_queues.js:93:5)
```

This may not be the correct solution. An alternative solution would be
to ensure that pasted URLs end up with the `type` of `github` rather
than `url`.
2020-12-07 11:46:40 +01:00
Himanshu Mishra 372160ede5 Update README of all three techdocs packages/plugins 2020-12-05 18:07:50 +01:00
Himanshu Mishra ff3dd9c02b create-app: Add new techdocs default configs 2020-12-05 11:13:27 +01:00
Himanshu Mishra a212e43142 techdocs: Add JSON Schema config
Show better error if techdocs.builder is set to 'ci' and if no docs are found.
Return 404 from googleStorage client when a file is not found.
2020-12-05 10:48:54 +01:00
Himanshu Mishra c91fd25a53 techdocs-backend: Fix logic to determine if docs have been published 2020-12-04 22:37:14 +01:00
Himanshu Mishra 07e7c201e8 techdocs-backend: Wait for some time before published files show up in storage 2020-12-04 22:01:45 +01:00
Himanshu Mishra 8ffbbcee59 Merge remote-tracking branch 'origin/master' into orkohunter/techdocs-publish-to-cloud-storage 2020-12-04 19:51:01 +01:00
Joel Low 1e22f8e0b8 Fix conflicting dockerode version specifications 2020-12-04 16:45:15 +08:00
Himanshu Mishra f0bfd369b3 Merge remote-tracking branch 'origin/master' into orkohunter/techdocs-publish-to-cloud-storage 2020-12-03 22:53:45 +01:00
Himanshu Mishra 084670b37a Google Cloud Storage working with TechDocs (publish and fetch)
Plus
1. Introduce ncessary configs to connect with storage
2. Introduce config to prefer CI build of docs, or techdocs-backend to build and publish them.
3. Write guide how to use Google Cloud Storage with TechDocs
4. Add a TechDocs Configuration reference page in docucmentation
2020-12-03 22:40:15 +01:00
github-actions[bot] 01aa774d9a Version Packages 2020-12-03 15:28:22 +00:00
Sebastian Qvarfordt eeecfbf4a6 Cache techdocs build using UrlReader (#3551)
* Better caching is coming when some backstage core features are in place. Currently let's just cache it for 30 minutes

* Fixed prettier
2020-12-03 15:00:03 +01:00
Himanshu Mishra e09cff1682 Abstract Publisher APIs from the router
1. Move fetchMetadata and serve static files to local publisher
2. Create factory class to create publishers based on app cofig
2020-12-02 13:05:44 +01:00
Himanshu Mishra 64737f447a App/Backend should import techdocs plugin only, not common package
If a backstage App wants to enable techdocs plugin, it should only have to care about installing @backstage/plugin-techdocs and @backstage/plugin-techdocs-backend.
@backstage/plugin-techdocs-backend should re-export necessary APIs from techdocs-common
2020-12-01 20:48:58 +01:00
Himanshu Mishra 7481601883 techdocs-backend: Add non-zero tests for the CI to pass 2020-12-01 20:48:58 +01:00
Himanshu Mishra ff348df9fe techdocs-common: Initialize package and move common code from techdocs-backend 2020-12-01 20:48:58 +01:00
Himanshu Mishra 9ebc897351 TechDocs: Refactor Publisher to pave way for external publishers 2020-12-01 20:48:58 +01:00
Himanshu Mishra 21f86aa478 Merge pull request #3337 from adrianke77/master 2020-12-01 09:48:02 +01:00
Chongyang Adrian, Ke ae95c7ff3e techdocs-backend: update Gitlab clone auth 2020-12-01 10:18:33 +08:00
github-actions[bot] 892645b815 Version Packages 2020-11-27 12:51:09 +00:00
Himanshu Mishra dbca620ff9 Use fs-extra and async file read method 2020-11-26 20:41:40 +01:00
Himanshu Mishra 4b53294a6c TechDocs: Update mkdocs.yml with repo_url when possible before building docs 2020-11-26 10:55:38 +01:00
Himanshu Mishra 266e93b478 TechDocs: Refactor metadata retrieval
1. Don't use mkdocs in name of APIs or variables. It is an implementation detail and liable to change in future.
2. techDocsApi.getMetadata('mkdocs') and techDocsAPI.getMetadata('entity') should be two separate functions just because their responses differ in structure. They should also be type checked.
3. Use either 'techdocs' or 'TechDocs' consistently. 'techDocs' seems like an unnecessary third way to write TechDocs, which can be avoided.
4. Remove unused /plugins/techdocs-backend/src/service/metadata.ts file
2020-11-25 19:39:48 +01:00
Fredrik Adelöw fae3fafcfa silence some new ts squigglies in the editor (#3435) 2020-11-25 09:57:16 +01:00
Himanshu Mishra 8fd5e64351 TechDocs: Tell users when index.md is missing (better error message) (#3429)
* TechDocs: Logger already prints the name of plugin

* TechDocs: Display a custom error message if provided

* TechDocs: throw custom error message if index.md is not present

* Language improvements. Thanks @freben

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

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
2020-11-25 09:52:19 +01:00
github-actions[bot] fefb0e18e0 Version Packages 2020-11-24 10:17:02 +00:00
github-actions[bot] bc0f47b7b7 Version Packages 2020-11-19 15:13:57 +00:00
Himanshu Mishra f8877545c5 TechDocs: Reject promise if call to getBaseUrl fails 2020-11-18 20:35:22 +01:00
Himanshu Mishra 66daa47c6a 1. Remove DiscoveryApi (frontend) and use PluginEndpointDiscovery(SingleHostDiscovery) (backend)
2. Mock class for testing
2020-11-18 20:29:07 +01:00
Himanshu Mishra 3b314807c6 TechDocs: Use discovery instead of config to read base url 2020-11-17 21:03:56 +01:00
Himanshu Mishra c01bf361a4 Modify tests to include new config param in LocalPublish 2020-11-17 20:19:30 +01:00
Himanshu Mishra 65edcdee22 TechDocs: Remove hardcoded backend URL from techdocs-backend 2020-11-17 20:03:44 +01:00
Patrik Oldsberg bd1cef1847 backend-common: review comments for readTree + switch archive return type to a stream 2020-11-13 00:43:20 +01:00
Patrik Oldsberg b672492e21 backend-common: make .readTree required 2020-11-12 13:59:10 +01:00
Patrik Oldsberg 6417d966bb backend-common,techdocs-backend: refactor .readTree to accept options and implement GitHub reader with response utils 2020-11-12 13:53:22 +01:00
Patrik Oldsberg e74422b4d8 backend-common: make ReadTreeResponse.files async 2020-11-12 12:27:33 +01:00
Sebastian Qvarfordt f059eaf755 readTree method on UrlReader (#2925)
* Basic implementation of readTree on github and use it in techdocs

* Added a UrlPreparer and cleaned up some minor things

* Download entire archive and filter out the wanted files in readTree

* Added test for dir output of tree reader

* Fixed formatting

* Fixed formatting

* Some cleanups and fixes

* Fix typing issues

* Fix prettier

* Fix prettier

* Removed unused dependency

* Fixed comments on PR

* Prettier

* Moved @types/fs-extra to devDeps

* Fixed another PR comment

* Added a test for getDocFilesFromRepository

* Prettier
2020-11-09 16:28:51 +01:00
github-actions[bot] 715bb76fb5 Version Packages 2020-11-03 20:50:42 +00:00
Patrik Oldsberg 8360d9f7e2 Merge pull request #3140 from backstage/rugvip/release
Release v0.1.1
2020-11-03 13:28:03 +01:00
Patrik Oldsberg af141c0766 rewrite repo location urls 2020-11-03 11:03:49 +01:00
Himanshu Mishra 09b45677eb Merge pull request #3198 from RoadieHQ/techdocs-backend-url-fix
Use discovery api to build URLs in techdocs
2020-11-02 13:51:03 +01:00
Iain Billett 65792dd070 Use discovery api to build URLs in techdocs
Use the discovery api to build catalog API URLs and URLs to locally published
metadata.
2020-11-02 10:59:51 +00:00
Oliver Sand a6da3d1c06 fix: upgrade knex to 0.21.6
This reduces a overly noisy warning during tests: https://github.com/knex/knex/pull/3936
2020-10-29 20:24:49 +01:00