Commit Graph

125 Commits

Author SHA1 Message Date
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
Himanshu Mishra 97a9a7365f TechDocs: Implement etag based caching for url preparer
Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-02-10 11:02:38 +01:00
Himanshu Mishra 66944ec7bf TechDocs: Preparers will take and return an etag for cache invalidation 2021-02-10 11:01:18 +01:00
Fredrik Adelöw 5a51635197 backend-common: implement UrlReader.search that does glob matching 2021-02-09 12:16:12 +01:00
Himanshu Mishra 38469b66bf techdocs: fix tests by reusing the instantiated discovery 2021-02-02 13:51:05 +01:00
Parth Shandilya e44925723e TechDocs: Make requestUrl and storageUrl optional configs by using discovery APIs
closes #3715

Co-authored-by: Himanshu Mishra <himanshu@orkohunter.net>
2021-02-02 13:51:04 +01:00
Himanshu Mishra 8eb862c58e Merge pull request #4017 from viavarejo/feature/techdocs-azure-storage 2021-01-31 16:03:24 +01:00
vitorgrenzel 59b8d5a0d9 feat(techdocs-common): add Azure Blob Storage 2021-01-28 16:16:22 -03:00
vitorgrenzel c777df180a feat(techdocs-common): add Azure Storage 2021-01-28 16:16:21 -03:00
Himanshu Mishra 03a2d95c71 TechDocs: Update tests with mock url reader 2021-01-28 15:32:09 +01:00
Matei David a5e27d5c1d Introduce techdocs metadata in techdocs-common
* Add TechdocsMetadata type in backend plugin endpoint
 * Introduce TechDocsMetadata type in frontend
 * Add changeset
 * Remove old thennable metadata resp
 * Address PR feedback
  - Remove explicit type annotation on TechDocsMetadata
  - Reintroduce res.send instead of throwing an error
  - Change logger info to logger error
 * Add TechDocsMetadata type in frontend plugin
 * Commit yarn.lock
 * Introduce JSON5 and remove parsing in local pub
Signed-off-by: Matei David <matei.david.35@gmail.com>
2021-01-16 18:33:53 +00:00
Himanshu Mishra cb7af51e73 techdocs: cache docs site when built using urlReader for 30 minutes
This caching makes it usable experience, so that docs are not built on every load.
In future readTree will support a method to fetch the timestamp of the latest HEAD. And
it should be used to invalidate the cache.
2021-01-13 21:09:44 +01:00
Himanshu Mishra 2165901c00 TechDocs: Generator now requires input and output directory and does not create them
The creation of temporary directories and their clean up should be handled on its own. techdocs-cli already has a fixed input output dir requirement. It makes that generator accepts these values as requirements.
2021-01-11 22:33:10 +01:00
Remi b9e6d305e2 fix(techdocs): typos + add tests + requested changes 2020-12-30 10:25:57 +01:00
Remi c4fcd8b180 feat(techdocs-backend): add awsS3 2020-12-30 10:22:12 +01:00
Himanshu Mishra c91e4d6b04 techdocs: Use @backstage/integration for scm tokens and request options 2020-12-28 21:08:54 +01:00
Himanshu Mishra 2ac77aeec2 techdocs-backend: Remove individual preparers and generators from app backend, to use factory methods
When a new Backstage app is setup, the techdocs backend file contains all the preparers (dir, github, gitlab, etc.) and same for generators. While this providers added customizibility, it comes with a cost of complexity in setting up the app backend. New preparers' updates would need users to update their app's techdocs backend file.

Scaffolder backend has already moved to this proposed pattern.
2020-12-17 11:33:56 +01:00
Patrik Oldsberg 1da7d2c657 plugins,packages: replace usages of ConfigReader.from 2020-12-15 19:04:50 +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
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 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