K-Phoen / backstage-plugin-confluence

Confluence plugins for backstage
MIT License
55 stars 15 forks source link

Support supplying a query to limit pages to be indexed #127

Open margueritepd opened 1 year ago

margueritepd commented 1 year ago

Hello! Hoping you will either accept or give feedback on this change! Thank you for your work on this plugin.

Context

At my organization, we want the Docs search in Backstage to be a fresh start. So we only want to index old confluence pages that we know are high quality. This plugin already supports filtering by space but this is not specific enough for our needs.

This change

This change supports an additional CQL query to be configured in app-config.yaml which will further limit the pages returned beyond what the user passes in for the spaces config option. This will allow us to tag the pages that we want indexed in backstage.

edge cases

I'm not sure there is a way of properly escaping input from config parameters to avoid injection of values causing the query to behave in unexpected ways (eg a quote in a space name). I don't think this is a problem since the query is being passed to the REST GET search endpoint so I don't imagine it could do much damage but I'm happy to hear feedback on that.

Testing

I didn't write any automated tests since I'm a node beginner and I didn't find existing tests to add to.

For manual testing, I tried the following:

Is there other testing you'd like me to do?

Djiit commented 7 months ago

Hey @K-Phoen , I'd like to use this too. Anything I could to to help get this merged? Thanks.