Mike Lewis
ada4446733
permission-common: use createCondition helper when creating conditions
...
Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com >
2022-03-22 14:32:38 -04:00
Eric Peterson
7762d54200
Fix TechDocs backend cache bug on HEAD request.
...
Signed-off-by: Eric Peterson <ericpeterson@spotify.com >
2022-03-18 11:23:50 +01:00
Fredrik Adelöw
6565f2c50b
Merge pull request #10147 from rex4539/typos
...
Fix typos
2022-03-15 11:01:46 +01:00
Emma Indal
1bc516bdfb
remove unused import
...
Signed-off-by: Emma Indal <emma.indahl@gmail.com >
2022-03-14 22:39:18 +01:00
Emma Indal
b44692890b
tests fixups
...
Signed-off-by: Emma Indal <emma.indahl@gmail.com >
2022-03-14 22:39:18 +01:00
Emma Indal
b83063afe0
clean up deprecations of techdocs-backend plugin
...
Signed-off-by: Emma Indal <emma.indahl@gmail.com >
2022-03-14 22:39:18 +01:00
Dimitris Apostolou
aedd4daa66
Fix typos
...
Signed-off-by: Dimitris Apostolou <dimitris.apostolou@icloud.com >
2022-03-13 14:12:05 +02:00
Fredrik Adelöw
3c2bc73901
add setupRequestMockHandlers to backend-test-utils
...
Signed-off-by: Fredrik Adelöw <freben@gmail.com >
2022-03-06 17:06:45 +01:00
Eric Peterson
c938e0d61d
Merge pull request #9952 from backstage/iameap/mv-techdocs-search-common
2022-03-04 20:06:39 +01:00
Eric Peterson
3e54f6c436
Use @backstage/plugin-search-common instead of @backstage/search-common
...
Signed-off-by: Eric Peterson <ericpeterson@spotify.com >
2022-03-04 18:47:55 +01:00
Fredrik Adelöw
ed027b8b28
just fix some random ugly comments
...
Signed-off-by: Fredrik Adelöw <freben@gmail.com >
2022-03-04 16:59:57 +01:00
Eric Peterson
91bf1e6c1a
Use @backstage/plugin-techdocs-node instead of @backstage/techdocs-common
...
Signed-off-by: Eric Peterson <ericpeterson@spotify.com >
2022-03-04 09:54:19 +01:00
Fredrik Adelöw
899f196af5
update to use getEntityByRef
...
Signed-off-by: Fredrik Adelöw <freben@gmail.com >
2022-03-03 13:27:25 +01:00
Fredrik Adelöw
36aa63022b
deprecate EntityName, introduce CompoundEntityRef
...
deprecate getEntityName, introduce getCompoundEntityRef
Signed-off-by: Fredrik Adelöw <freben@gmail.com >
2022-03-02 21:54:45 +01:00
Eric Peterson
0087554f5c
Update TechDocs Collator to be stream-based
...
Signed-off-by: Eric Peterson <ericpeterson@spotify.com >
2022-03-02 17:29:13 +01:00
Nikolas Skoufis
eed6b57cf8
Update error message in tests
...
Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au >
2022-03-02 11:10:14 +11:00
Nikolas Skoufis
63bb0a9644
Update comments and logs for shouldBuild
...
Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au >
2022-03-02 10:10:16 +11:00
Nikolas Skoufis
4368196fba
Accept object in shouldBuild for future extensibility
...
Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au >
2022-03-02 10:10:16 +11:00
Nikolas Skoufis
5adcf26b05
Refactor to a private constructor and static fromConfig
...
Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au >
2022-03-01 09:26:07 +11:00
Nik Skoufis
7a22a78180
Apply suggestions from code review
...
Co-authored-by: Emma Indal <emma.indahl@gmail.com >
Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au >
2022-03-01 09:26:07 +11:00
Nikolas Skoufis
588445b175
Exporting interface and adding docs
...
This makes the api reporter happy, with good reason
Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au >
2022-03-01 09:26:07 +11:00
Nikolas Skoufis
54027cb0f6
Merge branch 'master' of github.com:Niksko/backstage into docs-build-strategy
2022-02-27 18:26:57 +11:00
Dede Hamzah
d721f8a458
Update to filter techdocs annotation directly in get entities
...
Signed-off-by: Dede Hamzah <dehamzah@gmail.com >
2022-02-24 10:22:14 +07:00
Dede Hamzah
d2ea0473bf
Add filter parameter in DefaultTechDocsCollator to help limit scanning all entities
...
Signed-off-by: Dede Hamzah <dehamzah@gmail.com >
2022-02-24 10:19:52 +07:00
Fredrik Adelöw
d0582b2d0f
stitch targetRef and backwards compat inject it on read
...
Signed-off-by: Fredrik Adelöw <freben@gmail.com >
2022-02-23 09:38:40 +01:00
Emma Indal
68abf6e837
Update plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts
...
Signed-off-by: Emma Indal <emma.indahl@gmail.com >
Co-authored-by: Eric Peterson <iamEAP@users.noreply.github.com >
2022-02-21 13:24:56 +01:00
Emma Indal
e60175e87a
clean up deprecated code
...
Signed-off-by: Emma Indal <emma.indahl@gmail.com >
2022-02-21 12:06:43 +01:00
Emma Indal
81b6d0fabe
clean up api report
...
Signed-off-by: Emma Indal <emma.indahl@gmail.com >
2022-02-21 12:02:50 +01:00
Nikolas Skoufis
2a865343c2
Add a new interface: DocsBuildStrategy
...
This adds a new interface called DocsBuildStrategy. This strategy allows
for different answers to the question: should the TechDocs backend
perform a build of the given entity?
The default implementation replicates the existing functionality, in
that if the techdocs.builder config value is set to local, then we do
trigger builds, and if the value is set to anything else, we don't
trigger builds. However the strategy has access to the entity, and so
more complex strategies are possible.
This strategy is added as an optional parameter on the RouterOptions
types, and defaults to the DefaultDocsBuildStrategy if unspecified,
allowing for backwards compatibility.
TODO: rename some of the config options, and reword errors to reflect
the new interface
Signed-off-by: Nikolas Skoufis <nskoufis@seek.com.au >
2022-02-16 16:53:33 +11:00
Johan Haals
7aeb491394
catalog-model: deprecate ENTITY_DEFAULT_NAMESPACE, replace with DEFAULT_NAMESPACE
...
Signed-off-by: Johan Haals <johan.haals@gmail.com >
2022-02-15 10:27:57 +01:00
Camila Belo
a2e5b91b1c
Merge pull request #9333 from RoadieHQ/fix-inline-docs-search
...
Fix tech docs inline search on Postgres
2022-02-14 08:17:31 +01:00
Fredrik Adelöw
453145abba
techdocs: do not use cross-fetch in backend
...
Signed-off-by: Fredrik Adelöw <freben@gmail.com >
2022-02-10 16:55:24 +01:00
Jussi Hallila
d1eff62105
Fix tests.
...
Signed-off-by: Jussi Hallila <jussi@hallila.com >
2022-02-03 12:21:54 +01:00
Jussi Hallila
811c710a21
Fix tech docs inline search on Postgres
...
Fix bug where tech docs collator stores search indices with wrong entity ref casing. Make the collator to conform legacyPathCasing configuration option.
Signed-off-by: Jussi Hallila <jussi@hallila.com >
2022-02-03 12:15:12 +01:00
MT Lewis
4682340457
techdocs-backend: support authorization in DefaultTechDocsCollator
...
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com >
2022-01-25 13:01:39 +00:00
Joe Porpeglia
f911a60baf
Update api-report
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
cd3c5b132e
Update package exports to align with ADR004
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
ccaa50511f
Make getCacheKey sync
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
63e8b8605e
Disable catalog permission middleware unless permission.enabled = true
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
17ebcb09cd
Refactor router tests
...
Adds a `createApp` helper instead of creating the express app in `beforeEach`. This allows tests to mock behavior of router creation, like toggling certain middleware based on config values.
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
f1918143e5
Compute cache keys from tokens instead of user entity refs
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
e9857d0b82
Remove 403 handling logic
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
d9afa2e882
Add tests to verify /static/docs behavior
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
c2f54048d1
Use catalog: prefix for catalog entity cache
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
413c9fab08
Cancel cache read if it takes too long
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
f5598677bf
Set cache value asynchronously
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
45f37c9835
Use CachedEntityLoader in techdocs router
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
7dcc6b1fe6
Add CachedEntityLoader for techdocs
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
2022-01-18 12:43:35 -05:00
Joe Porpeglia
b76fec242d
Verify access to related catalog entities for all techdocs api routes
...
Signed-off-by: Joe Porpeglia <josephp@spotify.com >
Co-authored-by: Nataliya Issayeva <nissayeva@users.noreply.github.com >
2022-01-18 12:43:35 -05:00
Fredrik Adelöw
5333451def
Got rid of the last brace-typed and hyphen-less params etc
...
Signed-off-by: Fredrik Adelöw <freben@gmail.com >
2022-01-10 09:48:12 +01:00