Skip to content

Commit

Permalink
Fix: Tracking and regexing correct files for Java release support
Browse files Browse the repository at this point in the history
  • Loading branch information
y0urself committed Jul 10, 2023
1 parent daa588f commit 0861fb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
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 @@ def replace_string_in_file(
# 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 @@ def _update_swagger_config(
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

0 comments on commit 0861fb4

Please sign in to comment.