Skip to content

feat: add index management commands#335

Merged
consideRatio merged 13 commits into
sensmetry:mainfrom
Jonas-Puksta-Sensmetry:pr/index-management
May 24, 2026
Merged

feat: add index management commands#335
consideRatio merged 13 commits into
sensmetry:mainfrom
Jonas-Puksta-Sensmetry:pr/index-management

Conversation

@Jonas-Puksta-Sensmetry
Copy link
Copy Markdown
Collaborator

@Jonas-Puksta-Sensmetry Jonas-Puksta-Sensmetry commented May 13, 2026

@Jonas-Puksta-Sensmetry Jonas-Puksta-Sensmetry force-pushed the pr/index-management branch 3 times, most recently from 20e5dcc to 494e940 Compare May 14, 2026 05:48
@Jonas-Puksta-Sensmetry Jonas-Puksta-Sensmetry marked this pull request as ready for review May 15, 2026 05:26
@Jonas-Puksta-Sensmetry
Copy link
Copy Markdown
Collaborator Author

@andrius-puksta-sensmetry @consideRatio I'll add more tests and update documentation, but other parts are ready for review

Copy link
Copy Markdown
Collaborator

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

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

Nice @Jonas-Puksta-Sensmetry!!

I let codex make two PRs reflecting the two main non-blocking feedback points I had:

  1. I see index_utils.rs to contain shared data models between env/index.rs and commands/index/..., but think _utils doesn't reflect that, so I refactored it into index/{model|iri}.rs instead
    PR to your PR with this change: Jonas-Puksta-Sensmetry#1
  2. I see commands/index/mod_tests.rs as integration tests, and as such they would belong into the core/tests folder.
    PR to your PR with this change, and point 1, Jonas-Puksta-Sensmetry#2

Comment thread core/src/index/model.rs
@consideRatio
Copy link
Copy Markdown
Collaborator

Jonas highlighted these as action points:

  • The following isn't yet done. When adding a project version, if some copying/writing fails, try to remove the directory of that specific version
  • Also I haven't updated the documentation

@andrius-puksta-sensmetry could you consider merge of these? Then I figure we act on Jonas points ourselves.

My input in #335 (review):

  1. I see index_utils.rs to contain shared data models between env/index.rs and commands/index/..., but think _utils doesn't reflect that, so I refactored it into index/{model|iri}.rs instead
    PR to your PR with this change: Move shared index types out of index_utils Jonas-Puksta-Sensmetry/sysand#1
  2. I see commands/index/mod_tests.rs as integration tests, and as such they would belong into the core/tests folder.
    PR to your PR with this change, and point 1, Make index command tests to integration tests Jonas-Puksta-Sensmetry/sysand#2

@consideRatio consideRatio force-pushed the pr/index-management branch from fd5c0f6 to afc5aa2 Compare May 20, 2026 08:21
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs
Comment thread sysand/src/commands/index.rs
Comment thread core/src/env/index_tests.rs Outdated
Comment thread core/src/commands/index/add.rs
Comment thread core/src/model.rs
@Jonas-Puksta-Sensmetry Jonas-Puksta-Sensmetry changed the title Add index management commands feat: add index management commands May 22, 2026
Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>

Co-authored-by: Erik Sundell <erik.sundell+2025@sensmetry.com>
Comment thread sysand/src/cli.rs Outdated
Comment thread sysand/src/cli.rs
Comment thread sysand/src/cli.rs Outdated
Comment thread docs/src/hosting_index.md Outdated
Comment thread docs/src/hosting_index.md Outdated
Jonas-Puksta-Sensmetry and others added 3 commits May 22, 2026 11:00
Co-authored-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Jonas Pukšta <146448971+Jonas-Puksta-Sensmetry@users.noreply.github.com>
…sion types

Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>
…pecifying publisher in .project.json

Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>
Comment thread sysand/src/cli.rs Outdated
Comment thread docs/src/hosting_index.md Outdated
Comment on lines +48 to +49
you can add it to the package index by (provided .project.json specifies
`publisher` field):
Copy link
Copy Markdown
Collaborator

@andrius-puksta-sensmetry andrius-puksta-sensmetry May 22, 2026

Choose a reason for hiding this comment

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

Suggested change
you can add it to the package index by (provided .project.json specifies
`publisher` field):
you can add it to the package index by (provided `.project.json` specifies
matching `publisher` and `name` fields):

Ideally there would be at least two examples:

  1. Project with appropriate (i.e. normalizable) publisher and name and no --iri given.
  2. Project without publisher and with --iri given
  3. (maybe) project with non-normalizable publisher/name and with --iri given
  4. (maybe) project without a publisher and with --iri given

Alternatively/additionally, we should provide nice actionable error messages when publisher/name are not normalizable or publisher is missing, and direct people to give --iri when needed. Users will for sure find this whole situation of "optional publisher, and if publisher and name both satisfy specific rules, no --iri needs to be given; but if --iri PURL is given it must match publisher/name" confusing.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some of this should go to a new doc page explaining Sysand PURL and how exactly it corresponds to projects.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

None of this is urgent, but will have to be done soon-ish.

Comment thread docs/src/hosting_index.md Outdated
…is a positional argument for the other commands (yank and remove)

Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>
Comment thread sysand/src/cli.rs Outdated
…, require `--project` flag for that

Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>
Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>
Comment thread core/src/commands/index/remove.rs
Comment thread core/src/commands/index/remove.rs
Comment thread core/src/commands/index/remove.rs
Comment thread docs/src/hosting_index.md Outdated
Comment thread docs/src/hosting_index.md Outdated
Comment thread docs/src/hosting_index.md Outdated
Comment thread core/src/commands/index/add.rs Outdated
Jonas-Puksta-Sensmetry and others added 4 commits May 22, 2026 14:28
…on book

Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>
Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>
Co-authored-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Jonas Pukšta <146448971+Jonas-Puksta-Sensmetry@users.noreply.github.com>
Signed-off-by: jonas.puksta.sensmetry <jonas.puksta@sensmetry.com>
Copy link
Copy Markdown
Collaborator

@andrius-puksta-sensmetry andrius-puksta-sensmetry left a comment

Choose a reason for hiding this comment

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

Good enough, we'll definitely need to improve errors and docs, but that can wait a bit.

@consideRatio consideRatio merged commit b44b177 into sensmetry:main May 24, 2026
48 of 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.

Design and implement yanking functionality under index management command Add index management command

3 participants