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

Package test pipeline #219

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
9 changes: 7 additions & 2 deletions packaging_automation/common_tool_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from .common_validations import (is_tag, is_version)
from .dbconfig import RequestLog, RequestType

RELEASE_STAGE_SEPARATOR = "_"

BASE_GIT_PATH = pathlib2.Path(__file__).parents[1]
PATCH_VERSION_MATCH_FROM_MINOR_SUFFIX = r"\.\d{1,3}"
POSTGRES_MATRIX_FLIE_NAME = "postgres-matrix.yml"
Expand Down Expand Up @@ -87,7 +89,7 @@ def get_minor_project_version(project_version: str) -> str:


def project_version_contains_release_stage(project_version: str) -> bool:
return "_" in project_version
return RELEASE_STAGE_SEPARATOR in project_version


def get_minor_project_version_for_docker(project_version: str) -> str:
Expand Down Expand Up @@ -395,7 +397,7 @@ def remove_cloned_code(exec_path: str):


def process_template_file_with_minor(project_version: str, templates_path: str, template_file_path: str,
minor_version: str,postgres_version: str = ""):
minor_version: str, postgres_version: str = ""):
''' This function gets the template files, changes tha parameters inside the file and returns the output.
Template files are stored under packaging_automation/templates and these files include parametric items in the
format of {{parameter_name}}. This function is used while creating docker files and pgxn files which include
Expand Down Expand Up @@ -652,6 +654,9 @@ def match_release_version(versions_dictionary, package_version: str):


def get_numeric_counterpart_of_version(package_version: str):
# If there is release stage
if project_version_contains_release_stage(project_version=package_version):
package_version = package_version.split(RELEASE_STAGE_SEPARATOR)[0]
numbers_in_version = package_version.split(".")
# add a 0 if version is minor to calculate and match for patch releases accurately
if len(numbers_in_version) == 2:
Expand Down