-
Notifications
You must be signed in to change notification settings - Fork 13
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
Fix typo & Fix app_id requirement and default #124
base: develop
Are you sure you want to change the base?
Conversation
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.
HI @StevenH1901,
Thank you for opening this PR, Some things need to be in place before we can merge it.
- combine all fix typo commits to a single commit
- add a test for checking the behavior of the app_id parameter, ideally for all common parameters
- extend the section test to check the list_order parameter.
@cmeissner - Not 100% sure if this is what you were expecting, but if not let me know and I can get it fixed. I'm also not sure how to combine two commits that have different commits between them. |
Thank you for adding/extending the requested tests. I did not find the time to run it on my system. May I ask you to enable the I will try to review your PR completely on the weekend. |
permissions=dict(type='json', required=False, default=None), | ||
strict_mode=dict(type='bool', required=False), | ||
subnet_ordering=dict(type='bool', required=False, phpipam_name='subnetOrdering'), | ||
list_order=dict(type='bool', required=False, phpipam_name='order'), | ||
list_order=dict(type='int', required=False, phpipam_name='order'), |
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.
From your test, I noticed that list_order accepts values from 1 to 3. Are there corresponding strings used in the UI?
Maybe you can point to the correct point in the UI. If there are strings in the UI, we need to provide it here to work with these words instead of int. And in background, we need to translate these strings to int's for talking to the API.
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.
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.
I checked the result from the API, if I queried a section
$ curl -sk -XGET -H "phpipam-token: ${PHPIPAM_TOKEN}" ${PHPIPAM_API_URL}/sections/2 | jq
{
"code": 200,
"success": true,
"data": {
"id": "2",
"name": "IPv6",
"description": "Section for IPv6 addresses",
"masterSection": "0",
"permissions": "{\"2\":\"2\",\"3\":\"1\"}",
"strictMode": "1",
"subnetOrdering": "subnet,asc",
"order": null,
"editDate": "2025-01-22 14:55:26",
"showVLAN": "0",
"showVRF": "0",
"showSupernetOnly": "0",
"DNS": null
},
"time": 0.003
}
subnetOrdering
is corresponding with the one I found in the UI. For order
which corresponds with list_order
, I was unable to find a UI element. Can you please guide me to the corresponding UI element to check different values available for that property?
On the other hand, I recognized that we do not handle subnetOrdering
with this module and here we can open a follow-up issue to track and implement it later.
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.
You need to put list_order
in base_section_data
to have it tested in test-section
.
If you do so, the test shows no idempotency anymore. Please investigate further.
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.
I would suggest to split the list_order
issue into another new issue. Cherry-pick the commits you made so far into another branch and remove them from this branch.
So we only handle here the app_id
issue and the two typos.
I expect that the list_order
issue would become greater, because of missing idempotency and the confusion between oder
and list_order
.
Per the section_module docs (and all other modules), app_id is not a required parameter and should default to 'ansible'.
When running version 1.7.0, I receive an error saying that 'app_id' is a required parameter. This error may be present in previous versions, but I have not verified.
Fixes #123