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

Add New Function, Convert to PDK 2.2 #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

greatflyingsteve
Copy link

@greatflyingsteve greatflyingsteve commented Jan 25, 2022

We needed a function which when given two IP addresses, would return the size of the smallest set of contiguous addresses that contains both arguments. Feed it a starting IP and ending IP, and it returns you the size of that range. There's so much other great, useful stuff in here that it seemed like a pretty natural addition to contribute.

I've also re-fit the module with PDK bindings, which are the first two commits in this PR and about 95% of the total change. If you JUST look at my third commit, that's the only new actual code. Of note for the PDK stuff:

  • All the unit tests still pass exactly as they originally did, tested as far back as Puppet v5.5.22 and as late as v7.9.0
  • The only two rubocop complaints remaining are about missing top-level module and class documentation comments
  • Nothing was otherwise changed until that third commit.

Steps to arrive at the first two commits were:

pdk convert
pdk validate ruby -a

Then go into each function definition and remove the error assignment to e because rubocop was unhappy about it, since e was never referenced again
Increment the module version in metadata.json from 2.2.0 to 2.2.1

For the new work in the 3rd commit, I added the function underpinnings in ip.rb and the parser function, then incremented the module version to 2.3.0.

Also, pretty please tag the 2.2.1 and 2.3.0 commits appropriately - I don't know of a way to include tags in a PR.

@greatflyingsteve greatflyingsteve force-pushed the INFRA-507_range_functions branch from 4d70727 to 9f17f06 Compare January 28, 2022 21:58
@greatflyingsteve greatflyingsteve changed the title Convert to PDK 2.2 Add New Function, Convert to PDK 2.2 Jan 28, 2022
@greatflyingsteve
Copy link
Author

@inkblot if you have a moment

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.

1 participant