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 import export lookup provider through pluginDatabase #3180

Closed
wants to merge 11 commits into from
Closed

Kdb import export lookup provider through pluginDatabase #3180

wants to merge 11 commits into from

Conversation

MasterToney
Copy link
Contributor

@MasterToney MasterToney commented Nov 8, 2019

Basics

These points need to be fulfilled for every PR:

  • 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.
  • The PR is rebased with current master.

If you have any troubles fulfilling these criteria, please write
about the trouble as comment in the PR. We will help you.
But we cannot accept PRs that do not fulfill the basics.

Checklist

Check relevant points but please do not remove entries.
For docu fixes, spell checking, and similar none of these points below
need to be checked.

  • 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
  • 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 THIRD-PARTY-LICENSES

Review

Reviewers will usually check the following:

Labels

If you are already Elektra developer:

  • 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 you also
    say that everything is ready to be merged.

With this PR kdb import and kdb export lookup providers through the database, before you had to specify the plugin to use directly by name, e.g. yajl where as now you can also specify the format e.g. json.

It will implement issue #1178.

@MasterToney
Copy link
Contributor Author

@markus2330 please review my pull request.

@markus2330
Copy link
Contributor

Great job, looks very good. Let us see what the build server says.

@MasterToney
Copy link
Contributor Author

Nice to hear, should I look into adding some unit tests that check if import/export work with both plugin name and file format?

@markus2330
Copy link
Contributor

Nice to hear, should I look into adding some unit tests that check if import/export work with both plugin name and file format?

Yes, some shellrecorder tests in the man pages of kdb import/export would be terrific.

@markus2330
Copy link
Contributor

Btw. if you plan to push any new commits on a PR, please remove "ready to merge". "ready to merge" indicate that you do not want to change anything anymore and the build server passes.

@MasterToney
Copy link
Contributor Author

@markus2330 I added two tests for both import and export that check if the command works by specifying either the plugin directly or the desired format.
I also installed ronn and rebuilt elektra with it, the build tells me that the man pages are getting generated but the new examples are not included, so my question: are shell recorder examples excluded from the man pages automatically or am I missing something?

@sanssecours
Copy link
Member

are shell recorder examples excluded from the man pages automatically or am I missing something?

Nope, these examples are included in the man pages. The problem is ElektraManPage, which tries to get rid of man pages, where only the date of the generated man page changed:

if (NOT "${DIFF_POSITION_DATE_ADDED}" STREQUAL -1 AND "${DIFF_POSITION_DATE_ADDED}" STREQUAL "${DIFF_LAST_POSITION_ADDED}")
execute_process (COMMAND ${CMAKE_COMMAND}
-E
copy
${OLD_MAN_PAGE_COPY}
${MANPAGE})
endif (NOT "${DIFF_POSITION_DATE_ADDED}" STREQUAL -1 AND "${DIFF_POSITION_DATE_ADDED}" STREQUAL "${DIFF_LAST_POSITION_ADDED}")

. Unfortunately I did not consider, changes which only include additions. As consequence these kind of man pages are generated, but then immediately reverted. Sorry for this bug. I will try to come up with a solution for this problem.

@MasterToney
Copy link
Contributor Author

@sanssecours no problem ^^ I'm glad it's not something on my end :p
please let me know when a fix is available so that I can include the generated manpages

@sanssecours
Copy link
Member

please let me know when a fix is available so that I can include the generated manpages

Thank you for your understanding. Pull request #3184 should fix the problem.

@markus2330
Copy link
Contributor

I merged #3184, so rebasing to master should fix the problem.

@MasterToney
Copy link
Contributor Author

MasterToney commented Nov 10, 2019

@sanssecours thank you for the fix, unfortunately now all man pages are marked as changed in doc/man/man1 and doc/man/man7

The difference in those files is as follows:

- .TH "ELEKTRA\-RELATED" "" "June 2019" "" ""
+ .TH "ELEKTRA\-RELATED" "" "October 2019" "" ""

I guess the script includes them since a deletion and insertion happened?
For me now it's not a big deal, I can reset them manually but might be something worthy to look into again.

@sanssecours
Copy link
Member

@sanssecours thank you for the fix, unfortunately now all man pages are marked as changed in doc/man/man1 and doc/man/man7

I only tested my changes with macOS until now. I assume diff -e produces different output on your system. Which version of diff do you use? I now tried

  • diff (GNU diffutils) 2.8.1 on macOS, and
  • diff (GNU diffutils) 3.7 on Alpine Linux,

which both seem to work. The diff tool of BusyBox on the other hand does not work at all, since it does not support the POSIX option -e.

I guess the script includes them since a deletion and insertion happened?

Currently the CMake code just checks, if the diff output for the editor ed (diff -e) matches the regex ^4c\n\\.TH [^\n]+\n\\.\n$. If it does, then the code reverts the changes made by ronn.

@MasterToney
Copy link
Contributor Author

I'm too running macOS with diff (GNU diffutils) 2.8.1 but strangely enough I wasn't able to reproduce the behavior after it's first occurrence.

@markus2330
Copy link
Contributor

jenkins build libelektra please

1 similar comment
@MasterToney
Copy link
Contributor Author

jenkins build libelektra please

@markus2330
Copy link
Contributor

Release notes are missing.

@MasterToney
Copy link
Contributor Author

Are you sure? Jenkins logs say something along the lines that

508 [debian-buster-full] ERROR: Error fetching remote repo 'origin'
509 [debian-buster-full] hudson.plugins.git.GitException: Failed to fetch from https://github.com/ElektraInitiative/libelektra.git

which indicates to me that jenkins cannot clone this repo somehow.
Especially since I changed doc/news/_preparation_next_release.md with my contribution.

@markus2330
Copy link
Contributor

Are you sure?

I am sure my statement was wrong 😉, the problem seems to be somewhere else.

If retrying does not help, making a new PR usually helps.

@MasterToney
Copy link
Contributor Author

Ok, I closed this one and created #3191, let's hope for the best ^^

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

3 participants