Restrict the regex to only allow 0 or 1. Not 10.#1730
Restrict the regex to only allow 0 or 1. Not 10.#1730adrienthebo merged 1 commit intopuppetlabs:masterfrom deanwilson:yumrepo_restrict_enabled
Conversation
|
CLA Signed by deanwilson on 2010-10-21 21:00:00 -0700 |
|
or +1, and I assume there was an irc convo about not using the boolean support. |
|
@djmitche Actually the extent of the conversation was me pointing out that it existed. I don't think we can use it though, since the |
|
That sounds like a lot of quite invasive changes to the type - which is pending a split to type and provider anyway. This was the smallest code change I could make to ensure the regex did what was intended. |
There was a problem hiding this comment.
This change has to touch a bunch of different locations but it's the same regex. Perhaps this regex could be extracted to a constant and then that constant could be referenced in each newvalue?
|
Thank you for this contribution! Would it be possible to get some unit test coverage for these changes to help prevent regressions? |
|
I noticed this hasn't seen any activity in about a week. Is there a chance you'll be able to work on this in the coming week? No pressure, just checking in. |
|
Normally I'd be ok with putting at least some basic unit tests in with a pull request but the yumrepo type is a horrible, horrible place full of evil and neglect and I'd rather maintain my own fork than touch its unified type and provider approach. I'll be happy to add some tests when it gets split in to seperate types and providers but in the mean time please don't make me go back in there... "# these tests were ported from the old spec/unit/type/yumrepo_spec.rb, pretty much verbatim" serves as adequate warning to those of us not of the 'Labs. |
|
"please don't make me go back in there" -- Best pull req comment I've seen in a while! I've gotten myself in trouble before accepting changes without tests. This is one of those areas where tech-debt accumulates quickly. IMHO, and I'm not an authority, the best approach is to leave the pull request as-is until someone (@deanwilson or someone else) can refactor the code to be more testable. |
1 similar comment
|
"please don't make me go back in there" -- Best pull req comment I've seen in a while! I've gotten myself in trouble before accepting changes without tests. This is one of those areas where tech-debt accumulates quickly. IMHO, and I'm not an authority, the best approach is to leave the pull request as-is until someone (@deanwilson or someone else) can refactor the code to be more testable. |
|
@deanwilson I had not realized how horrible those specs were until I looked myself; sorry about that. They're pretty ghastly. I see two main options here.
If anyone is feeling hardcore I would be totally willing to help them out on the rewrite; I would like to see this fixed and will chip in whatever effort I can. Alternately @deanwilson if you're happy with this as-is, then we can just merge it for now. What do you think? |
|
There are at least two partial implementations of a split yumrepo type/provider already attached to tickets in http://projects.puppetlabs.com/issues/ - one by puppetmasterd himself - so I'm a little skepticial of how quickly this'd get done knowing it's been tried multiple times before. Doing this as a proper split provider will probably need the Inifile lib pulled in to core too; which will lead to more discussions. I'm also pretty sure that the AugeasProviders version won't happen until after the splits been done so I don't see a quick win here. This patch was a side effect of the s3_enabled one; which is the patch I really care about ;) so while I'd say this should be a small enough change that it could go in without the unit test safety net I'm not going to push. |
|
In that case I am happy with merging this in as-is. Right now the build isn't passing acceptance tests so this can't be merged right now, but as soon as that goes green I'll merge this. Thanks for the contribution! |
Restrict the regex to only allow 0 or 1. Not 10.
|
summary: merged into master in 9557b51; this should be released in 3.3.0. Thanks again for the contribution! |
Restrict allowed yumrepo values to 0 | 1. Not 10
Issue number #21458