DependencyTrack / DependencyTrack/dependency-track

Improve PURL Component Search

Open
#1,816 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
4.2k
Forks
811
Avg merge
9h 4m
Merged PRs (30d)
229

Description

### Current Behavior:
I have components that look like this:
```
pkg:maven/foo.bar.cat/xxxx@1.0.0?type=jar
pkg:maven/foo.bar.cat/yyyy@1.0.0?type=jar
pkg:maven/foo.bar.cats/xxxx@1.0.0?type=jar
```

It is not possible to search for `cat` without also getting hits on `cats` (that I do not want). The following search would be ideal (because it would exclude `cats`) but it does not work (returns 0 hits):

```
pkg:maven/foo.bar.cat/
```

Tweaking the search (just one character extra) works just fine... but excludes `pkg:maven/foo.bar.cat/yyyy@1.0.0?type=jar`

```
pkg:maven/foo.bar.cat/x
```

### Proposed Behavior:

Allow for PURL component search that can be truncated to the 2nd "/" character.

```
pkg:maven/foo.bar.cat/
```

This enhancement centres around PURL search because I would think that is easiest to fix. But, ideally, it would also useful to be more specific in (default) "coordinates" search by supporting specification of start and end of string. eg

```
^foo.bar.cat
foo.bar.cat$
^foo.bar.cat$
```
(something for a separate enhancement issue?)

Contributor guide

Open the contributing guide

Research direction

The issue names no implementation files, tests, or entry points. Locate the PURL component search handling and its existing search tests, then verify that a query ending at the second slash matches foo.bar.cat while excluding foo.bar.cats and still matching both listed components.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.