Skip to content

Commit bf97f8e

Browse files
committed
Revert changes
1 parent 20ac671 commit bf97f8e

10 files changed

Lines changed: 10 additions & 45 deletions

.github/workflows/citus-package-all-platforms-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- name: Set GH_TOKEN for all steps
4646
run: |
4747
echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV
48+
echo "GITHUB_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV
4849
4950
- name: Setup git authentication for GitHub App
5051
run: |

.github/workflows/package-tests.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,9 @@ jobs:
1919
citus_version: ${{ steps.get-citus-version.outputs.citus_version }}
2020
steps:
2121

22-
- name: Create GitHub App token
23-
id: app
24-
uses: actions/create-github-app-token@v2
25-
with:
26-
app-id: ${{ vars.GH_APP_ID }}
27-
private-key: ${{ secrets.GH_APP_KEY }}
28-
owner: ${{ github.repository_owner }}
29-
30-
- name: Set GH_TOKEN for all steps
31-
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV
32-
33-
- name: Configure git with x-access-token
34-
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"
35-
3622
- name: Checkout
3723
uses: actions/checkout@v3
3824
with:
39-
token: ${{ steps.app.outputs.token }}
4025
fetch-depth: 2
4126

4227
- name: Package version

.github/workflows/publish-docker-image-tests.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414

15-
- name: Create GitHub App token
16-
id: app
17-
uses: actions/create-github-app-token@v1
18-
with:
19-
app-id: ${{ vars.GH_APP_ID }}
20-
private-key: ${{ secrets.GH_APP_KEY }}
21-
owner: ${{ github.repository_owner }}
22-
23-
- name: Set GH_TOKEN for all steps
24-
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV
25-
26-
- name: Configure git with x-access-token
27-
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"
28-
2915
- name: Checkout repository
3016
uses: actions/checkout@v3
31-
with:
32-
token: ${{steps.app.outputs.token}}
3317

3418
- name: Install package dependencies
3519
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources

packaging_automation/citus_package.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ def build_package(
341341
):
342342
docker_image_name = "packaging" if not is_test else "packaging-test"
343343
postgres_extension = "all" if postgres_version == "all" else f"pg{postgres_version}"
344-
os.environ["GH_TOKEN"] = github_token
345344
os.environ["GITHUB_TOKEN"] = github_token
346345
os.environ["CONTAINER_BUILD_RUN_ENABLED"] = "true"
347346
if not os.path.exists(input_output_parameters.output_dir):
@@ -350,7 +349,7 @@ def build_package(
350349
docker_command = (
351350
f"docker run --rm -v {input_output_parameters.output_dir}:/packages -v "
352351
f"{input_output_parameters.input_files_dir}:/buildfiles:ro "
353-
f"-e GH_TOKEN -e GITHUB_TOKEN -e PACKAGE_ENCRYPTION_KEY -e UNENCRYPTED_PACKAGE -e CONTAINER_BUILD_RUN_ENABLED "
352+
f"-e GITHUB_TOKEN -e PACKAGE_ENCRYPTION_KEY -e UNENCRYPTED_PACKAGE -e CONTAINER_BUILD_RUN_ENABLED "
354353
f"-e MSRUSTUP_PAT -e CRATES_IO_MIRROR_FEED_TOKEN -e INSTALL_RUST -e CI "
355354
f"citus/{docker_image_name}:{docker_platform}-{postgres_extension} {build_type.name}"
356355
)

packaging_automation/common_tool_methods.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,11 +677,10 @@ def remove_suffix(initial_str: str, suffix: str) -> str:
677677
return result_str
678678

679679

680-
def initialize_env(exec_path: str, project_name: str, checkout_dir: str):
680+
def initialize_env(exec_path: str, project_name: str, checkout_dir: str, gh_token: str = None):
681+
if gh_token is None:
682+
print("GITHUB_TOKEN not found") # Needed for cloning - may fail
681683
remove_cloned_code(f"{exec_path}/{checkout_dir}")
682-
gh_token = os.getenv("GH_TOKEN")
683-
if not gh_token:
684-
raise ValueError("GH_TOKEN environment variable is required")
685684
if not os.path.exists(checkout_dir):
686685
run(f"git clone https://x-access-token:{gh_token}@github.com/citusdata/{project_name}.git {checkout_dir}")
687686

packaging_automation/tests/test_citus_package.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161
TEST_GPG_KEY_NAME = "Citus Data <[email protected]>"
6262
TEST_GPG_KEY_PASSPHRASE = os.getenv("PACKAGING_PASSPHRASE")
6363
GH_TOKEN = os.getenv("GH_TOKEN")
64-
if not GH_TOKEN:
65-
raise ValueError("GH_TOKEN environment variable is required for tests to run")
6664
PACKAGE_CLOUD_API_TOKEN = os.getenv("PACKAGE_CLOUD_API_TOKEN")
6765
REPO_CLIENT_SECRET = os.getenv("REPO_CLIENT_SECRET")
6866
PLATFORM = get_build_platform(

packaging_automation/tests/test_citus_package_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
TEST_GPG_KEY_NAME = "Citus Data <[email protected]>"
3535
TEST_GPG_KEY_PASSPHRASE = "Citus123"
3636
GH_TOKEN = os.getenv("GH_TOKEN")
37-
3837
PACKAGING_SOURCE_FOLDER = "packaging_test"
3938
PACKAGING_EXEC_FOLDER = f"{TEST_BASE_PATH}/{PACKAGING_SOURCE_FOLDER}"
4039
OUTPUT_FOLDER = f"{PACKAGING_EXEC_FOLDER}/packages"

packaging_automation/tests/test_common_tool_methods.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
str_array_to_str,
4747
)
4848

49-
GH_TOKEN = os.getenv("GH_TOKEN")
49+
GITHUB_TOKEN = os.getenv("GH_TOKEN")
5050
BASE_PATH = pathlib2.Path(__file__).parents[1]
5151
TEST_BASE_PATH = pathlib2.Path(__file__).parent.absolute()
5252
TEST_GPG_KEY_NAME = "Citus Data <[email protected]>"
@@ -264,7 +264,7 @@ def test_prepend_line_in_file():
264264

265265
def test_getprs():
266266
# created at is not seen on Github. Should be checked on API result
267-
g = Github(GH_TOKEN)
267+
g = Github(GITHUB_TOKEN)
268268
repository = g.get_repo("citusdata/citus")
269269
prs = get_prs_for_patch_release(
270270
repository,
@@ -277,7 +277,7 @@ def test_getprs():
277277

278278

279279
def test_getprs_with_backlog_label():
280-
g = Github(GH_TOKEN)
280+
g = Github(GITHUB_TOKEN)
281281
repository = g.get_repo("citusdata/citus")
282282
prs = get_prs_for_patch_release(
283283
repository,

packaging_automation/tests/test_prepare_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def initialize_env() -> str:
4040
test_base_path_major = f"{BASE_PATH}/{uuid.uuid4()}"
4141
remove_cloned_code(test_base_path_major)
4242
if not os.path.exists(test_base_path_major):
43-
run(f"git clone https://x-access-token:{GH_TOKEN}@github.com/citusdata/citus.git {test_base_path_major}")
43+
run(f"git clone https://x-access-token:{github_token}@github.com/citusdata/citus.git {test_base_path_major}")
4444
return test_base_path_major
4545

4646

packaging_automation/tests/test_update_package_properties.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
TEST_BASE_PATH = pathlib2.Path(__file__).parent.absolute()
2727
BASE_PATH = os.getenv("BASE_PATH", default=pathlib2.Path(__file__).parents[1])
28-
GH_TOKEN = os.getenv("GH_TOKEN")
28+
GITHUB_TOKEN = os.getenv("GH_TOKEN")
2929
PROJECT_VERSION = os.getenv("PROJECT_VERSION", default="10.2.4")
3030
TAG_NAME = os.getenv("TAG_NAME", default="v10.2.4")
3131
PROJECT_NAME = os.getenv("PROJECT_NAME", default="citus")

0 commit comments

Comments
 (0)