Repository navigation
feat: ECMA-427 package identities (pkg:generic with the Annex B.3.5 vcs_url qualifier) - #2
Conversation
…reading pkg:sysand resolution, the index discovery and credential code behind it, the index emit command and the -index flags are gone; remote .kpar downloads keep their netrc credentials. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…l qualifier The canonical identity of a repository package is pkg:generic/<name>?vcs_url=<vcs>+<transport>://<host>/<path>[@<version>][#<subpath>] with the qualifier percent-encoded; pkg:git/<host>/<path> and the bare vcs_url notation are accepted as input and normalised to it, and `add` writes the canonical form. pkg:svn, pkg:hg, scp-style, ssh://, plain http(s) clone URLs and file:// repositories are refused with a message naming the accepted spellings; <vcs>+file:/// addresses a repository on this machine. Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
README, docs/packages.md and AGENTS.md describe the pkg:generic identity with the Annex B.3.5 vcs_url qualifier and its two input spellings, name what was removed, and cite ECMA-427 Clause 5 / Annex B.3.5 and KerML 1.1 §10.3 Table 12; changelog fragments for the change and the removals. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
There was a problem hiding this comment.
Note
Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.
Devin Review found 6 potential issues.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
| default: // git, ssh | ||
| return transport + "://" + host + "/" + p |
There was a problem hiding this comment.
🟡 SSH Git repositories lose their account
For a Git host requiring git@host, source() connects as the local user. parseVCSURL rejects git+ssh://git@host, leaving those repositories inaccessible without external SSH configuration.
Learn more
Git uses the username in an SSH URL to choose the remote account. This implementation emits ssh://host/path for every git+ssh repository and rejects userinfo in parseVCSURL. On services that require the git account, the OS account is used instead and the clone fails unless the user configured an SSH alias for that host.
Example: A user writes git+ssh://github.com/org/repo@1.0.0 on a machine logged in as alice; Git connects as alice@github.com, not git@github.com. Supplying git+ssh://git@github.com/org/repo@1.0.0 is rejected.
Recommended fix: Define a way to retain the required SSH account in the VCS connection source without placing credentials or provider-specific data in the canonical package identity. Verify both bare and canonical spellings retain that connection behavior.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Confirmed as described: git+ssh://host/path connects as the local user and git+ssh://git@host/path is refused, so a host that requires the git account needs Host … User git in ~/.ssh/config. The refusal follows ECMA-427 Annex B.3.5 (a user name or password in the vcs_url host is unsupported). Whether to stay strict and document the ssh-config route, or accept a bare user name without a password for the +ssh transports as input sugar (pip's notation), is a maintainer decision; leaving this thread open until it is made.
- lock resources that still parse as a repository are canonicalised on read, so a lock written with an alias spelling matches offline - a git+http(s) path is cloned exactly as written; only <name> drops .git - download errors show the archive URL without user info or query - user:password@ in an http(s) .kpar IRI is refused in favour of the netrc - after a redirect to another origin only an explicit netrc machine entry is sent, never the default entry Co-Authored-By: jason.han <hanhuijun@gmail.com>
…p; lock migration restores a .git suffix kept only in source Co-Authored-By: jason.han <hanhuijun@gmail.com>
… ignores a .git suffix Co-Authored-By: jason.han <hanhuijun@gmail.com>
… is the requested location Co-Authored-By: jason.han <hanhuijun@gmail.com>
…tion, rewrite it on reuse Co-Authored-By: jason.han <hanhuijun@gmail.com>
Summary
Package identities become ECMA-427 Package-URLs. A repository package is identified by the
generictype carrying the Annex B.3.5vcs_urlqualifier:with the qualifier value percent-encoded (every byte outside
A-Z a-z 0-9 - . _ ~and:becomes%XX, as in the purl canonical form; e.g.pkg:generic/OpenSysML-Extensions-Library?vcs_url=git%2Bhttps:%2F%2Fgithub.com%2FOpen-MBEE%2FOpenSysML-Extensions-Library%401.0.0).<name>is the last segment of the repository path with a.gitsuffix stripped; the path itself is kept and cloned exactly as written (…/repoand…/repo.gitare two locations);<version>is a tag naming a semantic version (v<semver>or<semver>); a commit id is refused with a message saying so. The vcs_url schemes are those of Annex B.3.5 (git, git+git, git+https, git+http, git+ssh; hg+http, hg+https, hg+static-http, hg+ssh; svn, svn+svn, svn+http, svn+https, svn+ssh) plus<vcs>+file:///pathfor a repository on this machine (pip's notation, which Annex B.3.5 says the syntax follows). Resource IRIs follow KerML 1.1 §10.3 Table 12:resourceis an IRI identifying the project; a dereferenceablehttp(s)IRI is only ever read as a project interchange file (.kpar), anduser:password@in it is refused (credentials belong in the netrc).Accepted inputs (
syspi addand.project.jsonusages;addwrites the canonical form):pkg:generic/<name>?vcs_url=…(any valid percent-encoding, e.g.%3Afor:);pkg:git/<host>/<path>[@<version>][#<subpath>], an alias forgit+https;git+https://…,git+ssh://…,git://…,hg+https://…,hg+static-http://…,svn://…,svn+https://…,svn+ssh://…,<vcs>+file:///…, each with optional@<version>and#<subpath>.Removed inputs, each refused with a message naming the accepted spellings:
pkg:svn/…,pkg:hg/…,pkg:sysand/…, plainhttps://host/path[.git]@vclone URLs,ssh://…, scp-stylegit@host:path,file:///path@vand/path@vrepositories,pkg:git//<local path>.Removed features:
pkg:sysandresolution, the static index client (discovery, URL templates, index credentials),syspi index emit, the-index/-no-indexflags and index environment variables,.sysand/lib/reading. Remote.kpardownloads keep their netrc credentials.Lock entries keep
vcs,source,tag,revision,sha256;resourceis the canonical purl without its version. A lock entry is matched to a usage by one repository key (origin.Key: the identity with a.gitsuffix dropped from the repository path), applied to the lock as read (keyResources), so a lock written in an older spelling (pkg:git/…, baregit+https://…) or with the other.gitspelling still matches its usage and the installed tree offline, provided the entry's recordedsourceis the requested location (lockedRepositorycompareslocationKey: a<vcs>+scheme prefix, host case and the file scheme are ignored, so an oldergit+ssh://…source still matchesssh://…, while…/repoand…/repo.gitstay two repositories and never serve each other's tree); the entry is then written under the usage's identity and current source spelling. Install naming is unchanged (lib/<publisher>-<name>_<version>).netrc for
.kpardownloads: credentials are matched per host; after a redirect to another origin only an explicitmachineentry is sent, never thedefaultentry. URLs in diagnostics are shown without user info or query (netrc.RedactURL).Open point for the maintainer (review thread left open):
git+ssh://git@host/pathis refused per Annex B.3.5, so a host that requires thegitaccount needsHost … User gitin~/.ssh/config; the alternative is accepting a bare user name (no password) for the+sshtransports as input sugar.Gate
go build ./...,go vet ./...,gofmt -l .empty,SYSPI_REQUIRE_VCS=1 go test ./...ok (unit: parse/normalise/encode round-trip of every accepted input and the refusals ininternal/origin, lock canonicalisation, netrc redirect and redaction; e2e: git, hg and svn fixtures viagit+file,hg+file,svn+file, git over dumb HTTP asgit+http://…, hg ashg+static-http://…, svn assvn://…).Real check
Two fresh projects, one
addeach, against the released v1.0.0 of OpenSysML-Extensions-Library:Both
.project.jsonfiles carry the canonical usagepkg:generic/OpenSysML-Extensions-Library?vcs_url=git%2Bhttps:%2F%2Fgithub.com%2FOpen-MBEE%2FOpenSysML-Extensions-Library%401.0.0; the lock'sresourceis the version-free form with"source": "https://github.com/Open-MBEE/OpenSysML-Extensions-Library","tag": "v1.0.0","revision": "b36b361f85af4764de8e2817cbae62fb9e74ffdb". Re-run after the review round with the same result.