Fix #3153 - Validate tag before build using OCI regex#3191
Merged
milas merged 4 commits intodocker:mainfrom Dec 5, 2023
LombardiDaniel:main
Merged
Fix #3153 - Validate tag before build using OCI regex#3191milas merged 4 commits intodocker:mainfrom LombardiDaniel:main
milas merged 4 commits intodocker:mainfrom
LombardiDaniel:main
Conversation
milas
reviewed
Dec 4, 2023
Contributor
milas
left a comment
There was a problem hiding this comment.
Thanks for the PR! I just kicked off CI and there's some failures - once those are taken care of, I'll get this merged:
- Lint errors -
make ruff(will run inside Docker container) - Unit tests (need to update example tag) -
make unit-test-py3(will run inside Docker container)
Let me know if you have any trouble
Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
…l.com> Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
…di.daniel.o@gmail.com> Signed-off-by: Daniel Lombardi <lombardi.daniel.o@gmail.com>
Contributor
Author
|
@milas Done! the error was due to me changing the exception type and not updating the test! |
milas
approved these changes
Dec 5, 2023
Contributor
milas
left a comment
There was a problem hiding this comment.
👍🏻
Out of curiosity, was it you or the linter that reformatted the test file? (Not a big deal, just surprised)
Contributor
Author
|
No no, i had made a change to better represent the error, before it was |
|
I opened #3240 related to this PR |
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.
Fix #3153, but guarantees that it woud raise the appropriate error.
The regex expression is:
^[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*(\/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*(:[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})?$I made it by combining
^[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*(\/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*and the(:[a-zA-Z0-9_][a-zA-Z0-9._-]{0,127})?group. Both expressions are from the opencontainers/distribution-spec repo, as cited in the docker docs.I also wrote a test for testing a build function call with erroneous tag value.