Skip to content
Open
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
19 changes: 17 additions & 2 deletions .github/workflows/build-citus-community-nightlies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ env:
MAIN_BRANCH: "all-citus"
PACKAGING_PASSPHRASE: ${{ secrets.PACKAGING_PASSPHRASE }}
PACKAGING_SECRET_KEY: ${{ secrets.PACKAGING_SECRET_KEY }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
DOCKERHUB_USER_NAME: ${{ secrets.DOCKERHUB_USER_NAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
on:
Expand Down Expand Up @@ -32,9 +31,25 @@ jobs:
- ubuntu/jammy

steps:

- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Configure git with x-access-token
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ steps.app.outputs.token }}
fetch-depth: 1
path: tools

Expand All @@ -46,7 +61,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Clone build branch
run: git clone -b "${MAIN_BRANCH}" --depth=1 https://github.com/citusdata/packaging.git packaging
run: git clone -b "${MAIN_BRANCH}" --depth=1 https://github.com/citusdata/packaging.git packaging

- name: Install package dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/citus-package-all-platforms-test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Citus package all platforms tests

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
PACKAGING_PASSPHRASE: ${{ secrets.PACKAGING_PASSPHRASE }}
MICROSOFT_EMAIL: gindibay@microsoft.com
USER_NAME: Gurkan Indibay
Expand Down Expand Up @@ -36,8 +34,26 @@ jobs:
PLATFORM: ${{ matrix.platform }}

steps:
- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: |
echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Setup git authentication for GitHub App
run: |
git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ steps.app.outputs.token }}

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete-packagecloud-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/package-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,27 @@ jobs:
pg_versions: ${{ steps.generate-postgres.outputs.pg_versions }}
citus_version: ${{ steps.get-citus-version.outputs.citus_version }}
steps:

- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Configure git with x-access-token
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.app.outputs.token }}
fetch-depth: 2

- name: Package version
id: get-citus-version
run: |
Expand Down Expand Up @@ -60,8 +77,24 @@ jobs:
PLATFORM: ${{ matrix.platform }}

steps:
- name: Checkout repository
- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v2
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Configure git with x-access-token
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.app.outputs.token }}

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/packaging-methods-tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Packaging helper methods tests

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}

on:
push:
branches:
Expand All @@ -13,10 +10,25 @@ on:
jobs:
unit_test_execution:
runs-on: ubuntu-latest

steps:
- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Configure git with x-access-token
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ steps.app.outputs.token }}

- name: Install package dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/publish-docker-image-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,26 @@ on:
jobs:
unit_test_execution:
runs-on: ubuntu-latest

steps:

- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Configure git with x-access-token
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{steps.app.outputs.token}}

- name: Install package dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-statistics-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3

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

Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/statistic-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ env:
DB_PASSWORD: ${{ secrets.STATS_DB_PASSWORD }}
DB_HOST_AND_PORT: ${{ secrets.STATS_DB_HOST_AND_PORT }}
DB_NAME: ${{ secrets.STATS_DB_NAME }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
on:
schedule:
- cron: "0 16 * * *"
Expand All @@ -25,8 +24,24 @@ jobs:
job_name: [docker_pull_citus, github_clone_citus, homebrew_citus]

steps:
- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Configure git with x-access-token
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ steps.app.outputs.token }}

- name: Install package dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/statistic-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ env:
DB_PASSWORD: ${{ secrets.STATS_DB_PASSWORD }}
DB_HOST_AND_PORT: ${{ secrets.STATS_DB_HOST_AND_PORT }}
DB_NAME: ${{ secrets.STATS_DB_NAME }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
PACKAGE_CLOUD_API_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_TOKEN }}
PACKAGE_CLOUD_ADMIN_API_TOKEN: ${{ secrets.PACKAGE_CLOUD_ADMIN_API_TOKEN }}
on:
Expand All @@ -19,10 +18,26 @@ on:
jobs:
unit_test_execution:
runs-on: ubuntu-latest

steps:
- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Configure git with x-access-token
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ steps.app.outputs.token }}

- name: Install package dependencies
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev python3-testresources
Expand Down
19 changes: 17 additions & 2 deletions .github/workflows/tool-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Tool Tests

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MICROSOFT_EMAIL: gindibay@microsoft.com
USER_NAME: Gurkan Indibay
MAIN_BRANCH: all-citus
Expand All @@ -20,16 +19,32 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Install all scripts
run: make && sudo make install

unit_test_execution:
runs-on: ubuntu-latest

steps:

- name: Create GitHub App token
id: app
uses: actions/create-github-app-token@v1
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
owner: ${{ github.repository_owner }}

- name: Set GH_TOKEN for all steps
run: echo "GH_TOKEN=${{ steps.app.outputs.token }}" >> $GITHUB_ENV

- name: Configure git with x-access-token
run: git config --global url."https://x-access-token:${{ steps.app.outputs.token }}@github.com/".insteadOf "https://github.com/"

- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ steps.app.outputs.token }}
fetch-depth: 0

- name: Set up Python 3.10
Expand Down
5 changes: 4 additions & 1 deletion packaging_automation/common_tool_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -679,8 +679,11 @@ def remove_suffix(initial_str: str, suffix: str) -> str:

def initialize_env(exec_path: str, project_name: str, checkout_dir: str):
remove_cloned_code(f"{exec_path}/{checkout_dir}")
gh_token = os.getenv("GH_TOKEN")
if not gh_token:
raise ValueError("GH_TOKEN environment variable is required")
if not os.path.exists(checkout_dir):
run(f"git clone https://github.com/citusdata/{project_name}.git {checkout_dir}")
run(f"git clone https://x-access-token:{gh_token}@github.com/citusdata/{project_name}.git {checkout_dir}")


def create_pr(
Expand Down
5 changes: 3 additions & 2 deletions packaging_automation/tests/test_citus_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
TEST_GPG_KEY_NAME = "Citus Data <packaging@citusdata.com>"
TEST_GPG_KEY_PASSPHRASE = os.getenv("PACKAGING_PASSPHRASE")
GH_TOKEN = os.getenv("GH_TOKEN")
if not GH_TOKEN:
raise ValueError("GH_TOKEN environment variable is required for tests to run")
PACKAGE_CLOUD_API_TOKEN = os.getenv("PACKAGE_CLOUD_API_TOKEN")
REPO_CLIENT_SECRET = os.getenv("REPO_CLIENT_SECRET")
PLATFORM = get_build_platform(
Expand All @@ -87,8 +89,7 @@ def setup_module():
)
if not os.path.exists(PACKAGING_EXEC_FOLDER):
run(
f"git clone --branch {packaging_branch_name} https://github.com/citusdata/packaging.git"
f" {PACKAGING_EXEC_FOLDER}"
f"git clone --branch {packaging_branch_name} https://x-access-token:{GH_TOKEN}@github.com/citusdata/packaging.git {PACKAGING_EXEC_FOLDER}"
)


Expand Down
2 changes: 1 addition & 1 deletion packaging_automation/tests/test_citus_package_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
def setup_module():
if not os.path.exists("packaging_test"):
run(
f"git clone --branch all-citus-unit-tests https://github.com/citusdata/packaging.git {PACKAGING_SOURCE_FOLDER}"
f"git clone --branch all-citus-unit-tests https://x-access-token:{GH_TOKEN}@github.com/citusdata/packaging.git {PACKAGING_SOURCE_FOLDER}"
)


Expand Down
6 changes: 3 additions & 3 deletions packaging_automation/tests/test_common_tool_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
str_array_to_str,
)

GITHUB_TOKEN = os.getenv("GH_TOKEN")
GH_TOKEN = os.getenv("GH_TOKEN")
BASE_PATH = pathlib2.Path(__file__).parents[1]
TEST_BASE_PATH = pathlib2.Path(__file__).parent.absolute()
TEST_GPG_KEY_NAME = "Citus Data <packaging@citusdata.com>"
Expand Down Expand Up @@ -264,7 +264,7 @@ def test_prepend_line_in_file():

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


def test_getprs_with_backlog_label():
g = Github(GITHUB_TOKEN)
g = Github(GH_TOKEN)
repository = g.get_repo("citusdata/citus")
prs = get_prs_for_patch_release(
repository,
Expand Down
Loading
Loading