-
Notifications
You must be signed in to change notification settings - Fork 223
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
Enable errors from Augeas to be retrieved #1609
Comments
I thought about automatically retrieving and adding any error information to a failing Augeas command, but I decided that is over-engineering things too much and that a developer should decide how they want to handle errors and retrieve them manually if they wish to. |
… be retrieved As per RexOps#1609 it is not possible to retrieve errors from Augeas if it is failing. This PR adds a new command to be able to retrieve them. I have not added a test, as there are currently no tests at all for the Augeas command. I thought about automatically retrieving and adding any error information to a failing Augeas command, but I decided that is over-engineering things too much and that a developer should decide how they want to handle errors and retrieve them manually if they wish to. Please review and merge, or let me know how to improve it further.
As per RexOps#1609 it is not possible to retrieve errors from Augeas if it is failing. This PR adds a new command to be able to retrieve them. I have not added a test, as there are currently no tests at all for the Augeas command. I thought about automatically retrieving and adding any error information to a failing Augeas command, but I decided that is over-engineering things too much and that a developer should decide how they want to handle errors and retrieve them manually if they wish to. Please review and merge, or let me know how to improve it further.
Thanks for opening this issue! The general idea of "being able to retrieve errors from an external system" sounds good 👍 Also thanks for the related PR! I'll take a quick look at it too, even though the main reason to open an issue first is to discuss the relevant details before investing too much into implementation. Full disclosure: I'm not using Augeas personally, so I don't have much experience with it directly or via Rex. While I'm aware of its general scope and goals, I certainly need more pointers to understand all the details and implications of this idea. It might be best to offload lengthier discussions for better suited support channels like GitHub discussions, Matrix/IRC, optionally in a dedicated chat as part of my open source office hours. Here are the first few questions coming to my mind:
|
Hi @ferki - thanks for the super-quick reply! Thanks for all the detailed information and thoughts. I'm maxed out at the moment and so I was just quickly submitting this whilst it was causing me problems and fresh in my mind. I'll circle back round on it in more detail when I've got some more time - it looks like it could be quite a big undertaking (on the other hand, I am happy to sponsor it if anyone else wants to pick it up). I'll close the PR for the moment - sorry for the hasty opening, but at least it's there for the record. Great to see how the project has progressed (you may remember I submitted lots of contributions several years ago!). I rely on Rex almost daily and it's a life-saver. Many thanks, Andy |
In retrospect, I feel like I did not have enough time to write a shorter reply 😅 So I'm glad it still feels useful now or for future readers.
Right, and it could be even bigger without tests! 😈 My view is that time is one of the most valuable resource we have, especially in a volunteer-driven project, and it is often taken from other interests and obligations such as family and self-care – so it's even more important to use it wisely and efficiently. That's exactly the main motivation behind our Contributing guide, and emphasizing maintainability through quality.
That's very kind and generous of you! In case you are looking for commercial support for Rex, including custom development or sponsoring community features, there are some more info and resources listed on our Help Rex and Support pages. (Full disclosure: I do offer commercial Rex services as an independent provider, and listed there too. Book a chat via my calendar.)
No worries, it's good to have code examples available for others looking at this. It's possible to use that code as a local patch when building Rex from source. Or, since it's just Perl, put the new code into an alternative module, for example Local::Rex::Commands::Augeas or similar, and import that instead of the core one. It might be an interesting option for next time to open PRs as draft once the scope and fitness to core is clear, and then collaborate on it until merged.
Sure I remember, and thanks again for your contributions! About half of those are for Rex::Commands::Augeas, which lead me to ask if you would be interested in maintaining a hypothetical module out of core :)
Thank you for the kind words! After participating in this project for 10+ years, it feels especially great to have such feedback ❤️ I look forward to the next 10+ years too! 🚀 |
Thank you, I will drop you a line. Whilst this particular issue is very much an edge case (it's the first time I've needed it in serveral years) I am keen to support the project to ensure its ongoing viability. |
I now pushed initial Augeas tests to the test_augeas branch (see also test results and code coverage.) This already exercises about ~50% of related code through a Simplelines use case, and could serve as a basis for further tests. Implementing these initial tests already highlighted some hidden issues in the current code base:
I could not find a good way to test I now also better understand the Augeas wrapping use cases, and I wonder if it's best to map each augtool command to a Rex interface (like ps.: out of the scope of this issue, I expect the above enables the following related work too (to be tracked and discussed separetely):
|
Meanwhile on the I may still need to reorganize some of the commits there, though I think it's a good base for further tests, including the proposed |
As
an engineer
I would like to
be able to retrieve Augeas error logs
so I can
find out why Augeas commands are failing
Additional context
There is no API to the augeas "errors" command. As such, it is not possible to find out why an Augeas command is failing.
Describe the solution you would like
A new command in Rex::Commands::Augeas to be able to retrieve errors (PR to follow)
Describe alternatives you have considered
No response
The text was updated successfully, but these errors were encountered: