Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameters: Allow 'latest' as a valid release value #263

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions qgispluginci/parameters.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def get_release_version_patterns() -> Dict[str, re.Pattern]:
"v3": r"^v\d+\.\d+\.\d+$",
# See https://github.com/semver/semver/blob/master/semver.md#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
"semver": r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$",
"latest": r"^latest$",
}

@staticmethod
Expand Down
11 changes: 10 additions & 1 deletion test/test_release.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,15 @@ def test_release_changelog(self):
self.assertEqual(0, len(re.findall(r"commitSha1=\d+", str(data))))

def test_release_version_valid_invalid(self):
valid_tags = ["v1.1.1", "v1.1", "1.0.1", "1.1", "1.0.0-alpha", "1.0.0-dev"]
valid_tags = [
"v1.1.1",
"v1.1",
"1.0.1",
"1.1",
"1.0.0-alpha",
"1.0.0-dev",
"latest",
]
invalid_tags = ["1", "v1", ".", ".1"]
expected_valid_results = {
"v1.1.1": ["v3"],
Expand All @@ -217,6 +225,7 @@ def test_release_version_valid_invalid(self):
"1.1": ["simple"],
"1.0.0-alpha": ["semver"],
"1.0.0-dev": ["semver"],
"latest": ["latest"],
}
valid_results = {tag: [] for tag in valid_tags}
patterns = Parameters.get_release_version_patterns()
Expand Down
Loading