Skip to content

Commit 6a2315c

Browse files
[BUGS] Fix CI Workflow Errors (#64)
* Update CI workflows and Poetry version Renamed check_diffs.yml to CI.yml and refactored workflow to remove dynamic directory detection, now explicitly linting and testing 'libs/oci' and 'libs/oracledb'. Updated Poetry version to 2.2.1 in all workflow files for consistency and added workflow_dispatch for manual CI triggers. * Refactor OCI code to appease the lint god Simplify _lint.yml. Rephrase OCI code base to pass make lint checks. * Fix make lint error Fix make lint error: tests/unit_tests/llms/test_oci_model_deployment_endpoint.py:60: error: Missing named argument "response" for "HTTPError" [call-arg] Found 1 error in 1 file (checked 29 source files) * Use Union type to pass make lint check Use Union type to pass make lint check: tests/integration_tests/vectorstores/test_oraclevs.py:1891: error: X | Y syntax for unions requires Python 3.10 [syntax] tests/integration_tests/vectorstores/test_oraclevs.py:2028: error: X | Y syntax for unions requires Python 3.10 [syntax] Found 2 errors in 1 file (checked 22 source files) make: *** [Makefile:33: lint] Error 1 * Add LangGraph and related packages for integration tests Add LangGraph and related packages for integration tests. * Add placeholder integration test for OCI Introduces a placeholder test in the OCI integration tests to ensure no errors are raised when no tests are selected. * Revert commit: Refactor OCI code to appease the lint god * Refactor to pass make lint checks Refactor to pass make lint checks * Refactor oracledb to pass make lint tests * Remove placeholder integration tests and compile-integration-tests job from the CI workflow Deleted test_placeholder.py files and the 'compile' pytest marker from both oci and oracledb libraries. Also removed the compile-integration-tests job from the CI workflow, as these placeholders are no longer needed. * Use default 88 line length in ruff formatting * Remove noqa: E501 comments and reformat long lines This commit removes unnecessary '# noqa: E501' comments throughout the codebase and reformats long lines for improved readability. Docstrings, function signatures, and code examples have been wrapped or split across lines where appropriate. No functional changes were made. * Fix typo in test JSON string for tool calling Corrects the closing quote in the 'arguments' field of the test_meta_tool_calling test to ensure the escaped JSON is properly formatted. * Fix escaped JSON string in test_oci_generative_ai.py Corrects the escaped JSON string in the 'arguments' field of the test_meta_tool_calling test to ensure proper formatting and accurate test coverage. * Remove extra noqa:E501 and split long strings Split long error messages and test strings across multiple lines to improve readability and remove unnecessary noqa: E501 comments. Also reformatted SQL condition string construction in oraclevs.py for better clarity. * Remove redundant Poetry check command Eliminates the duplicate 'poetry check' command, leaving only 'poetry check --lock' to validate the Poetry configuration and lock file.
1 parent 1d4a93c commit 6a2315c

File tree

29 files changed

+3099
-1768
lines changed

29 files changed

+3099
-1768
lines changed

.github/workflows/check_diffs.yml renamed to .github/workflows/CI.yml

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches: [main]
77
pull_request:
8+
workflow_dispatch: # Allows manual triggering from GitHub UI
89

910
# If another push to the same PR or branch happens while this workflow is still running,
1011
# cancel the earlier run in favor of the next run.
@@ -17,62 +18,36 @@ concurrency:
1718
cancel-in-progress: true
1819

1920
env:
20-
POETRY_VERSION: "1.7.1"
21+
POETRY_VERSION: "2.2.1"
2122

2223
jobs:
23-
build:
24-
runs-on: ubuntu-latest
25-
steps:
26-
- uses: actions/checkout@v4
27-
- uses: actions/setup-python@v5
28-
with:
29-
python-version: '3.10'
30-
- id: files
31-
uses: Ana06/get-changed-files@v2.2.0
32-
- id: set-matrix
33-
run: |
34-
python .github/scripts/check_diff.py ${{ steps.files.outputs.all }} >> $GITHUB_OUTPUT
35-
outputs:
36-
dirs-to-lint: ${{ steps.set-matrix.outputs.dirs-to-lint }}
37-
dirs-to-test: ${{ steps.set-matrix.outputs.dirs-to-test }}
3824
lint:
3925
name: cd ${{ matrix.working-directory }}
40-
needs: [ build ]
41-
if: ${{ needs.build.outputs.dirs-to-lint != '[]' }}
4226
strategy:
4327
matrix:
44-
working-directory: ${{ fromJson(needs.build.outputs.dirs-to-lint) }}
28+
working-directory:
29+
- "libs/oci"
30+
- "libs/oracledb"
4531
uses: ./.github/workflows/_lint.yml
4632
with:
4733
working-directory: ${{ matrix.working-directory }}
4834
secrets: inherit
4935

5036
test:
5137
name: cd ${{ matrix.working-directory }}
52-
needs: [ build ]
53-
if: ${{ needs.build.outputs.dirs-to-test != '[]' }}
5438
strategy:
5539
matrix:
56-
working-directory: ${{ fromJson(needs.build.outputs.dirs-to-test) }}
40+
working-directory:
41+
- "libs/oci"
42+
- "libs/oracledb"
5743
uses: ./.github/workflows/_test.yml
5844
with:
5945
working-directory: ${{ matrix.working-directory }}
6046
secrets: inherit
6147

62-
compile-integration-tests:
63-
name: cd ${{ matrix.working-directory }}
64-
needs: [ build ]
65-
if: ${{ needs.build.outputs.dirs-to-test != '[]' }}
66-
strategy:
67-
matrix:
68-
working-directory: ${{ fromJson(needs.build.outputs.dirs-to-test) }}
69-
uses: ./.github/workflows/_compile_integration_test.yml
70-
with:
71-
working-directory: ${{ matrix.working-directory }}
72-
secrets: inherit
7348
ci_success:
7449
name: "CI Success"
75-
needs: [build, lint, test, compile-integration-tests]
50+
needs: [lint, test]
7651
if: |
7752
always()
7853
runs-on: ubuntu-latest

.github/workflows/_compile_integration_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
description: "From which folder this pipeline executes"
1010

1111
env:
12-
POETRY_VERSION: "1.7.1"
12+
POETRY_VERSION: "2.2.1"
1313

1414
jobs:
1515
build:

.github/workflows/_lint.yml

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
description: "From which folder this pipeline executes"
1010

1111
env:
12-
POETRY_VERSION: "1.7.1"
12+
POETRY_VERSION: "2.2.1"
1313
WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }}
1414

1515
# This env var allows us to get inline annotations when ruff has complaints.
@@ -42,17 +42,10 @@ jobs:
4242
working-directory: ${{ inputs.working-directory }}
4343
cache-key: lint-with-extras
4444

45-
- name: Check Poetry File
46-
shell: bash
45+
- name: Check Poetry configuration
4746
working-directory: ${{ inputs.working-directory }}
4847
run: |
49-
poetry check
50-
51-
- name: Check lock file
52-
shell: bash
53-
working-directory: ${{ inputs.working-directory }}
54-
run: |
55-
poetry lock --check
48+
poetry check --lock
5649
5750
- name: Install dependencies
5851
# Also installs dev/lint/test/typing dependencies, to ensure we have
@@ -65,38 +58,9 @@ jobs:
6558
# It doesn't matter how you change it, any change will cause a cache-bust.
6659
working-directory: ${{ inputs.working-directory }}
6760
run: |
68-
poetry install --with lint,typing
69-
70-
- name: Get .mypy_cache to speed up mypy
71-
uses: actions/cache@v4
72-
env:
73-
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2"
74-
with:
75-
path: |
76-
${{ env.WORKDIR }}/.mypy_cache
77-
key: mypy-lint-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }}
78-
79-
80-
- name: Analysing the code with our lint
81-
working-directory: ${{ inputs.working-directory }}
82-
run: |
83-
make lint_package
84-
85-
- name: Install unit+integration test dependencies
86-
working-directory: ${{ inputs.working-directory }}
87-
run: |
88-
poetry install --with test,test_integration
89-
90-
- name: Get .mypy_cache_test to speed up mypy
91-
uses: actions/cache@v4
92-
env:
93-
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2"
94-
with:
95-
path: |
96-
${{ env.WORKDIR }}/.mypy_cache_test
97-
key: mypy-test-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }}
61+
poetry install --with lint,typing,test,test_integration
9862
99-
- name: Analysing the code with our lint
63+
- name: Run linting
10064
working-directory: ${{ inputs.working-directory }}
10165
run: |
102-
make lint_tests
66+
make lint

.github/workflows/_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
description: "From which folder this pipeline executes"
1010

1111
env:
12-
POETRY_VERSION: "1.7.1"
12+
POETRY_VERSION: "2.2.1"
1313

1414
jobs:
1515
build:

libs/oci/Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ lint_tests: PYTHON_FILES=tests
2727
lint_tests: MYPY_CACHE=.mypy_cache_test
2828

2929
lint lint_diff lint_package lint_tests:
30-
poetry run ruff .
31-
poetry run ruff format $(PYTHON_FILES) --diff
32-
poetry run ruff --select I $(PYTHON_FILES)
33-
mkdir -p $(MYPY_CACHE); poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
30+
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check $(PYTHON_FILES)
31+
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff
32+
[ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
3433

3534
format format_diff:
3635
poetry run ruff format $(PYTHON_FILES)
37-
poetry run ruff --select I --fix $(PYTHON_FILES)
36+
poetry run ruff check --select I --fix $(PYTHON_FILES)
3837

3938
spell_check:
4039
poetry run codespell --toml pyproject.toml

0 commit comments

Comments
 (0)