Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Use Cases] Add use cases for mounting #4773

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

flo91
Copy link
Collaborator

@flo91 flo91 commented Dec 13, 2022

Basics

  • Short descriptions of your changes are in the release notes
    (added as entry in doc/news/_preparation_next_release.md which
    contains _(my name)_)
    Please always add something to the release notes.
  • Details of what you changed are in commit messages
    (first line should have module: short statement syntax)
  • References to issues, e.g. close #X, are in the commit messages.
  • The buildservers are happy. If not, fix in this order:
    • add a line in doc/news/_preparation_next_release.md
    • reformat the code with scripts/dev/reformat-all
    • make all unit tests pass
    • fix all memleaks
  • The PR is rebased with current master.

Checklist

  • I added unit tests for my code
  • I fully described what my PR does in the documentation
    (not in the PR description)
  • I fixed all affected documentation (see Documentation Guidelines)
  • I fixed all affected decisions (see Decision Process)
  • I added code comments, logging, and assertions as appropriate (see Coding Guidelines)
  • I updated all meta data (e.g. README.md of plugins and METADATA.ini)
  • I mentioned every code not directly written by me in reuse syntax

Review

Labels

  • Add the "work in progress" label if you do not want the PR to be reviewed yet.
  • Add the "ready to merge" label if the basics are fulfilled and no further pushes are planned by you.

Copy link
Contributor

@markus2330 markus2330 left a comment

Choose a reason for hiding this comment

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

Thank you for the use cases! A few things I didn't understand. I didn't review all file/rdb use cases as they seem to be repetitive, please re-request review if I missed something.

doc/usecases/mount/README.md Outdated Show resolved Hide resolved
doc/usecases/mount/UC_mount.md Outdated Show resolved Hide resolved
Comment on lines +27 to +28
- The given data source is not supported by Elektra. (e.g. wrong file format, syntax errors)
- Elektra reports the error to the administrators.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why isn't this an error scenario?

Comment on lines +32 to +33
- The opening of the data source failed.
- Elektra reports the error to the administrators.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please describe what "opening of the data source failed" means. I don't think this is done during mounting except for the --strategy described by me above.

doc/usecases/mount/UC_mount.md Outdated Show resolved Hide resolved
Comment on lines +19 to +26
- The administrators use Elektra to query a list with all current mountpoints.
- Elektra returns the list with the mountpoints and the data source identifiers. (e.g. filename and path, data source name)
- The administrators mount a new data source. (see [Use Case: Mount a data source](./UC_mount.md))
- The administrators use Elektra to query a list with all current mountpoints.
- The new mountpoint is now added to the list.
- The administrators unmount the previously mounted data source. (see [Use Case: Unmount a data source](./UC_unmount.md))
- The administrators use Elektra to query a list with all current mountpoints.
- The mountpoint for the unmounted data source is now not included in the list.
Copy link
Contributor

Choose a reason for hiding this comment

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

The other use cases already cover mounting/umounting:

Suggested change
- The administrators use Elektra to query a list with all current mountpoints.
- Elektra returns the list with the mountpoints and the data source identifiers. (e.g. filename and path, data source name)
- The administrators mount a new data source. (see [Use Case: Mount a data source](./UC_mount.md))
- The administrators use Elektra to query a list with all current mountpoints.
- The new mountpoint is now added to the list.
- The administrators unmount the previously mounted data source. (see [Use Case: Unmount a data source](./UC_unmount.md))
- The administrators use Elektra to query a list with all current mountpoints.
- The mountpoint for the unmounted data source is now not included in the list.
- The administrators use Elektra to query a list of all current mountpoints.

doc/usecases/mount/UC_list_mountpoints.md Outdated Show resolved Hide resolved
@@ -0,0 +1,40 @@
# Use Case: List all configuration keys and values from all currently mounted data sources
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know which functionality this is? Is this export? Why does it belong to the mounting use cases?

@@ -0,0 +1,52 @@
# Use Case: Delete configuration data from a file
Copy link
Contributor

Choose a reason for hiding this comment

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

I would simplify this and only have a get and set use case. (Delete is part of set).
I think it is enough that you only write the rdb use cases.
I don't think they should be part of mount, but rather another folder ("rdb").

Comment on lines 30 to 31
- The requested key is not found in the database.
- Elektra reports the error to the administrators.
Copy link
Contributor

Choose a reason for hiding this comment

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

As Elektra simply set whatever is given, the non-presence of keys shouldn't matter (they get created/deleted as demanded).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the remark! I changed the scenario.

Copy link
Member

@kodebach kodebach left a comment

Choose a reason for hiding this comment

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

I haven't had time to read all the texts, but from the titles and briefs, I'd say only these three use cases are use cases for mounting: UC_mount.md, UC_unmount.md and UC_list_mountpoints.md

The rest are use cases for file-based backends and database backends respectively. If we want to keep them I'd move them into separate folders. However, I'm not sure we need those at all.

IMO it would be enough to have a UC_mount_file.md and UC_mount_rdb.md in addition to UC_mount.md. UC_mount.md describes mounting in general, and the other two describe mounting configuration files and relational databases respectively. Then all the edit/read/write/delete stuff should automatically follow as a combination of UC_mount_file.md and UC_mount_rdb.md and the general KDB use cases in doc/usecases/kdb.

Only if there are specific difference between file-based and database backends that go beyond technical limitations (e.g. files must be written as a whole, databases could modify individual values), would I create separate use cases. The technical limitations are only relevant on the decision level IMO, but not the more general use case level.

doc/usecases/mount/UC_delete_from_rdb.md Outdated Show resolved Hide resolved
doc/usecases/mount/UC_edit_rdb.md Outdated Show resolved Hide resolved
doc/usecases/mount/UC_edit_rdb.md Outdated Show resolved Hide resolved
Comment on lines 30 to 31
- The requested key is not found in the database.
- Elektra reports the error to the administrators.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the remark! I changed the scenario.

Co-authored-by: Markus Raab <markus2330@users.noreply.github.com>
Co-authored-by: Klemens Böswirth <23529132+kodebach@users.noreply.github.com>
@flo91 flo91 removed the needs review please review this PR label Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants