- Notifications
You must be signed in to change notification settings - Fork675
feat: add support for mutually exclusive attributes, consolidate attribute validation, fix boards.py _create_attr#2037
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nejch left a comment
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 this PR@walterrowe! Just a few tiny suggestions to get CI passing.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
walterrowe commentedMay 31, 2022
updates made .. |
walterrowe commentedMay 31, 2022
updated utils.py _validate_attrs() .. it was unintentionally indented. |
walterrowe commentedMay 31, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
looks like utils.py doesn't know type RequiredOptional used in _validate_attrs param types? does utils.py need "from gitlab import base"? |
walterrowe commentedMay 31, 2022
added base to imports ( |
nejch commentedMay 31, 2022
Thanks for your patience@walterrowe, getting closer now ;) I suggest you always run a quick
Thanks for this. Our linters are quite strict so likely it'll need to be alphabetical, sorry 😁
You're right, sorry I missed this when I looked at the PR. Because |
walterrowe commentedMay 31, 2022
looked at the error .. looking for suggestions on how to resolve |
walterrowe commentedMay 31, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I followed the contributors doc and set up all the pre-commit items. I have addressed them all except these two. utils.py where we declare attributes arg type mixins.py where we set excludes |
walterrowe commentedMay 31, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
In utils.py ... This resolves the RequiredOptional type error and the circular imports between base and utils. I tried moving RequiredOptional from base to utils and two dozen other files then said they didn't know RequiredOptional so moving it is quite involved. Looking at the groups.py object file I see it tries to import RequiredOptional from base (from gitlab.base import RequiredOptional, RESTManager, RESTObject) so I took the same approach in utils.py. @nejch - I still get pre-commit complaining about _id_attr in the update method of UpdateMixins in mixins.py: It comes from this line: I moved this ref from the old _check_missing_update_attrs() method. I need help with that one. Tracing backwards it appears _id_attr would be inherited from RESTObject, its optional, and defaults to "id". Perhaps in the update method of the UpdateMixin we don't need this, or need to first check if its not None? |
walterrowe commentedMay 31, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
added check for self._obj_cls is not None .. pre-commit runs clean |
walterrowe commentedMay 31, 2022
@nejch .. now I'm stuck .. any guidance would be helpful. |
JohnVillalovos commentedMay 31, 2022
Just jumping in here without doing a full review. It might make sense to move As |
nejch commentedMay 31, 2022
Thanks@JohnVillalovos that makes sense. @walterrowe you can move it to |
JohnVillalovos commentedMay 31, 2022
I created a PR for moving the |
nejch commentedMay 31, 2022
@walterrowe the PR above was merged, so if you now rebase your PR on top of our main you should be able to do this pretty easily, just import it from |
JohnVillalovos commentedMay 31, 2022
If you need assistance rebasing please let us know. I may be busy today, but starting tomorrow I will have more free time. |
walterrowe commentedMay 31, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sure wish I had seen this before I pushed my commit to update almost all those same files with the same changes. I have the pre-commit setup so it warned me about all of them. @JohnVillalovos - I might need some assistance at this point since I have pushed my commits to my fork associated with the PR. |
JohnVillalovos commentedMay 31, 2022
Give me a few minutes and I will attempt to rebase. |
JohnVillalovos commentedMay 31, 2022
@walterrowe I rebased and squashed the PR. I have pushed it to your branch. You will need to re-clone it most likely. Please let me know if you have questions. Might be easiest to just do a new: |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
walterrowe commentedMay 31, 2022
who would have thought implementing mutually exclusive attributes would require this much effort! thanks for all the assistance and guidance through this. definitely learning a great deal about python and code review that I didn't know before. |
JohnVillalovos left a comment
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.
Getting there. Need to figure out the unit test failures.
Thanks!
walterrowe commentedMay 31, 2022
fixed the test_mixins_methods refs to _check_missing_create_attrs and _check_missing_update_attrs |
JohnVillalovos left a comment
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.
@walterrowe LGTM (Looks Good To Me) 👍
Thanks for all the work on this. I will let@nejch review it too.
And by the way. Nice photography 😊 I'm a complete amateur but enjoying playing with off-camera flash and other stuff on occasion.
JohnVillalovos left a comment
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.
@walterrowe Oh I forgot one thing. Can you "squash" it down to one commit?
I can do it for you if you like.
Basic idea is:
git rebase --interactive HEAD~4Change the last three lines frompick tosquash and edit the commit message.
codecov-commenter commentedMay 31, 2022
Codecov Report
@@ Coverage Diff @@## main #2037 +/- ##==========================================- Coverage 93.78% 93.68% -0.10%========================================== Files 78 78 Lines 4984 4985 +1 ==========================================- Hits 4674 4670 -4- Misses 310 315 +5
Flags with carried forward coverage won't be shown.Click here to find out more.
|
walterrowe commentedMay 31, 2022
@JohnVillalovos - I think I successfully did this .. double check? |
JohnVillalovos commentedMay 31, 2022
Squash was successful 👍 Can you do a |
…ibute validation, fix boards.py _create_attradd exclusive tuple to RequiredOptional data class to support formutually exclusive attributesconsolidate _check_missing_create_attrs and _check_missing_update_attrsfrom mixins.py into _validate_attrs in utils.pychange _create_attrs in board list manager classes fromrequired=('label_ld',) toexclusive=('label_id','asignee_id','milestone_id')closes#1897walterrowe commentedMay 31, 2022
commit message amended |
JohnVillalovos left a comment
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.
LGTM 👍
walterrowe commentedMay 31, 2022
thanks@JohnVillalovos is this now pending@nejch review? |
nejch commentedMay 31, 2022
Thanks for all the work on this@walterrowe! I had some thoughts on the logic for optionals as we said and I'd like to add some tests for this, but I'll do that in a follow-up, let's get this merged :) |
Uh oh!
There was an error while loading.Please reload this page.
feat: add support for mutually exclusive attributes, consolidate attribute validation, fix boards.py _create_attr
closes#1897