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

Adding module for Extensible Attributes object #186

Closed
wants to merge 10 commits into from

Conversation

matthewdennett
Copy link
Contributor

This PR is to add the functionality of managing extensible attributes.

  • Examples added to module
  • Documentation added to module

This will address feature request:
#179

@matthewdennett
Copy link
Contributor Author

Hey @hemanthKa677 can you please review this pull request?

@matthewdennett
Copy link
Contributor Author

@ranjishmp @hemanthKa677 any chance this can get a review?

@matthewdennett
Copy link
Contributor Author

@ranjishmp do you have a rough time frame on when that will be implemented?

@ranjishmp
Copy link
Collaborator

@matthewdennett @lkanthinfoblox is managing this now.

@hmalphettes
Copy link
Contributor

@lkanthinfoblox I am also interested in this PR - thanks @matthewdennett for submitting it and for all the other contributions!

I had no problem rebasing this PR on the top of the latest codebase in my github. It is on my github fork.
I am able to configure or update extended attributes with this.

I would like to figure out how to configure the additional properties too eventually.

Let me know if there is anything I can do to help.

hmalphettes added a commit to hmalphettes/infoblox-ansible that referenced this pull request May 19, 2024
infobloxopen/infoblox-ansible/infobloxopen#186 add support for flags to
the extensible attributes module
@matthewdennett
Copy link
Contributor Author

@lkanthinfoblox, is it possible that this one be looked at please?

@lkanthinfoblox
Copy link
Collaborator

@hmalphettes and @matthewdennett, We started looking into this PR. We will update the outcome in couple of days!

@matthewdennett
Copy link
Contributor Author

@lkanthinfoblox, thanks for the reply.

What can we do in the future to avoid waiting ~1 year for a review? Happy to discuss in the discussion thread here if that suits better? - #150 (comment)

@JkhatriInfobox
Copy link
Collaborator

Hello @matthewdennett, I noticed that your pull request has been open for a while. Could you please update it with the latest changes from the master branch and resolve any conflicts if they exist? This will help us to review and merge your changes more efficiently.

matthewdennett and others added 2 commits May 29, 2024 08:16
* Add extensible attribute module

* added choices to IB_spec

* doco

* Add the struct creation to api

* doco

* pep and lint
* feat: DTC TCP monitor

* fix: linting+sanity tests

* fix: remove test

* fix: wrongly named integration test directory

* fix: more linting fun

* fix: attempt at fixing integration test by not using cannonical name for new module

* fix: roll back previous commit

* feat: add ICMP monitor

* feat: add example playbooks for ICMP monitor

* fix: icmp unit test

* feat: DTC PDP monitor support

* fix: default for PDP port

* feat: HTTP monitor

* fix: forgot to declare constant

* fix: small copy-paste error in docs

* feat: add support for SIP DTC monitors

* feat: Add support for DTC SNMP monitors

* fix: unit test

* feat: first stab at topology support

* fix: unit test

* fix: unit test

* fix: unit test

* chore: typos

* chore: linting

* fix: topology rule transform

* feat: add new modules to README

* fix: integration tests

* fix: topology integration test
@matthewdennett
Copy link
Contributor Author

@JkhatriInfobox, fingers crossed I didn't break anything with that mege.

hmalphettes added a commit to hmalphettes/infoblox-ansible that referenced this pull request May 29, 2024
infobloxopen/infoblox-ansible/infobloxopen#186 add support for flags to
the extensible attributes module
@hmalphettes
Copy link
Contributor

Wow, thank you both.

The linting run by ansible sanity tests are reporting some missing new lines:

ERROR: Found 2 pep8 issue(s) which need to be resolved:
ERROR: plugins/module_utils/api.py:217:1: E302: expected 2 blank lines, found 1
ERROR: plugins/module_utils/api.py:224:1: E302: expected 2 blank lines, found 1

and also to use yield on a list in a different form for a file that is not touched by this pull request - only on Sanity Tests (devel)
https://github.com/infobloxopen/infoblox-ansible/blob/master/tests/unit/compat/mock.py#L67
https://github.com/infobloxopen/infoblox-ansible/blob/master/tests/unit/compat/mock.py#L94

ERROR: Found 2 pylint issue(s) which need to be resolved:
ERROR: tests/unit/compat/mock.py:67:8: use-yield-from: Use 'yield from' directly instead of yielding each element one by one
ERROR: tests/unit/compat/mock.py:94:12: use-yield-from: Use 'yield from' directly instead of yielding each element one by one

On my branch of Matthew's PR where I added support for configuring multiple values on the extensible attributes via the flags
(matthewdennett/infoblox-ansible@master...hmalphettes:infoblox-ansible:create-ext-attrs-mattdennett)
I added a commit to fix those linting issues.

I don't want to slow things down but if you want me to make a pull request or anything let me know!

@JkhatriInfobox
Copy link
Collaborator

Hi @matthewdennett
We noticed a duplicate commit (fb83da3) in your PR after last force push on your forked master. To maintain git history, please rebase your master and drop this commit,

git rebase -i fb83da309478d0fceacb50284d14b6b9cbefba0c^

Replace “pick” with “drop” for the duplicate commit in the text editor that opens up.

Please note: This operation modifies the commit history, so please proceed with caution. If you’re unsure, consider creating a backup branch first or verify on local before pushing. Also, avoid force pushing after the rebase as it can disrupt the review process.

matthewdennett added a commit to matthewdennett/infoblox-ansible that referenced this pull request May 29, 2024
* Extensible attributes module - support flags

infobloxopen/infoblox-ansible/infobloxopen#186 add support for flags to
the extensible attributes module

* Extensible attributes - fix linting

reported by the ansible sanity tests

---------

Co-authored-by: Hugues Malphettes <[email protected]>
matthewdennett and others added 2 commits May 29, 2024 21:20
* Extensible attributes module - support flags

infobloxopen/infoblox-ansible/infobloxopen#186 add support for flags to
the extensible attributes module

* Extensible attributes - fix linting

reported by the ansible sanity tests

---------

Co-authored-by: Hugues Malphettes <[email protected]>
@matthewdennett
Copy link
Contributor Author

Hi @JkhatriInfobox, that should be fixed up now. I've also included the changes @hmalphettes suggest.

Looks like the sanity tests are failing but the documentation looks correct to me. Have I missed something simple in the doco?

@hmalphettes
Copy link
Contributor

@matthewdennett my thanks for putting in the support for flag.

The sanity tests point at some doc I wrote: ERROR: plugins/modules/nios_extensible_attribute.py:85:24: unparsable-with-libyaml: None - mapping values are not allowed in this context

Hopefully that explains the many more errors reported before that. I'll have a shot at fixing these later today.

hmalphettes added a commit to hmalphettes/infoblox-ansible that referenced this pull request May 30, 2024
hmalphettes added a commit to hmalphettes/infoblox-ansible that referenced this pull request May 30, 2024
@hmalphettes
Copy link
Contributor

@matthewdennett these changes fixe the linting issues reported by the Sanity tests: hmalphettes@6af034d

@matthewdennett
Copy link
Contributor Author

@hmalphettes awesome. I'll try and add those updates at some point tomorrow.

@hmalphettes
Copy link
Contributor

@matthewdennett, we are left with one last line too long error.
Short story: the failing workflow is running against an older version of nios_next_ip.py
@JkhatriInfobox could you trigger a re-run? Otherwise we could always make yet another commit and push it to trigger that.

Here is the investigation if needed:

I checked out your code and ran the github actions from my github account: all is green.

I downloaded the artifacts attached to the latest failing github actions - https://github.com/infobloxopen/infoblox-ansible/actions/runs/9310510563/artifacts/1554330581 - and checked the failing nios_next_ip.py and it does not have the changes @matthewdennett kindly added to fix the issue.

image

When I do the same on my successful run - https://github.com/hmalphettes/infoblox-ansible/actions/runs/9314551322 - we find the expected version of nios_next_ip.py

I am hoping it is just a cache issue and all we need is to trigger the github actions again.

@matthewdennett
Copy link
Contributor Author

I noticed this too and made a few commits but nothing seemed to make it register the change.

@matthewdennett
Copy link
Contributor Author

@JkhatriInfobox, can you please have a look at the issue we are seeing here?

JkhatriInfobox pushed a commit that referenced this pull request Jun 27, 2024
* Extensible attributes module - support flags

infobloxopen/infoblox-ansible/#186 add support for flags to
the extensible attributes module

* Extensible attributes - fix linting

reported by the ansible sanity tests

---------

Co-authored-by: Hugues Malphettes <[email protected]>
JkhatriInfobox pushed a commit that referenced this pull request Jul 3, 2024
* Extensible attributes module - support flags

infobloxopen/infoblox-ansible/#186 add support for flags to
the extensible attributes module

* Extensible attributes - fix linting

reported by the ansible sanity tests

---------

Co-authored-by: Hugues Malphettes <[email protected]>
@JkhatriInfobox
Copy link
Collaborator

Hi @matthewdennett, @hmalphettes,

We appreciate your PR. Unfortunately, it didn't pass some checks. To address this, we've initiated a new PR with necessary corrections and will be closing PR #186 and #228 once new PR reviewed and merged . Your efforts are truly valued and we invite you to check out the new PR #235.

Additionally, we've identified some functional issues which we plan to rectify in the new PR. We also noticed the absence of unit and integration tests, which we'll be adding.

Thanks again for your contribution.

@hmalphettes
Copy link
Contributor

@JkhatriInfobox thanks for the update and the work of the team on this. Happy to contribute in any manner.

JkhatriInfobox added a commit that referenced this pull request Jul 9, 2024
* Attributes (#4)

* Add extensible attribute module

* added choices to IB_spec

* doco

* Add the struct creation to api

* doco

* pep and lint

* fix pep issues

* Add flags for extensible attributes (#5) (#6)

* Extensible attributes module - support flags

infobloxopen/infoblox-ansible/#186 add support for flags to
the extensible attributes module

* Extensible attributes - fix linting

reported by the ansible sanity tests

---------

Co-authored-by: Hugues Malphettes <[email protected]>

* Documentation update

fix doco

line length

fix line length

PEP issue

pep issue

* [FIX] CI execution for unit test

* [FIX] Github workflows for CI Run

Updated workflow file to support ansible-stable 2.17 and removed 2.14

[FIX] coverage report for stable-2.16

[FIX] changed called_once_with to assert_called_once_with for unit tests

[FIX] compact file deprication for ansible-2.17

* [FIX] Updated unit test case by replacing called_once_with to assert_called_once_with for python3.12

* Updated data type for Min and Max from str to int

---------

Co-authored-by: matthewdennett <[email protected]>
Co-authored-by: matt <[email protected]>
Co-authored-by: Hugues Malphettes <[email protected]>
@JkhatriInfobox
Copy link
Collaborator

Closing this Pull Request as the same modifications have been successfully merged in PR #235. This action is taken to maintain the cleanliness of the project and prevent redundancy. Please feel free to reach out if you need any further assistance.

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.

6 participants