-
Notifications
You must be signed in to change notification settings - Fork 16
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
Added organizational unit support #104
Conversation
Hi there! Thanks a ton for the contribution. The code looks pretty good on first glance. As you may see now that I've enabled the test run the CI has picked up on the fact that your commit messages are not passing our formatting tests. In addition I noticed some organizational issues with the commits. In particular the first commit mixes some typo fixes (thanks!) as well as the new feature. I try to have our commits only contain either an improvement of existing code or a new feature when possible. However, I don't know how comfortable you are with editing existing git commits. If you are good with changing commit messages on your own - the spec is basically Thanks again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this contribution, @myback !
I agree with @phlogistonjohn that it looks pretty good at first glance, apart from the commit message issues that should get fixed before we can approve. In addition to what the CI and @phlogistonjohn already mentioned, I have some additional request:
for the first commit message, please:
- use imperative form instead of past tense, i. e.
Add
instead ofAdded
. - include a brief description how to add OUs
@myback wrote:
I think it is important here to distinguish between organizational units (which is what this PR adds support for) and groups which are not OUs. PUs are a bit like subdirectories, but they provide a different dimension of subdividing the AD than groups do.
also worth mentioning that in addition to specifying users and groups in the definition of an OU, for each user and group definition, an "ou" can now be specified that the object should belong to.
it is good to mention this example file, maybe also in the first/main commit message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@myback ,
Thanks for splitting the typo fixes out into a separate commit.
I like that approach!
But I'd like to renew my request to use Add
instead of Added
in thecommit message of the main commit, and please elaborate/explain a bit about the feature in the commit message.
Additionally, both commit messages are still missing Signed-off-by:
lines. Please add those.
I meant that they are configured in the application in a similar way to groups done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@myback ,
Thanks for adjusting the commit message and adding sign-off lines!
We're getting closer! 😄
However, I doubt that [email protected]
is your real email address. It is an automatic address by github.
Could you please amend the commits adding a proper email?
Finally, an earlier version of the PR had a separate commit that added test(s). What happened to that? Can it be re-added?
@obnoxxx ok |
FWIW, I've been generally willing to accept those for people on other projects. It may not be ideal as the point of signed-off-by is saying "I $USER have the legal right to contribute this code". But I have been generally willing to accept them as they can be used to determine the original contributor on github and give the person some additional level of privacy. Just FYI. |
To save you some time looking at the CI logs: the linter found a formatting issue in tests/test_addc.py |
@phlogistonjohn I only see two empty lines, but these lines were there before https://github.com/samba-in-kubernetes/sambacc/blob/master/tests/test_addc.py#L22-L23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@myback, one more request:
Could you please squash the fix formatting commit with the one that introduces the test_addc.py
file? I don't see a good reason for adding the file and fixing the formatting in a later commit in the same PR. If the commit adding the file had already been merged, fixing it in a separate commit in a follow-up PR would be perfectly fine, of course :)
Unfortunately it hits a similar error still: In theory, you ought to be able to reproduce the error locally with |
4d3accf
to
5b38859
Compare
An error in formatting the conf-v0.schema.py file occurred due to the fact that I do not have the black tool. There was no error when generating the json schema. But after installing it, the formatting errors did not disappear. Some time later, when I figured out the code, I realized that I could do without generating python code. Is the last commit is good for you? All done! ✨ 🍰 ✨ |
b32ad23
to
19d5e1c
Compare
Thanks for the update. I will re-review soon. As for pydantic, I was looking at it for a different project recently but decided to skip it because of the more complex dependencies it has and availability on older distros. So while I appreciate the sentiment I think that I'd prefer to avoid it for sambacc for now. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, @myback !
the CI is happy now and so am I: this PR lgtm now!
I'll admit I was bit surprised by the removal of the generated code. It's unfortunate that you had issues with it, but taking it out entirely seems like a big change. On the other hand, I'll admit that having it was possibly a premature optimization. I figured having the schema in python already would avoid some runtime overhead of parsing the json as well as avoiding any packaging issues related to including non-python files[1]. Let me think this over some more before I make a final judgement about this part. If I decide that I want to keep the generated sources, would you be OK if I tried to help resolve any issues around them? Like by pushing patches into this PR? [1] - At the very least I'd want to make sure the data files are properly included in the build(s) and we'd probably want to use importlib.resources to load the json file. |
I have decided that I do not want to drop the generated source file. As part of that decision I made sure that the formatting for the generated python file is not so difficult by adding a tox env and running it. You can see "my version" of you PR here: master...phlogistonjohn:sambacc:wip-pr-104 (the last two patches are new). If you would like you can either take my changes into your PR, I can push changes into your branch, or I can file an alternate PR that has your original set of change and my additonal patches. Let me know what you'd prefer here. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my previous comment. Let's not get rid of the generated python file.
@phlogistonjohn done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, got distracted and busy. Approved.
@Mergifyio rebase |
It is possible to specify a group and a user who belongs to a specific organizational group. See file examples/addc_ou.json. Signed-off-by: myback <[email protected]>
Signed-off-by: myback <[email protected]>
Signed-off-by: myback <[email protected]>
✅ Branch has been successfully rebased |
e898ec4
to
87f3883
Compare
I added support for organizational groups, similar to user groups. You can specify a group and user that belongs to a specific organizational group.
add the example file
examples/addc_ou.json