italia / italia/publiccode-parser-go
Support for Mercurial repositories
- Dominant language
- Go
- Stars
- 23
- Forks
- 10
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 18
Description
Dear all,
I have just created a `publiccode.yml` for the [Orthanc](https://orthanc.uclouvain.be/) project, [at the following location](https://orthanc.uclouvain.be/hg/orthanc/file/tip/publiccode.yml).
When I run the validator on this file, I get:
```text
$ docker run -i italia/publiccode-parser-go /dev/stdin < publiccode.yml
publiccode.yml:3:1: error: url: is not a valid code repository
```
But, the `url` indeed refers to a valid [Mercurial source code repository](https://orthanc.uclouvain.be/hg/orthanc/).
This seems to indicate that `publiccode-parser-go` does not feature support for Mercurial repositories. To validate whether the `url` is valid for Mercurial, one could check whether the `?cmd=capabilities` query string is accessible under the provided URL, while `?cmd=nope` returns a 400 HTTP status code. The `?cmd=capabilities` query string indeed serves as a starting point for the Mercurial binary protocol. For instance:
```text
$ curl https://orthanc.uclouvain.be/hg/orthanc/?cmd=capabilities
batch branchmap bundle2=HG20%0Abookmarks%0Achangegroup%3D01%2C02%2C03%0Acheckheads%3Drelated%0Adelta-compression%3Dnone%2Czlib%2Czstd%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Aphases%3Dheads%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps%0Astream%3Dv2 changegroupsubset compression=zstd,zlib getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
$ curl -w '%{http_code}' -o /dev/null -s https://orthanc.uclouvain.be/hg/orthanc/?cmd=nope
400
```
Kind Regards,
Sébastien-
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.