Conversation
| req_name = collection_req.get('name', None) | ||
| req_version = collection_req.get('version', '*') | ||
| if req_version is not None: | ||
| req_version = str(req_version) |
There was a problem hiding this comment.
@s-hertel have you considered just doing this bare minimum?
There was a problem hiding this comment.
I don't think it's applying to all the potential matches in the provider, is it? Needs some tests, have no idea if/what issues this is fixing.
There was a problem hiding this comment.
Yeah, I know about the tests. I was just pulling some things from my git stash and turning them into draft PRs so they don't rot there.
This is an attempt to address the case when requirements.yml has a version that is parsed by PyYAML as an int or a float causing TypeError tracebacks when some logic down the line assumes the ver attribute is always a string, calling str methods.
There was a problem hiding this comment.
Instead of converting the version to a string, just raise a descriptive error when it's not.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
Before this change, whenever a numeric version was specified in `requirements.yml`, the YAML parser would read it as `int` or `float` which would leak straight down into the dependency resolver. This patch makes an unconditional conversion of that data into `str` right before constructing `Requirement` objects. Fixes ansible#79109 Fixes ansible#78067
f25437a to
e296331
Compare
Before this change, whenever a numeric version was specified in
requirements.yml, the YAML parser would read it asintorfloatwhich would leak straight down into the dependency resolver. This patch makes an unconditional conversion of that data intostrright before constructingRequirementobjects.Fixes #79109
Fixes #78067
SUMMARY
$sbj.
ISSUE TYPE
ADDITIONAL INFORMATION
N/A