Skip to content

Commit

Permalink
Merge pull request #686 from vespa-engine/revert-685-tmaregge/upperca…
Browse files Browse the repository at this point in the history
…se-app-name-error

Revert "Update application package name checks"
  • Loading branch information
tmaregge committed Feb 27, 2024
2 parents 5ee783f + abbecb8 commit 57a1f8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
8 changes: 1 addition & 7 deletions tests/unit/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1305,13 +1305,7 @@ def test_invalid_name(self):
with pytest.raises(ValueError):
ApplicationPackage(name="test_app")
with pytest.raises(ValueError):
ApplicationPackage(name="test--app")
with pytest.raises(ValueError):
ApplicationPackage(name="42test-app")
with pytest.raises(ValueError):
ApplicationPackage(name="Test-app")
with pytest.raises(ValueError):
ApplicationPackage(name="test-app" + "x" * 20)
ApplicationPackage(name="test-app")


class TestFieldAlias(unittest.TestCase):
Expand Down
10 changes: 2 additions & 8 deletions vespa/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -2076,15 +2076,9 @@ def __init__(
It will create a default :class:`Schema`, :class:`QueryProfile` and :class:`QueryProfileType` that you can then
populate with specifics of your application.
"""
if not (
name[0].isalpha()
and name.islower()
and len(name) <= 20
and all(char.isalnum() or char == "-" for char in name)
and "--" not in name
):
if not name.isalnum():
raise ValueError(
"Application name must start with a letter, must be lowercase, can only contain [a-z0-9] and single dashes (not consecutive), and may contain no more than 20 characters, was '{}'".format(
"Application package name can only contain [a-zA-Z0-9], was '{}'".format(
name
)
)
Expand Down

0 comments on commit 57a1f8b

Please sign in to comment.