Skip to content

[Feat]: Add Search Collator for Harness resources #66

Description

@stephanschielke

🔖 Feature description

Add a search collator that is able to index all projects, pipelines, services, and other resources available in Harness.

🎤 Context

The search feature of Backstage can be extended with new search index items.
Users frequently use the search in Harness to find pipelines or services etc. but struggle to find items if they don't exactly know where they are stored in Harness. It would be beneficial if the backstage search could find those items.

✌️ Possible Implementation

Search collators should be implemented in a backstage backend plugin. However, no backend plugin yet exists. It could be named harness-backend-common

plugins/harness-backend-common/src/search/HarnessCollatorFactory.ts

class HarnessCollatorFactory implements DocumentCollatorFactory {

  async getCollator() {
    return Readable.from(this.execute());
  }

}

packages/backend/src/plugins/search.ts

import { HarnessCollatorFactory } from '@harnessio/backstage-plugin-backend-commong';
...
    indexBuilder.addCollator({
      schedule,
      factory: HarnessCollatorFactory.fromConfig(env.config, {
        logger: env.logger,
        discovery: env.discovery
      }),
    });

packages/app/src/components/search/SearchPage.tsx

          <Grid item xs={3}>
            <SearchType.Accordion
              name="Result Type"
              defaultValue=""
              types={[
                {
                  value: 'harness',
                  name: 'Harness',
                  icon: <DocsIcon/>,
                },
              ]}
            />
...
                      case 'harness':
                        return (
                          <HarnessResultListItem
                            key={document.location}
                            result={document}
                            highlight={highlight}
                            rank={rank}
                          />
                        );

I'm happy to work on this, though don't know how to best add a new backend plugin to this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions