Skip to content

feat: allow adding/removing usages by path#154

Open
andrius-puksta-sensmetry wants to merge 2 commits intomainfrom
ap/add-path
Open

feat: allow adding/removing usages by path#154
andrius-puksta-sensmetry wants to merge 2 commits intomainfrom
ap/add-path

Conversation

@andrius-puksta-sensmetry
Copy link
Collaborator

@andrius-puksta-sensmetry andrius-puksta-sensmetry commented Jan 7, 2026

Users want to do this anyway (at least for experimenting), so might as well accomodate them.

Changes

  • Add --path argument to add and remove that allows adding/removing path usages by converting them to file:// URL. Recommend using workspaces instead of paths.
  • Guide users to use path usage (both for add and remove) if IRI parsing fails
  • Fail when building a kpar if path usages are present, unless --allow-path-usage is passed (in that case a warning is still produced)
  • Guide users to use init instead of new (sysand new was mentioned in AoSysML, so this at least gives users something actionable)
  • Add docs about supported IRIs
  • (unrelated) Add workspace docs

Fixes

@victor-linroth-sensmetry
Copy link
Collaborator

So while using file urls for quick experimentation is fine, it's non-portable so generally bad practise and should not be encouraged. As such I would prefer not to have a nice and simple flag like --path for this, and instead have something with a bit more friction to it.

If we are to use a --path flag it should be part of the more general configuration of sources I've been working on (I've not committed to a UI for that though and will want some feedback before finalising).

@tilowiklundSensmetry
Copy link
Member

So while using file urls for quick experimentation is fine, it's non-portable so generally bad practise and should not be encouraged. As such I would prefer not to have a nice and simple flag like --path for this, and instead have something with a bit more friction to it.

If we are to use a --path flag it should be part of the more general configuration of sources I've been working on (I've not committed to a UI for that though and will want some feedback before finalising).

I do think we need something that is (equivalently) easy to use for learning purposes, and --path is sort of the only thing I can think of.

A complex alternative option would be to have the Sysand client maintain some sort of "local index" that the user can either install, or register projects to. This is sort of doable already (using env install), but would need to be made a bit more ergonomic.

@vytautas-astrauskas-sensmetry
Copy link
Collaborator

vytautas-astrauskas-sensmetry commented Jan 8, 2026

warn when building a kpar if path usages are present

I strongly believe that if we allow adding usages with path argument, this should be a hard error because URIs are global, so such kpar is (almost surely) unusable outside of the computer on which it was created.

Also, in the documentation we probably should recommend using workspaces instead.

@andrius-puksta-sensmetry
Copy link
Collaborator Author

If we are to use a --path flag it should be part of the more general configuration of sources

But these accomplish different things: this PR simplifies creating a file:// URL, and that PR involves another configuration file (and this should be indicated, preferably in the CLI invocation itself, maybe something like --map-from and --map-to).

@tilowiklundSensmetry
Copy link
Member

Could we add some integration level (i.e. sysand/tests) for this?

@victor-linroth-sensmetry
Copy link
Collaborator

But these accomplish different things: this PR simplifies creating a file:// URL, and that PR involves another configuration file (and this should be indicated, preferably in the CLI invocation itself, maybe something like --map-from and --map-to).

Then call it --file-url? I have no idea what --map-from or --map-to are supposed to mean.

@andrius-puksta-sensmetry
Copy link
Collaborator Author

Then call it --file-url? I have no idea what --map-from or --map-to are supposed to mean.

Agreed that it's not obvious what "map" means. Here it refers to "mapping" (in functional programming sense) "actual" IRIs to "pseudo" IRIs.
Anyway, discussion on exact flag naming for that should go to #130.

@andrius-puksta-sensmetry andrius-puksta-sensmetry changed the title feat: allow adding usages by path feat: allow adding/removing usages by path Jan 28, 2026
@andrius-puksta-sensmetry
Copy link
Collaborator Author

Could we add some integration level (i.e. sysand/tests) for this?

Done

Copy link
Collaborator

@victor-linroth-sensmetry victor-linroth-sensmetry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opps, wrong PR.

@consideRatio
Copy link
Collaborator

There was a mistaken "request changes here", so i dismissed it by re-requesting review from @victor-linroth-sensmetry.

@andrius-puksta-sensmetry let me know if you need help getting this to land in one way or another. It would be great to reduce the open PRs further!

@andrius-puksta-sensmetry andrius-puksta-sensmetry force-pushed the ap/add-path branch 7 times, most recently from 847d083 to 109407c Compare March 12, 2026 11:46
@andrius-puksta-sensmetry andrius-puksta-sensmetry force-pushed the ap/add-path branch 3 times, most recently from 3c28239 to 65e1a44 Compare March 12, 2026 13:35
…are present

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

feat: disallow building if path dependency is detected, but allow to override this

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

chore: update docs

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

chore: update docs

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

docs: add workspace docs to book

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

docs: link to Sysml2 Pilot implementation

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

test: add tests for adding/removing path usages and building a project with them

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

build: bump MSRV and rust-toolchain to 1.93

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

fix: satisfy clippy by using if-let chains

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

docs: don't claim all crashes are bugs

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

docs(book): use standard warning style

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

fix typo

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

wip: add ProjectContext and use it to derive `nominal_path`

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

fix: support cloning git sources

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

fix(docs): be more specific about git support

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

git usages are now supported

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

improve usage sources docs

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

improve usage sources docs

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

wip: propagate sources errors

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>

fix compilation errors

Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sysand add urn:kpar:sysmod broken

5 participants