community-plugins icon indicating copy to clipboard operation
community-plugins copied to clipboard

fix(search-backend-module-confluence-collator): refine CQL query generation for spaces and query

Open dfl-aeb opened this issue 7 months ago • 1 comments

Hey, I just made a Pull Request!

Fixes #4016

Previously, the Confluence collator would generate an invalid CQL query of the form () and (label="test") if the spaces configuration was empty or not provided, but a query was specified. This resulted in no search results.

This commit refines the CQL query generation logic to correctly handle different combinations of spaces and query parameters:

  • If only spaces are provided, the query will be space=S1 or space=S2.
  • If only query is provided, the query will be your_query_here.
  • If both spaces and query are provided, they will be combined as (space="S1" or space="S2") and (your_query_here).
  • If neither is provided, the default query to fetch all content types (type IN (page, blogpost, comment, attachment)) is used.

Additionally, new test cases have been added to cover these scenarios, and the plugin documentation has been updated to clarify the behavior of these parameters.

:heavy_check_mark: Checklist

  • [x] A changeset describing the change and affected packages. (more info)
  • [x] Added or updated documentation
  • [x] Tests for new functionality and regression tests for bug fixes
  • [ ] Screenshots attached (for UI changes)
  • [x] All your commits have a Signed-off-by line in the message. (more info)

dfl-aeb avatar May 19 '25 13:05 dfl-aeb

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-search-backend-module-confluence-collator workspaces/confluence/plugins/search-backend-module-confluence-collator patch v0.10.0

backstage-goalie[bot] avatar May 19 '25 13:05 backstage-goalie[bot]

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Jun 02 '25 18:06 github-actions[bot]

Hey @vinzscam or @fjudith,

could you have a look at this pr? It's only a small fix, but it would help us start using the plugin.

dfl-aeb avatar Jun 02 '25 18:06 dfl-aeb

@vinzscam friendly reminder.

dfl-aeb avatar Jun 11 '25 11:06 dfl-aeb

@vinzscam I had to rebase. Could you please approve again and merge it?

dfl-aeb avatar Jun 17 '25 10:06 dfl-aeb

@vinzscam the Github workflow seems to be stuck. Any idea on how to resolve the issue ?

fjudith avatar Jun 18 '25 11:06 fjudith

@vinzscam friendly Reminder

dfl-aeb avatar Jun 26 '25 15:06 dfl-aeb

Can you help out here, @fjudith? I don't understand what still needs to be done.

I guess @vinzscam needs to approve the last pending workflow and then merge it?

dfl-aeb avatar Jul 15 '25 08:07 dfl-aeb

Hello @awanlin and @vinzscam !

Could you please help us int getting this PR merged ?

fjudith avatar Jul 15 '25 16:07 fjudith

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

github-actions[bot] avatar Jul 30 '25 00:07 github-actions[bot]

Not stale, we're so close ... @vinzscam @awanlin

dfl-aeb avatar Jul 30 '25 06:07 dfl-aeb

@stanley-nicholl thanks for the approval. What needs to be done to get it merged?

dfl-aeb avatar Aug 04 '25 09:08 dfl-aeb

@dfl-aeb, just needs an official maintainer approval. Should be merged by today or tomorrow. Thanks for doing this!!

stanley-nicholl avatar Aug 04 '25 09:08 stanley-nicholl