[yast-devel] First prototype of yast-journal
A first prototype of the systemd journal reading module is available at: https://github.com/ancorgs/yast-journal It still does not include a Rakefile, so you'll have to do something like this to play with it. Y2DIR=src/ /usr/sbin/yast2 journal It took me a little bit longer than expected because: - I have been going back and forward with the UI design/implementation. - I tried to mimic ActiveRecord as much as possible when querying the journal. Turns out it was not a brilliant decision (as stated in the comments of the SystemdJournal::Query class). I'm sure the code contains a lot of newbie mistakes (specially in the UI part) so let's find them all before we start writing a tutorial with that code as a base :-) I implemented the classes for retrieving and processing the journal entries as pure ruby classes living in /lib. But I'm not sure if it's a good decision. Wouldn't it be better to implement them as a module so it can be accessed from other programming languages? There are still a lot of usability problems and I still need a way to make all this information visible [1], but it's just the first prototype. I'm more worried right now about the architecture (lib vs module) and the libyui usage mistakes/patterns. [1] https://github.com/ancorgs/yast-journal/blob/master/src/lib/systemd_journal/... Cheers. -- Ancor González Sosa YaST Team at SUSE Linux GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 11/25/2014 04:56 PM, Ancor Gonzalez Sosa wrote:
I'm sure the code contains a lot of newbie mistakes (specially in the UI part) so let's find them all before we start writing a tutorial with that code as a base :-)
BTW, for the tutorial my plan is to remove several things. Specially the date/time filters, which add quite some code and teach nothing about YaST development. Cheers. -- Ancor González Sosa YaST Team at SUSE Linux GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Tue, 25 Nov 2014 16:56:50 +0100 Ancor Gonzalez Sosa <ancor@suse.de> wrote:
A first prototype of the systemd journal reading module is available at: https://github.com/ancorgs/yast-journal
It still does not include a Rakefile, so you'll have to do something like this to play with it. Y2DIR=src/ /usr/sbin/yast2 journal
It took me a little bit longer than expected because: - I have been going back and forward with the UI design/implementation. - I tried to mimic ActiveRecord as much as possible when querying the journal. Turns out it was not a brilliant decision (as stated in the comments of the SystemdJournal::Query class).
I'm sure the code contains a lot of newbie mistakes (specially in the UI part) so let's find them all before we start writing a tutorial with that code as a base :-)
I implemented the classes for retrieving and processing the journal entries as pure ruby classes living in /lib. But I'm not sure if it's a good decision. Wouldn't it be better to implement them as a module so it can be accessed from other programming languages?
There are still a lot of usability problems and I still need a way to make all this information visible [1], but it's just the first prototype. I'm more worried right now about the architecture (lib vs module) and the libyui usage mistakes/patterns.
[1] https://github.com/ancorgs/yast-journal/blob/master/src/lib/systemd_journal/...
Cheers.
Can you make pull request of code to somewhere, so I can easier comment it? Thanks Josef -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 11/25/2014 05:15 PM, Josef Reidinger wrote:
Can you make pull request of code to somewhere, so I can easier comment it?
I don't think a PR is needed in order to comment directly on the commit. https://github.com/ancorgs/yast-journal/commit/488a91dea8a8b7190ddf41db0b320... Cheers. -- Ancor González Sosa YaST Team at SUSE Linux GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 11/25/2014 05:18 PM, Ancor Gonzalez Sosa wrote:
On 11/25/2014 05:15 PM, Josef Reidinger wrote:
Can you make pull request of code to somewhere, so I can easier comment it?
I don't think a PR is needed in order to comment directly on the commit.
https://github.com/ancorgs/yast-journal/commit/488a91dea8a8b7190ddf41db0b320...
I fixed an issue and modified the commit (I wanted to keep everything in a single commit for initial review). The url has changed: https://github.com/ancorgs/yast-journal/commit/a72571bd48b3af8aeaf47dfd0a3de... I promise not to do it again :-) Cheers. -- Ancor González Sosa YaST Team at SUSE Linux GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 11/25/2014 04:56 PM, Ancor Gonzalez Sosa wrote:
A first prototype of the systemd journal reading module is available at: https://github.com/ancorgs/yast-journal
I was worried about the low testability of the dialogs. So I tried to extract some functionality into a module called Helpers. That's the original Rails approach to keep views as slim as possible. The result is at a different branch. https://github.com/ancorgs/yast-journal/tree/helpers I'm still unhappy with the new code organization. It looks overkill and not as clear as it should be. But at least there are no more complex private methods on the dialogs and there is an obvious way to share code between related dialogs. What are your suggestions for a better approach to achieve the same? -- Ancor González Sosa YaST Team at SUSE Linux GmbH -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On Tue, Nov 25, 2014 at 04:56:50PM +0100, Ancor Gonzalez Sosa wrote:
A first prototype of the systemd journal reading module is available at: https://github.com/ancorgs/yast-journal [...] I implemented the classes for retrieving and processing the journal entries as pure ruby classes living in /lib. But I'm not sure if it's a good decision. Wouldn't it be better to implement them as a module so it can be accessed from other programming languages?
I prefer native Ruby libraries. Those other languages are just Perl. We also have Python bindings which are unmaintained. I would prefer to not rely on the YCP-based language bridge. Yes, we still depend on it for several modules, in particular Users, but in the long run we should seek a more widespread alternative. -- Martin Vidner, Cloud & Systems Management Team http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
Dne 1.12.2014 v 11:04 Martin Vidner napsal(a):
On Tue, Nov 25, 2014 at 04:56:50PM +0100, Ancor Gonzalez Sosa wrote:
A first prototype of the systemd journal reading module is available at: https://github.com/ancorgs/yast-journal [...] I implemented the classes for retrieving and processing the journal entries as pure ruby classes living in /lib. But I'm not sure if it's a good decision. Wouldn't it be better to implement them as a module so it can be accessed from other programming languages?
I prefer native Ruby libraries.
+1
Those other languages are just Perl. We also have Python bindings which are unmaintained.
IMHO in the long term we should get rid of all other languages and use Ruby as the only language. This is a legacy from the old YCP based Yast, the YCP-killer obviously could not convert the non-YCP code... The non-Ruby code makes everything more difficult, e.g. we cannot simply generate test code coverage, it requires different testing framework, we cannot use the same tools like code-climate or rubocop for code quality checks, debugging is very difficult (you cannot debug the Perl calls from Ruby and even starting a debugger is not trivial as y2base is a binary, not a regular Ruby script)... Access from other languages was nice when we used our proprietary language (YCP) as the main language, with Ruby it's not that important IMHO. And if somebody really needs access from other languages we should use some common solution, for example DBus which can be used even from shell (a side note to a different topic: this could provide kind of CLI...). -- Best Regards Ladislav Slezák Yast Developer ------------------------------------------------------------------------ SUSE LINUX, s.r.o. e-mail: lslezak@suse.cz Lihovarská 1060/12 tel: +420 284 028 960 190 00 Prague 9 fax: +420 284 028 951 Czech Republic http://www.suse.cz/ -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (4)
-
Ancor Gonzalez Sosa
-
Josef Reidinger
-
Ladislav Slezak
-
Martin Vidner