Skip to content
Merged
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
60 changes: 37 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,35 @@
with:
python-version: "3.11"

# --locked fails the job when uv.lock does not match pyproject, so CI
# resolves exactly what a developer resolved rather than picking up a
# newer release mid-run. --no-build installs from wheels only, which
# keeps a dependency's setup.py from executing on the runner.
# Plain `uv sync`, deliberately, on two counts.
#
# The editable workspace members install regardless: --no-build refuses
# source distributions of dependencies, not a local editable install.
# Verified both ways, since the flag reads as though it would block them:
# a sync with an empty UV_CACHE_DIR into a fresh environment installs
# coordinode, langchain-coordinode and llama-index-graph-stores-coordinode
# and imports them, and every job below has run green with the flag on a
# clean runner. Remove it only with evidence, not on the wording.
- run: uv sync --locked --no-build
- run: uv run --locked --no-build ruff check coordinode/ langchain-coordinode/ llama-index-coordinode/ tests/
- run: uv run --locked --no-build ruff format --check coordinode/ langchain-coordinode/ llama-index-coordinode/ tests/
# Resolving fresh is wanted on the pull requests where it actually
# happens, which is not all of them. `uv sync` follows the committed lock
# while that lock satisfies pyproject.toml, so an ordinary pull request
# installs the locked versions. When a pull request moves dependency
# metadata without regenerating the lock, uv resolves the new set and
# these jobs exercise it. `--locked` would instead refuse to run and
# report that the lock needs updating, which says nothing about whether
# the new version works.
#
# The two flags tried here also break the release, and for one shared
# reason: the release bumps the version in pyproject.toml and leaves
# uv.lock naming the old one, so uv has to re-resolve.
#
# --locked fails on exactly that mismatch, reporting that the
# lockfile needs to be updated.
# --no-build fails because re-resolving means building this
# workspace's own three packages, which are source rather
# than wheels: "Building source distributions for
# coordinode is disabled".
#
# Verified on the release branch with a cold cache: both fail there, and
# both pass on that same branch once uv.lock carries the new version. So
# restoring either one means first making the release regenerate the
# lock, and even then it gives up the fresh resolution described above.
- run: uv sync

Check warning on line 45 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEjw&open=AaBYZ2wN5dGRYYcniEjw&pullRequest=86

Check warning on line 45 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEjv&open=AaBYZ2wN5dGRYYcniEjv&pullRequest=86
Comment thread
polaz marked this conversation as resolved.
- run: uv run ruff check coordinode/ langchain-coordinode/ llama-index-coordinode/ tests/

Check warning on line 46 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEjy&open=AaBYZ2wN5dGRYYcniEjy&pullRequest=86

Check warning on line 46 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEjx&open=AaBYZ2wN5dGRYYcniEjx&pullRequest=86
- run: uv run ruff format --check coordinode/ langchain-coordinode/ llama-index-coordinode/ tests/

Check warning on line 47 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj0&open=AaBYZ2wN5dGRYYcniEj0&pullRequest=86

Check warning on line 47 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEjz&open=AaBYZ2wN5dGRYYcniEjz&pullRequest=86
Comment thread
coderabbitai[bot] marked this conversation as resolved.

test:
name: Test (Python ${{ matrix.python-version }})
Expand All @@ -49,13 +63,13 @@
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: uv sync --locked --no-build --all-packages
run: uv sync --all-packages

Check warning on line 66 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj2&open=AaBYZ2wN5dGRYYcniEj2&pullRequest=86

Check warning on line 66 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj1&open=AaBYZ2wN5dGRYYcniEj1&pullRequest=86

- name: Generate proto stubs
run: uv run --locked --no-build make proto
run: uv run make proto

Check warning on line 69 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj3&open=AaBYZ2wN5dGRYYcniEj3&pullRequest=86

Check warning on line 69 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj4&open=AaBYZ2wN5dGRYYcniEj4&pullRequest=86

- name: Unit tests
run: uv run --locked --no-build pytest tests/unit/ -v
run: uv run pytest tests/unit/ -v

Check warning on line 72 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj5&open=AaBYZ2wN5dGRYYcniEj5&pullRequest=86

build-embedded:
name: Build embedded (CI check)
Expand Down Expand Up @@ -83,7 +97,7 @@
- name: Install wheel + run embedded tests
# The main `test` job skips coordinode_embedded with importorskip
# because that runner doesn't build the wheel. This job has the
# wheel install it and run the embedded tests here, then assert
# wheel, so install it and run the embedded tests here, then assert
# nothing was skipped (a skip with the wheel installed means a
# broken manylinux glibc / missing numpy / etc., not the expected
# "no wheel" condition).
Expand Down Expand Up @@ -116,7 +130,7 @@
exit 1
fi
if ! echo "$OUTPUT" | grep -qE '=+ [0-9]+ passed'; then
echo "::error::No tests passed the module was likely not collected"
echo "::error::No tests passed; the module was likely not collected"
exit 1
fi

Expand Down Expand Up @@ -151,18 +165,18 @@
echo "coordinode is ready (attempt $i)"
exit 0
fi
echo "Attempt $i/30 not ready yet, sleeping 5s..."
echo "Attempt $i/30, not ready yet, sleeping 5s..."
sleep 5
done
echo "Error: coordinode did not become healthy after 150s" >&2
exit 1

- name: Install + generate proto
run: |
uv sync --locked --no-build --all-packages
uv run --locked --no-build make proto
uv sync --all-packages

Check warning on line 176 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj7&open=AaBYZ2wN5dGRYYcniEj7&pullRequest=86

Check warning on line 176 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj6&open=AaBYZ2wN5dGRYYcniEj6&pullRequest=86
uv run make proto

Check warning on line 177 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Omitting "--no-build" can lead to the execution of setup scripts. Make sure it is safe here.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj8&open=AaBYZ2wN5dGRYYcniEj8&pullRequest=86

Check warning on line 177 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj9&open=AaBYZ2wN5dGRYYcniEj9&pullRequest=86

- name: Integration tests
env:
COORDINODE_ADDR: "localhost:7080"
run: uv run --locked --no-build pytest tests/integration/ -v --timeout=30
run: uv run pytest tests/integration/ -v --timeout=30

Check warning on line 182 in .github/workflows/ci.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=structured-world_coordinode-python&issues=AaBYZ2wN5dGRYYcniEj-&open=AaBYZ2wN5dGRYYcniEj-&pullRequest=86
Loading