Skip to content

Commit 1bdd130

Browse files
Adds support for onebranch changes (#233)
* Adds procedure to be able to write postgres versions * Adds procedure to be able to validate warnings
1 parent 4a2d487 commit 1bdd130

6 files changed

Lines changed: 33 additions & 5 deletions

File tree

packaging_automation/citus_package.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,14 @@ def build_package(github_token: non_empty(non_blank(str)),
232232
docker_image_name = "packaging" if not is_test else "packaging-test"
233233
postgres_extension = "all" if postgres_version == "all" else f"pg{postgres_version}"
234234
os.environ["GITHUB_TOKEN"] = github_token
235+
os.environ["CONTAINER_BUILD_RUN_ENABLED"] = "true"
235236
if not os.path.exists(input_output_parameters.output_dir):
236237
os.makedirs(input_output_parameters.output_dir)
237238

238239
output = run_with_output(
239240
f'docker run --rm -v {input_output_parameters.output_dir}:/packages -v '
240241
f'{input_output_parameters.input_files_dir}:/buildfiles:ro -e '
241-
f'GITHUB_TOKEN -e PACKAGE_ENCRYPTION_KEY -e UNENCRYPTED_PACKAGE '
242+
f'GITHUB_TOKEN -e PACKAGE_ENCRYPTION_KEY -e UNENCRYPTED_PACKAGE -e CONTAINER_BUILD_RUN_ENABLED '
242243
f'citus/{docker_image_name}:{docker_platform}-{postgres_extension} {build_type.name}', text=True)
243244

244245
if output.stdout:

packaging_automation/requirements.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ GitPython
33
Jinja2
44
parameters_validation
55
pathlib2
6-
psycopg2
6+
psycopg2-binary
77
pycurl
88
PyGithub
99
pytest
@@ -16,3 +16,4 @@ urllib3
1616
wheel
1717
python-dotenv
1818
prospector[with_everything]
19+
setuptools==58

packaging_automation/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile
2+
# This file is autogenerated by pip-compile with python 3.8
33
# To update, run:
44
#
55
# pip-compile
@@ -81,7 +81,7 @@ pluggy==0.13.1
8181
# via pytest
8282
prospector[with_everything]==1.5.0.1
8383
# via -r requirements.in
84-
psycopg2==2.9.1
84+
psycopg2-binary==2.9.3
8585
# via -r requirements.in
8686
py==1.10.0
8787
# via pytest

packaging_automation/tests/test_package_cloud_statistics_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def get_filtered_package_count(session) -> int:
5353
# Since package count for our test repo is lower than 100, we get the total package details by getting all the
5454
# packages in one call
5555
result = stat_get_request(
56-
package_list_with_pagination_request_address(PACKAGE_CLOUD_PARAMETERS, 1, 100),
56+
package_list_with_pagination_request_address(PACKAGE_CLOUD_PARAMETERS, 1, 200),
5757
RequestType.package_cloud_list_package, session)
5858
package_info_list = json.loads(result.content)
5959
package_list = list(filter(
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import argparse
2+
3+
from .packaging_warning_handler import (validate_output)
4+
from .common_tool_methods import (PackageType)
5+
from pathlib import Path
6+
7+
if __name__ == "__main__":
8+
parser = argparse.ArgumentParser()
9+
parser.add_argument('--output_file', required=True)
10+
parser.add_argument('--ignore_file', required=True)
11+
parser.add_argument('--package_type', choices=[p.name for p in PackageType], required=True)
12+
13+
args = parser.parse_args()
14+
build_output = Path(args.output_file).read_text()
15+
validate_output(build_output, args.ignore_file, PackageType[args.package_type])
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import argparse
2+
3+
from .citus_package import (write_postgres_versions_into_file)
4+
5+
if __name__ == "__main__":
6+
parser = argparse.ArgumentParser()
7+
parser.add_argument('--project_version', required=True)
8+
parser.add_argument('--input_files_dir', required=True)
9+
10+
args = parser.parse_args()
11+
write_postgres_versions_into_file(args.input_files_dir,args.project_version)

0 commit comments

Comments
 (0)