From 536da2bc2c4ed12e136af91ee7a7a40f647fc7de Mon Sep 17 00:00:00 2001 From: Vishnu Challa Date: Mon, 6 Jan 2025 20:49:01 -0500 Subject: [PATCH] Bug fix in ROSA HCP filter Signed-off-by: Vishnu Challa --- .github/workflows/poetry-check.yaml | 36 +++++++++++++++++++---------- backend/app/api/v1/commons/utils.py | 4 +++- backend/backend.containerfile | 1 + 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.github/workflows/poetry-check.yaml b/.github/workflows/poetry-check.yaml index c7ad2d3d..ad1ecd32 100644 --- a/.github/workflows/poetry-check.yaml +++ b/.github/workflows/poetry-check.yaml @@ -3,18 +3,30 @@ on: [ pull_request ] jobs: build: - name: Check poetry lockfile + name: Check Poetry Lockfile runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - uses: Gr1N/setup-poetry@v8 - - name: verify poetry instalation - run: poetry --version - working-directory: ./backend - - name: verify poetry lockfile - run: poetry check --lock - working-directory: ./backend \ No newline at end of file + # Step 1: Check out the repository + - uses: actions/checkout@v3 + + # Step 2: Set up Python + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + + # Step 3: Install Poetry + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "::add-path::${HOME}/.local/bin" + + # Step 4: Verify Poetry installation + - name: Verify Poetry installation + run: poetry --version + working-directory: ./backend + + # Step 5: Verify Poetry lockfile + - name: Verify Poetry lockfile + run: poetry lock --check + working-directory: ./backend diff --git a/backend/app/api/v1/commons/utils.py b/backend/app/api/v1/commons/utils.py index 6985e9e7..1106ee41 100644 --- a/backend/app/api/v1/commons/utils.py +++ b/backend/app/api/v1/commons/utils.py @@ -39,7 +39,9 @@ def isRehearse(job): def clasifyAWSJobs(job): - if job["upstreamJob"].__contains__("rosa-hcp"): + if ("rosa-hcp" in job["clusterType"]) or ("rosa" in job["clusterType"] + and job["masterNodesCount"] == 0 + and job["infraNodesCount"] == 0): return "AWS ROSA-HCP" if job["clusterType"].__contains__("rosa"): return "AWS ROSA" diff --git a/backend/backend.containerfile b/backend/backend.containerfile index 1e7f11be..6118e4e4 100644 --- a/backend/backend.containerfile +++ b/backend/backend.containerfile @@ -18,6 +18,7 @@ EXPOSE 8000 RUN dnf install -y pip gcc python3-devel gcc-c++ RUN pip install --user poetry && \ + poetry self add poetry-plugin-export && \ poetry export -f requirements.txt -o requirements.txt && \ pip install -U typing-extensions && \ pip install --user dash && \