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

Improve error handling #689

Merged
merged 8 commits into from
Aug 8, 2023
Merged

Improve error handling #689

merged 8 commits into from
Aug 8, 2023

Conversation

imobachgs
Copy link
Contributor

@imobachgs imobachgs commented Aug 3, 2023

  • An attempt to address some of the issues reported in Miscellaneous problems with agama config set #688.
  • Fix handling of users/root settings: the CLI ignored the settings but did not report any problem. This bug was introduced in Better Settings derive macro #666. I needed to extend the derive macro to support flatten (in serde jargon) fields.
  • Extend the agama_settings documentation to explain better how it works.
Click for a documentation screenshot 😉

Screenshot from 2023-08-04 13-42-54

@imobachgs imobachgs marked this pull request as draft August 3, 2023 14:14
@coveralls
Copy link

coveralls commented Aug 3, 2023

Coverage Status

coverage: 72.098% (-0.06%) from 72.158% when pulling a81fd69 on imobachgs:improve-error-handling into 9c7a6ad on openSUSE:master.

@mvidner
Copy link
Contributor

mvidner commented Aug 4, 2023

I can't figure out which problem is solved by c7fed77 "Fix the detection of unknown attributes from config set/add"

@mvidner
Copy link
Contributor

mvidner commented Aug 4, 2023

OK, this now works:

agama config set user.user_name=tux user.password=foo
agama config set root.password=foo
agama config set root.sshPublicKey=Roooot

@imobachgs imobachgs marked this pull request as ready for review August 4, 2023 12:46
@imobachgs
Copy link
Contributor Author

I can't figure out which problem is solved by c7fed77 "Fix the detection of unknown attributes from config set/add"

In some cases, the old code implemented 1-line methods that just returned Ok(()). Now I have fixed the condition to determine when to implement a method.

@imobachgs
Copy link
Contributor Author

I would recommend generating the documentation for agama_settings with cargo doc --no-deps --package agama-settings --open.

Copy link
Contributor

@teclator teclator left a comment

Choose a reason for hiding this comment

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

LGTM

@imobachgs imobachgs merged commit 4ec913f into agama-project:master Aug 8, 2023
7 checks passed
@imobachgs imobachgs deleted the improve-error-handling branch August 8, 2023 09:31
@imobachgs imobachgs mentioned this pull request Sep 26, 2023
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.

4 participants