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

Kdb rewrite base #4943

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

Kdb rewrite base #4943

wants to merge 25 commits into from

Conversation

hannes99
Copy link
Contributor

@hannes99 hannes99 commented May 23, 2023

This is the "framework" for the new C cli.
I'll mention PRs for commands later here.

This can be merged as is, more commands can be added later.

  1. add spec support for external commands: Kdb rewrite external #4951 (reviewed and now in kdb_rewrite_base)
  2. add spec for C++ commands: Kdb rewrite cpp spec #4949 (reviewed and now in kdb_rewrite_base)
  3. add set command: Kdb rewrite set #4954 (reviewed and now in kdb_rewrite_base)
  4. add meta commands: Kdb rewrite meta(get, ls, rm, set, show) #4955
  5. this one

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 them 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
    • fix the CI itself (or rebase if already fixed)
  • 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 everything is done and no further pushes are planned by you.

@hannes99 hannes99 assigned kodebach and lukashartl and unassigned kodebach and lukashartl May 23, 2023
@hannes99 hannes99 force-pushed the kdb_rewrite_base branch 2 times, most recently from edf8782 to 93485a3 Compare May 23, 2023 13:42
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'm not a fan of using macros when you don't need to. I left some comments about that, but IMO we could also merge this with the macros as they are now, as long as they are better documented (especially hidden assumptions).

The reason looks all very good. I just have some minor suggestions.

I also had an idea how to improve the integration of the old C++ code, but again we can also leave it the way it is now, as long as it's documented properly. Specifically, about the external shell script commands, the docs should state whether that is supported only via C++ or even, if you replace cpp_main with a dummy so you can compile without C++.

doc/man/man1/kdb-get.1 Outdated Show resolved Hide resolved
src/tools/kdb/colors.c Outdated Show resolved Hide resolved
src/tools/kdb/get.h Outdated Show resolved Hide resolved
src/tools/kdb/main.c Outdated Show resolved Hide resolved
src/tools/kdb/get.c Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.c Outdated Show resolved Hide resolved
src/tools/kdb/command.c Outdated Show resolved Hide resolved
src/tools/kdb/colors.h Outdated Show resolved Hide resolved
@hannes99 hannes99 force-pushed the kdb_rewrite_base branch 2 times, most recently from 4bd6d67 to 53f9bb0 Compare May 27, 2023 14:06
@hannes99
Copy link
Contributor Author

Thanks a lot for the feedback!

@hannes99 hannes99 force-pushed the kdb_rewrite_base branch 2 times, most recently from b51edcd to 026b455 Compare May 27, 2023 16:39
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.

Noticed a two minor inconsistencies/mistakes, please check. Otherwise, LGTM.

src/tools/kdb/command.h Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/main.c Outdated Show resolved Hide resolved
@hannes99 hannes99 force-pushed the kdb_rewrite_base branch 2 times, most recently from c00b8cb to ef566b6 Compare May 30, 2023 03:47
@hannes99
Copy link
Contributor Author

jenkins build libelektra please

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.

LGTM now, just some small improvements to the new docs.

src/tools/kdb/colors.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
src/tools/kdb/command.h Outdated Show resolved Hide resolved
@hannes99 hannes99 force-pushed the kdb_rewrite_base branch 3 times, most recently from 499db7d to f14de05 Compare May 31, 2023 15:10
src/tools/kdb/external.c Fixed Show fixed Hide fixed
@hannes99
Copy link
Contributor Author

jenkins build libelektra please

Copy link
Contributor

@lukashartl lukashartl left a comment

Choose a reason for hiding this comment

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

lgtm

doc/help/kdb-complete.md Show resolved Hide resolved
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.

Tutorials are much better now, still quite a few formatting problems etc. (I only marked a few exemplary, please check for others yourself.)

doc/dev/kdb-add-new-command.md Outdated Show resolved Hide resolved
doc/dev/kdb-add-new-command.md Outdated Show resolved Hide resolved
doc/dev/kdb-add-new-command.md Show resolved Hide resolved
doc/dev/kdb-add-new-command.md Show resolved Hide resolved
doc/dev/kdb-add-new-command.md Outdated Show resolved Hide resolved
doc/tutorials/external-commands.md Outdated Show resolved Hide resolved
doc/tutorials/external-commands.md Outdated Show resolved Hide resolved
doc/tutorials/external-commands.md Outdated Show resolved Hide resolved
doc/news/_preparation_next_release.md Show resolved Hide resolved
doc/news/_preparation_next_release.md Outdated Show resolved Hide resolved
@hannes99
Copy link
Contributor Author

Thanks a lot for the feedback @markus2330 !

src/libs/elektra/errors.c Dismissed Show dismissed Hide dismissed
@hannes99 hannes99 requested a review from markus2330 June 19, 2023 07:49
hannes99 and others added 25 commits July 4, 2023 11:53
and add command.h containing helpful macros and a struct def that is
needed later. Commands not implemented yet will be handles by the old
implementation.
... to command.c for resolving bookmarks in keynames.
... remove cpp implementation and add test for the get command
... and (partial) fix #3742, fix #4028, fix #1164
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.

None yet

6 participants