harness / harness/backstage-plugins
[Feat]: Add Search Collator for Harness resources
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 39
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
🔖 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed plugins/harness-backend-common/src/search/HarnessCollatorFactory.ts and review the integration points in packages/backend/src/plugins/search.ts and packages/app/src/components/search/SearchPage.tsx. Done means a backend collator indexes Harness projects, pipelines, services, and other resources, and the search page presents Harness results through the proposed result type and component.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, search
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100