Conversation
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
When loading protobuf include paths from the pyproject.toml file, the paths are received as an array/list. If we convert them to a comma-separated string there is the risk of a path containing commas to be split incorrectly, leading to compilation errors. Using the original array/list of paths instead of a comma-separated string is safer and more flexible. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
When include paths are passed via the commnad-line, they are passed as a comma-separated string. This means the user could add extra spaces or pass a double-comma, which would result in empty strings in the include paths list, making the protobuf compiler fail. This commit cleans the include paths by stripping whitespace and ignoring empty strings. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
This means that a version like v0x1e1 were accepted as valid semver versions. Now this version is not considered a semver version anymore. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
There was a problem hiding this comment.
Pull Request Overview
This PR merges v0.13.x into v0.x.x, updating tests, improving include_paths handling in the gRPC compile command, and fixing documentation typos and regex precision.
- Adds new test cases for equality and malformed versions in
compare_mike_version - Enhances
CompileProto.runto accept both strings and iterables forinclude_paths - Corrects typos and tightens regex in mkdocs and nox configuration modules
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/mkdocs/test_mike.py | Added test tuples for identical version strings and malformed version patterns |
| src/frequenz/repo/config/setuptools/grpc_tools.py | Switched include_paths to `str |
| src/frequenz/repo/config/nox/init.py | Fixed “typedefault” typo to “default” |
| src/frequenz/repo/config/mkdocs/mike.py | Escaped dots in regex, tightened groupings, and added an exact-equality check |
| src/frequenz/repo/config/init.py | Corrected “delelopment” typo to “development” |
Comments suppressed due to low confidence (2)
tests/mkdocs/test_mike.py:269
- Consider adding test cases for valid versions when both inputs are identical (e.g., ("v1.0-dev", "v1.0-dev", 0) and ("v1.0-pre", "v1.0-pre", 0)) to verify the new equality branch handles version strings as well.
("blah", "blah", 0),
src/frequenz/repo/config/setuptools/grpc_tools.py:85
- Add unit tests for
CompileProto.run()to cover both a comma-separated string and an Iterable input forinclude_paths, ensuring the match-case branches behave as expected.
match self.include_paths:
Contributor
Author
|
Will force-merge, as this is just a merge... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.