clearlydefined / service

The service side of clearlydefined.io
MIT License
45 stars 40 forks source link

define expectations around case-sensitivity for coordinates #1169

Open elrayle opened 1 month ago

elrayle commented 1 month ago

Description

It is unclear if CD is handling case-sensitivity for coordinates consistently. This issue seeks to define what is expected and evaluate whether that is sufficient. This includes observations about how it is being handled by the various systems and how package managers expect case variations to be handled.

elrayle commented 1 month ago

Observations for Go coordinates

Example: github.com/SAP/jenkins-library@v1.91.0

Source: pkg.go.dev

Example where pkg.go.dev has two packages with different case. From pkg.go.dev perspective, these are different packages. In actuality, they go to the same github repo.

NOTE: I was not able to find either of these in CD.

Azure blob storage (always case sensitive)

case sensitive - For the example, only has blobs for go/golang/github.com%2fsap/jenkins-library/v1.91.0. This includes containers: production, production-definition, changes-notifications.

CosmosDB _id (case sensitive)

(can configure a case-insensitive index, but one has not been configured)

Finds: with sap

Image

Does NOT Find: with SAP

Image

/definitions endpoint (case insensitie)

with body:

[ 
  "go/golang/github.com%2fSAP/jenkins-library/v1.91.0", 
  "go/golang/github.com%2fsap/jenkins-library/v1.91.0" 
]

Both return the exact same definition. The only difference is in the results, the attribute name for each matches the passed in case.

partial results:

{
    "go/golang/github.com%2fSAP/jenkins-library/v1.91.0": {
        "described": {
            "releaseDate": "2020-10-05",
            "urls": {
                "registry": "https://pkg.go.dev/github.com/sap/jenkins-library",
                "version": "https://pkg.go.dev/github.com/sap/jenkins-library@v1.91.0",
                "download": "https://proxy.golang.org/github.com/sap/jenkins-library/@v/v1.91.0.zip"
            },
            ...
    },
    "go/golang/github.com%2fsap/jenkins-library/v1.91.0": {
        "described": {
            "releaseDate": "2020-10-05",
            "urls": {
                "registry": "https://pkg.go.dev/github.com/sap/jenkins-library",
                "version": "https://pkg.go.dev/github.com/sap/jenkins-library@v1.91.0",
                "download": "https://proxy.golang.org/github.com/sap/jenkins-library/@v/v1.91.0.zip"
            }
            ...
    }
}

UI definition (case insensitive)

Both URLs go to the same definition page, but the URL is maintained in the case used to open the page.

If you view the Raw Data for both, they are exactly the same, with the coordinates using the lower case version of sap

Image

UI search

Cannot test. Using jenkins-library as the search term returns nothing. Using sap returns packages named sap in other package managers.

/definitions search (case sensitive)

Searching with provider using sap finds results:

Image

Image

Searching with provider using SAP does not find results:

Image

Image