Skip to content

feat: support sysand add/remove PURL shorthand#354

Merged
andrius-puksta-sensmetry merged 3 commits into
sensmetry:mainfrom
consideRatio:pr/add-shorthand
May 27, 2026
Merged

feat: support sysand add/remove PURL shorthand#354
andrius-puksta-sensmetry merged 3 commits into
sensmetry:mainfrom
consideRatio:pr/add-shorthand

Conversation

@consideRatio
Copy link
Copy Markdown
Collaborator

@consideRatio consideRatio commented May 27, 2026

Users can identify indexed packages as publisher/name, but
sysand add previously required the full
pkg:sysand/publisher/name IRI. The CLI also parsed the positional
add locator as an IRI before core add logic could apply add-specific
behavior.

Expand valid Sysand PURL shorthand in the add path so normalized
publisher/name input is stored as the canonical PURL. Reject shorthand
that would require normalization first. Leave other add resources to
existing usage validation. Keep the shorthand scoped to add by leaving
general project usage validation and remove parsing unchanged. Update
CLI parsing, docs, and Python binding coverage for the new add behavior.

@consideRatio consideRatio force-pushed the pr/add-shorthand branch 2 times, most recently from cddcbb0 to 00a2463 Compare May 27, 2026 07:55
Comment thread core/src/commands/add.rs
Comment thread core/src/commands/add_tests.rs
Comment thread sysand/src/commands/add.rs Outdated
@andrius-puksta-sensmetry
Copy link
Copy Markdown
Collaborator

I think sysand remove should also have this to preserve symmetry.

@consideRatio consideRatio changed the title feat: support sysand add package shorthand feat: support sysand add/remove PURL shorthand May 27, 2026
Comment thread core/src/commands/add.rs Outdated
Comment thread sysand/src/commands/add.rs
Comment thread sysand/src/lib.rs Outdated
Comment thread core/src/commands/add_tests.rs
Comment thread sysand/src/cli.rs
Users can identify indexed packages as `publisher/name`, but
`sysand add` and `sysand remove` previously required the full
`pkg:sysand/publisher/name` IRI. Their CLI locators also parsed inputs
as IRIs before core command logic could apply command-specific behavior.

Expand valid Sysand PURL shorthand in the add and remove paths so
normalized `publisher/name` input maps to the canonical PURL. Reject
shorthand that would require normalization first. Leave other resources
to existing command validation. Keep the shorthand scoped to add and
remove by leaving general project usage validation unchanged. Update CLI
parsing, docs, and Python binding coverage for the new behavior.

Signed-off-by: Erik Sundell <erik.sundell+2025@sensmetry.com>
@consideRatio
Copy link
Copy Markdown
Collaborator Author

Hmmm this became more work than I have time to allocate to make deadlines. Do you have time to finalize/re-work it?

Decision required about core change vs CLI change:
a) We adjust add/remove in core, influencing all surfaces
b) We adjust add/remove in CLI only

My take is that this change isn't CLI specific, so it should be implemented in the core layer, but what we do matters less to me than we move forward.

If we would reprompt AI to implement this from scratch, I'd describe it as we want add/remove functionality in the core layer updated to:

  • we ensure normalized publisher/name strings expands to pkg:sysand/publisher/name
  • we error clearly on normalizable but not normalized publisher/name
  • we otherwise don't influence any other behavior (CLI help for "if you meant to use a path" etc is retained)

Comment thread sysand/src/lib.rs
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@andrius-puksta-sensmetry
Copy link
Copy Markdown
Collaborator

Done everything to my liking. Now core do_add/do_remove don't do guessing, there are wrapper functions do_add_guess and do_remove_guess for this. CLI verifies/parses the PURL once.

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@andrius-puksta-sensmetry andrius-puksta-sensmetry enabled auto-merge (squash) May 27, 2026 13:44
@andrius-puksta-sensmetry andrius-puksta-sensmetry merged commit dd85b22 into sensmetry:main May 27, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants