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

Linux user add #218

Merged
merged 18 commits into from
Jul 26, 2022
Merged

Linux user add #218

merged 18 commits into from
Jul 26, 2022

Conversation

martintc
Copy link
Contributor

@martintc martintc commented Jul 25, 2022

I'm submitting a

  • bug fix
  • feature

What is the current behaviour?

Comtrya uses the NoneProvider on linux distibutions.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

Be able to use the user add action to add users to a linux system

What is the motivation / use case for changing the behavior?

Feature parity with FreeBSD on Comtrya and useful feature for all supported operating systems for Comtrya

Please tell us about your environment:

OpenSUSE TumbleWeed

Version (comtrya --version): comtrya 0.7.4
Operating system:

OpenSUSE Tumbleweed

lib/src/actions/user/providers/linux.rs Show resolved Hide resolved
lib/src/actions/user/providers/linux.rs Outdated Show resolved Hide resolved
@martintc martintc marked this pull request as ready for review July 26, 2022 00:16
@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2022

Codecov Report

Merging #218 (cb581e1) into main (3fd0e90) will decrease coverage by 0.54%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #218      +/-   ##
==========================================
- Coverage   47.00%   46.45%   -0.55%     
==========================================
  Files          68       69       +1     
  Lines        2136     2161      +25     
==========================================
  Hits         1004     1004              
- Misses       1132     1157      +25     
Impacted Files Coverage Δ
lib/src/actions/user/providers/linux.rs 0.00% <0.00%> (ø)
lib/src/actions/user/providers/mod.rs 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fd0e90...cb581e1. Read the comment docs.

@martintc martintc requested review from icepuma and rawkode July 26, 2022 00:33
@martintc
Copy link
Contributor Author

A comment for the review. I use compiler directives for Linux and non-Linux since keeping it all in a match body to match against os_info Types would be exhaustive and need to be kept up to date as os_info add more distros to it's types.

@@ -6,6 +6,8 @@ use self::none::NoneUserProvider;
use super::UserVariant;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
mod linux;
use self::linux::LinuxUserProvider;

#[derive(JsonSchema, Clone, Debug, Serialize, Deserialize)]
pub enum UserProviders {
Copy link
Member

Choose a reason for hiding this comment

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

A minor nit. You could get rid of ...UserProvider. I think, that's why clippy is complaining.

But you can merge if you solve it later 👍

@martintc martintc merged commit 7300913 into comtrya:main Jul 26, 2022
@martintc martintc deleted the linux-user-add branch September 19, 2022 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants