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

Fix: Tracking and regexing correct files for Java release support #825

Merged
merged 1 commit into from
Jul 10, 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
6 changes: 2 additions & 4 deletions pontos/version/commands/_java.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@
# This class is used for Java Version command(s)
class JavaVersionCommand(VersionCommand):
project_file_name = "pom.xml"
_properties_file_path = Path(
"src/main/resources/application-docker.properties"
)
_properties_file_path = Path("src/main/resources/application.properties")
_pom_xml: Optional[etree.Element] = None

def _get_version_from_pom_xml(self) -> Version:
Expand Down Expand Up @@ -136,7 +134,7 @@
if not swagger_config_file:
# skip if not existing
return
pattern = r'.version\("([0-9]+\.[0-9]+\.[0-9]+)"\)'
pattern = r'\.version\("([0-9]+\.[0-9]+\.[0-9]+)"\)'

Check warning on line 137 in pontos/version/commands/_java.py

View check run for this annotation

Codecov / codecov/patch

pontos/version/commands/_java.py#L137

Added line #L137 was not covered by tests
replace_string_in_file(
swagger_config_file, pattern=pattern, replacement=str(new_version)
)
Expand Down
4 changes: 2 additions & 2 deletions tests/version/commands/test_java.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_replace_string_in_file(self):
.version("1.2.3")
glubb
"""
pattern = r'.version\("([0-9]+\.[0-9]+\.[0-9]+)"\)'
pattern = r'\.version\("([0-9]+\.[0-9]+\.[0-9]+)"\)'
replacement = "1.2.4"

with temp_file(content=content) as tmp:
Expand All @@ -98,7 +98,7 @@ def test_replace_string_in_file_no_match(self):
.versio("1.2.3")
glubb
"""
pattern = r'.version\("([0-9]+\.[0-9]+\.[0-9]+)"\)'
pattern = r'\.version\("([0-9]+\.[0-9]+\.[0-9]+)"\)'
replacement = "1.2.4"

with temp_file(content=content) as tmp:
Expand Down
Loading