Skip to content

Conversation

@quinntaylormitchell
Copy link
Collaborator

@quinntaylormitchell quinntaylormitchell commented Oct 17, 2025

Description

This PR builds on the infrastructure introduced in PR #1100 and PR #1549 by introducing a parametrized test called test_clp_package that ensures two key configurations of the clp package (clp-text and clp-json) spin up and tear down successfully. test_clp_package uses the contents of a dictionary called CLP_MODE_CONFIGS to spin up each mode in its proper configuration.

The tests are supported by new infrastructure that will make the future expansion of package integration testing easier in two key ways:

  1. Adding new modes of operation in the future (i.e., "clp-json-presto", "clp-json-s3", etc.) will only require adding a description of their configurations to CLP_MODE_CONFIGS.
  2. Future package tests that check the functionality of the package (i.e., compression, search, etc.) can use the new package fixtures.

In addition, this PR introduces

  • several package-related and Docker-related utility functions,
  • one expanded data class and one new data class to describe the package configuration and package instance, respectively, and
  • new taskfile task to automate the new package tests

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Ran the following command in the /clp repo:

task tests:integration:package

The package was built successfully, and each of the two tests (clp-text and clp-json) pass.

In addition, ran the following command from clp/integration-tests:

uv run python -m pytest -m package -k 'clp-json'

The clp-json test ran independently and passed.

Summary by CodeRabbit

  • Tests

    • Added integration tests validating CLP package startup across multiple modes
    • Added fixtures and utilities to manage package instances, configs and runtime validation
    • Introduced a new pytest marker for package-specific tests and enabled verbose test reporting
  • Chores

    • Updated test dependencies and test-run task to support the expanded integration testing workflow

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Walkthrough

Adds integration-test infrastructure: new pytest marker/flags, fixtures to create/start/stop CLP package instances, utilities for config, Docker inspection and package lifecycle, a parameterized startup test, and a task to run package-focused integration tests.

Changes

Cohort / File(s) Summary
Pytest config & task
integration-tests/.pytest.ini, integration-tests/pyproject.toml, taskfiles/tests/integration.yaml, integration-tests/tests/conftest.py
Enable -rA reporting, add package pytest marker, add dev deps (PyYAML, types), register tests.fixtures.package_instance_fixtures and tests.fixtures.package_config_fixtures, and add package integration task.
Fixtures
integration-tests/tests/fixtures/package_config_fixtures.py, integration-tests/tests/fixtures/package_instance_fixtures.py, integration-tests/tests/fixtures/integration_test_config.py
Add clp_config fixture (creates temp YAML package config) and clp_package fixture (starts/stops package instance, yields PackageInstance); remove legacy package_config fixture.
Config utilities
integration-tests/tests/utils/config.py
Add PackageConfig and PackageInstance dataclasses with validation, temp config file generation, script path properties, log/shared-config handling, and instance-id extraction/validation.
Mode & YAML helpers
integration-tests/tests/utils/clp_mode_utils.py, integration-tests/tests/utils/utils.py
Add CLP_MODE_CONFIGS, helpers to compute deterministic mode signatures, get_clp_config_from_mode, YAML loader load_yaml_to_dict, and validate_file_exists.
Docker & package management
integration-tests/tests/utils/docker_utils.py, integration-tests/tests/utils/package_utils.py
Add Docker helpers (list_prefixed_containers, inspect_container_state, status constants) and package lifecycle/health functions (start_clp_package, stop_clp_package, is_package_running, is_running_mode_correct).
Tests
integration-tests/tests/test_package_start.py
Add parameterized test_clp_package that starts packages for configured modes, verifies components are running and mode matches intended configuration.

Sequence Diagram(s)

sequenceDiagram
    participant Test
    participant clp_package as Fixture:clp_package
    participant clp_config as Fixture:clp_config
    participant PackageUtils as package_utils
    participant DockerUtils as docker_utils

    Test->>clp_package: request fixture
    clp_package->>clp_config: request config
    clp_config->>clp_config: build temp YAML config
    clp_config-->>clp_package: return PackageConfig
    clp_package->>PackageUtils: start_clp_package(config)
    PackageUtils->>PackageUtils: run start script (subprocess)
    clp_package->>clp_package: create PackageInstance (reads instance id)
    clp_package-->>Test: yield PackageInstance

    Test->>PackageUtils: is_package_running(instance)
    PackageUtils->>DockerUtils: list_prefixed_containers(...)
    PackageUtils->>DockerUtils: inspect_container_state(...)
    PackageUtils-->>Test: (bool, message)

    Test->>PackageUtils: is_running_mode_correct(instance)
    PackageUtils->>PackageUtils: load shared config, validate, compute signatures
    PackageUtils-->>Test: (bool, message)

    Test->>clp_package: teardown
    clp_package->>PackageUtils: stop_clp_package(instance)
    PackageUtils->>PackageUtils: run stop script (subprocess)
    clp_package->>clp_config: cleanup temp files
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas needing extra attention:
    • integration-tests/tests/utils/package_utils.py — many subprocess paths and detailed error messages.
    • integration-tests/tests/utils/config.py — file I/O, atomic temp file write, instance-id parsing/validation.
    • Fixture lifecycle and teardown ordering across clp_config and clp_package.

Possibly related PRs

Suggested reviewers

  • haiqi96
  • kirkrodrigues

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding tests for startup and teardown of two CLP package modes.
Docstring Coverage ✅ Passed Docstring coverage is 95.83% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 571f313 and e348be0.

⛔ Files ignored due to path filters (1)
  • integration-tests/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • integration-tests/pyproject.toml (1 hunks)
  • integration-tests/tests/utils/config.py (3 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.
📚 Learning: 2025-08-16T10:24:29.316Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-17T16:10:38.722Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-26T21:12:21.655Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1338
File: components/clp-py-utils/clp_py_utils/clp_config.py:753-753
Timestamp: 2025-09-26T21:12:21.655Z
Learning: Python linting rules that catch YODA conditions exist but are not enabled for Python modules in the CLP package due to time constraints. The team prefers to avoid YODA conditions in Python for consistency.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-07-03T13:33:27.460Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-07-03T13:33:27.460Z
Learning: In the CLP codebase, `from __future__ import annotations` imports are used to enable Python pipe notation for union types (e.g., `int | str`) in Python versions before 3.10, and should not be considered unused imports.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-28T08:33:57.487Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-09T04:07:27.083Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-20T22:07:04.953Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/utils/config.py:121-123
Timestamp: 2025-08-20T22:07:04.953Z
Learning: For the CLP integration tests codebase, do not suggest deriving tarball filenames from URLs instead of hard-coding ".tar.gz" extension. The user has explicitly rejected this suggestion.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T10:07:04.654Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/macos/install-all.sh:11-12
Timestamp: 2025-05-06T10:07:04.654Z
Learning: In CLP installation scripts, temporary directories with downloaded files should not be automatically cleaned up on failure (e.g., with EXIT traps) to preserve artifacts for debugging purposes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-07T17:41:15.655Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:27-32
Timestamp: 2025-07-07T17:41:15.655Z
Learning: In CLP installation scripts, consistency across platform scripts is prioritized over defensive programming improvements. For example, when extracting Task binaries with tar in `install-prebuilt-packages.sh`, the extraction pattern should remain consistent with other platform scripts rather than adding defensive flags like `--strip-components=1` to handle potential tarball layout changes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-02T15:23:42.507Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:59-62
Timestamp: 2025-09-02T15:23:42.507Z
Learning: In the CoreConfig class (integration-tests/tests/utils/config.py), clp_binary_path and clp_s_binary_path are decorated with property, so they should be accessed as attributes (without parentheses) rather than method calls.

Applied to files:

  • integration-tests/tests/utils/config.py
🧬 Code graph analysis (1)
integration-tests/tests/utils/config.py (3)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (37-56)
components/clp-py-utils/clp_py_utils/clp_config.py (1)
  • CLPConfig (613-853)
integration-tests/tests/utils/utils.py (3)
  • unlink (81-102)
  • validate_dir_exists (105-112)
  • validate_file_exists (115-122)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: musllinux_1_2-x86_64-static-linked-bins
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: manylinux_2_28-x86_64-static-linked-bins
  • GitHub Check: manylinux_2_28-x86_64-dynamic-linked-bins
  • GitHub Check: rust-checks (ubuntu-24.04)
  • GitHub Check: rust-checks (ubuntu-22.04)
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: build-macos (macos-15, true)
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build-macos (macos-14, true)
🔇 Additional comments (7)
integration-tests/pyproject.toml (1)

30-31: LGTM!

The PyYAML and types-PyYAML dependencies are properly added to support YAML-based configuration management introduced in this PR. The version constraints are appropriate.

integration-tests/tests/utils/config.py (6)

5-21: LGTM!

The new imports are necessary for the enhanced configuration management functionality. All imports are properly utilized in the code below.


93-119: LGTM!

The validation and initialization logic is thorough and well-structured. Directory creation handles race conditions with exist_ok=True, and the delegation to _write_temp_config_file keeps concerns properly separated.


121-129: LGTM!

The properties provide clean access to package lifecycle scripts with clear naming and appropriate path construction.


131-149: LGTM!

The atomic file-write pattern (write to temporary, then replace) is excellent defensive programming that prevents partial writes. The use of yaml.safe_dump with sort_keys=False preserves logical ordering in the configuration file.


190-206: LGTM!

The instance ID validation is thorough with proper error handling. The regex pattern correctly validates a 4-character hexadecimal string, and error messages provide clear context for debugging.


182-188: No issues found.

The constant CLP_DEFAULT_LOG_DIRECTORY_PATH is correctly defined as a relative path (pathlib.Path("var") / "log"), so the path construction on Line 184 works as intended—clp_package_dir and the log directory path are properly joined.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@Bill-hbrhbr Bill-hbrhbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good for a first draft. Still, I feel like quite a bit of refactoring will be needed, and I will def take a closer look at everything after the testing infra migrates a bit.

Some points of importance:

  1. There's definitely no need to modify an existing clp_config.yaml in place. We could keep clp config JSON objects in memory, and dump them into either temp files or log files when we pass them to the package start up script.
  2. For clp config JSON object, we can see if we can maximize the amount of stuff we can reuse in (clp_config.py)[https://github.com/y-scope/clp/blob/94b501b264ab376e2c917fa47b61dd91fca50132/components/clp-py-utils/clp_py_utils/clp_config.py#L28]
  3. See which fixture scope the package instance should assume. You can find the list here. Personally, I believe the module (per-file) scope is the best.
  4. We need new taskfile tasks to automate the new package tests. But we can address that when doing final touch ups.
  5. Misc discussion points that you can find in my individual comments. Let me know if you disagree with whatever I've posted or have better solutions.

@quinntaylormitchell quinntaylormitchell marked this pull request as ready for review November 2, 2025 22:04
@quinntaylormitchell quinntaylormitchell requested a review from a team as a code owner November 2, 2025 22:04
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2da1db and 75672fc.

⛔ Files ignored due to path filters (1)
  • integration-tests/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • integration-tests/.pytest.ini (2 hunks)
  • integration-tests/pyproject.toml (1 hunks)
  • integration-tests/tests/conftest.py (1 hunks)
  • integration-tests/tests/fixtures/integration_test_config.py (1 hunks)
  • integration-tests/tests/fixtures/package_config_fixtures.py (1 hunks)
  • integration-tests/tests/fixtures/package_instance_fixtures.py (1 hunks)
  • integration-tests/tests/test_package_start.py (1 hunks)
  • integration-tests/tests/utils/config.py (3 hunks)
  • integration-tests/tests/utils/docker_utils.py (1 hunks)
  • integration-tests/tests/utils/package_utils.py (1 hunks)
  • integration-tests/tests/utils/utils.py (1 hunks)
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1122
File: components/core/src/clp/clp/CMakeLists.txt:175-195
Timestamp: 2025-07-23T09:54:45.185Z
Learning: In the CLP project, when reviewing CMakeLists.txt changes that introduce new compression library dependencies (BZip2, LibLZMA, LZ4, ZLIB), the team prefers to address conditional linking improvements in separate PRs rather than expanding the scope of focused migration PRs like the LibArchive task-based installation migration.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1405
File: components/clp-package-utils/pyproject.toml:5-15
Timestamp: 2025-10-13T03:24:35.074Z
Learning: In the y-scope/clp repository, the Python 3.9 to 3.10 version requirement change was intentionally deferred to a separate PR (after PR #1405) to reduce review effort, as decided in an offline discussion between junhaoliao and kirkrodrigues.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.
📚 Learning: 2025-08-16T10:24:29.316Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/.pytest.ini
  • integration-tests/tests/test_package_start.py
  • integration-tests/tests/conftest.py
  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
  • integration-tests/tests/fixtures/integration_test_config.py
  • integration-tests/tests/fixtures/package_config_fixtures.py
📚 Learning: 2025-08-17T16:10:38.722Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.

Applied to files:

  • integration-tests/tests/fixtures/package_instance_fixtures.py
  • integration-tests/.pytest.ini
  • integration-tests/tests/test_package_start.py
  • integration-tests/tests/conftest.py
  • integration-tests/tests/utils/config.py
  • integration-tests/tests/fixtures/integration_test_config.py
  • integration-tests/tests/fixtures/package_config_fixtures.py
📚 Learning: 2025-07-28T08:33:57.487Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.

Applied to files:

  • integration-tests/.pytest.ini
  • integration-tests/tests/test_package_start.py
  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-10-27T07:07:37.901Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1501
File: tools/deployment/presto-clp/scripts/init.py:10-13
Timestamp: 2025-10-27T07:07:37.901Z
Learning: In `tools/deployment/presto-clp/scripts/init.py`, the `DATABASE_COMPONENT_NAME` and `DATABASE_DEFAULT_PORT` constants are intentionally duplicated from `clp_py_utils.clp_config` because `clp_py_utils` is not installed in the Presto init script's runtime environment. The two flows are separate and this duplication is documented. There are plans to merge these flows after a future release.

Applied to files:

  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-08-20T05:38:30.720Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1242
File: taskfile.yaml:545-547
Timestamp: 2025-08-20T05:38:30.720Z
Learning: The python component directories in the y-scope/clp repository are kept very clean and only contain essential files: source code directories, pyproject.toml, poetry.lock, README.md, and the dist/ directory. No cache directories, virtual environments, or other transient files exist in the component directories, so additional exclude patterns beyond "dist/**/*" are unnecessary.

Applied to files:

  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-10-18T15:38:01.210Z
Learnt from: sitaowang1998
Repo: y-scope/clp PR: 1417
File: components/clp-py-utils/clp_py_utils/serialization_utils.py:6-13
Timestamp: 2025-10-18T15:38:01.210Z
Learning: In the y-scope/clp repository, parameter descriptions in docstrings are intentionally omitted when the parameter name is self-explanatory. This is the project's preferred documentation style.

Applied to files:

  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-08-09T04:07:27.083Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-20T22:07:04.953Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/utils/config.py:121-123
Timestamp: 2025-08-20T22:07:04.953Z
Learning: For the CLP integration tests codebase, do not suggest deriving tarball filenames from URLs instead of hard-coding ".tar.gz" extension. The user has explicitly rejected this suggestion.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T10:07:04.654Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/macos/install-all.sh:11-12
Timestamp: 2025-05-06T10:07:04.654Z
Learning: In CLP installation scripts, temporary directories with downloaded files should not be automatically cleaned up on failure (e.g., with EXIT traps) to preserve artifacts for debugging purposes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-07T17:41:15.655Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:27-32
Timestamp: 2025-07-07T17:41:15.655Z
Learning: In CLP installation scripts, consistency across platform scripts is prioritized over defensive programming improvements. For example, when extracting Task binaries with tar in `install-prebuilt-packages.sh`, the extraction pattern should remain consistent with other platform scripts rather than adding defensive flags like `--strip-components=1` to handle potential tarball layout changes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-02T15:23:42.507Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:59-62
Timestamp: 2025-09-02T15:23:42.507Z
Learning: In the CoreConfig class (integration-tests/tests/utils/config.py), clp_binary_path and clp_s_binary_path are decorated with property, so they should be accessed as attributes (without parentheses) rather than method calls.

Applied to files:

  • integration-tests/tests/utils/config.py
🧬 Code graph analysis (7)
integration-tests/tests/fixtures/package_instance_fixtures.py (3)
integration-tests/tests/utils/config.py (2)
  • PackageInstance (137-186)
  • PackageInstanceConfig (123-133)
integration-tests/tests/utils/package_utils.py (2)
  • start_clp_package (157-171)
  • stop_clp_package (174-189)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (53-73)
integration-tests/tests/test_package_start.py (3)
integration-tests/tests/utils/config.py (1)
  • PackageInstance (137-186)
integration-tests/tests/utils/package_utils.py (2)
  • is_package_running (192-225)
  • is_running_mode_correct (228-243)
integration-tests/tests/fixtures/package_instance_fixtures.py (1)
  • clp_package (21-48)
integration-tests/tests/conftest.py (1)
integration-tests/tests/utils/utils.py (1)
  • get_env_var (11-21)
integration-tests/tests/utils/package_utils.py (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (53-73)
components/clp-py-utils/clp_py_utils/clp_config.py (3)
  • Package (135-159)
  • QueryEngine (111-114)
  • StorageEngine (95-97)
integration-tests/tests/utils/config.py (5)
  • PackageInstance (137-186)
  • PackageInstanceConfig (123-133)
  • PackageModeConfig (114-119)
  • start_script_path (103-105)
  • stop_script_path (108-110)
integration-tests/tests/utils/docker_utils.py (2)
  • inspect_container_state (48-73)
  • list_prefixed_containers (17-45)
integration-tests/tests/utils/config.py (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (53-73)
components/clp-py-utils/clp_py_utils/clp_config.py (2)
  • QueryEngine (111-114)
  • StorageEngine (95-97)
integration-tests/tests/utils/utils.py (3)
  • unlink (54-75)
  • validate_dir_exists (78-85)
  • validate_file_exists (88-95)
integration-tests/tests/fixtures/integration_test_config.py (1)
  • package_config (24-30)
integration-tests/tests/fixtures/integration_test_config.py (1)
integration-tests/tests/utils/utils.py (1)
  • get_env_var (11-21)
integration-tests/tests/fixtures/package_config_fixtures.py (3)
integration-tests/tests/utils/config.py (3)
  • PackageConfig (64-110)
  • PackageInstanceConfig (123-133)
  • PackageModeConfig (114-119)
integration-tests/tests/utils/package_utils.py (2)
  • get_dict_from_mode_name (69-76)
  • write_temp_config_file (107-129)
integration-tests/tests/fixtures/integration_test_config.py (1)
  • package_config (24-30)
🔇 Additional comments (7)
integration-tests/.pytest.ini (1)

6-6: LGTM!

The -rA flag provides comprehensive test reporting, and the new package marker properly categorizes the package lifecycle tests.

Also applies to: 22-22

integration-tests/tests/utils/utils.py (1)

88-95: LGTM!

The function correctly mirrors validate_dir_exists logic and provides appropriate file validation with a clear error message.

integration-tests/tests/fixtures/integration_test_config.py (1)

27-29: LGTM!

The addition of test_root_dir parameter follows the same pattern used in the integration_test_config fixture and properly resolves the path.

integration-tests/tests/test_package_start.py (1)

19-21: LGTM!

The test structure properly uses pytest markers and parametrization to validate package startup across all configured modes.

integration-tests/tests/utils/docker_utils.py (1)

34-37: Clear failure messaging for docker enumeration.

Falling back to stderr/stdout before raising keeps the runtime diagnostics actionable, especially when docker itself returns terse messages.

integration-tests/tests/utils/config.py (1)

170-185: Great instance-id validation.

The strict 4-digit hex check will catch corrupt logs early and gives a precise failure path back to the operator.

integration-tests/tests/utils/package_utils.py (1)

124-127: Appreciate the atomic config write.

Dropping the YAML to a tmp file and replacing avoids the half-written config issue we’ve run into before.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2df9515 and 63f3ae4.

📒 Files selected for processing (2)
  • integration-tests/tests/utils/config.py (3 hunks)
  • integration-tests/tests/utils/package_utils.py (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1122
File: components/core/src/clp/clp/CMakeLists.txt:175-195
Timestamp: 2025-07-23T09:54:45.185Z
Learning: In the CLP project, when reviewing CMakeLists.txt changes that introduce new compression library dependencies (BZip2, LibLZMA, LZ4, ZLIB), the team prefers to address conditional linking improvements in separate PRs rather than expanding the scope of focused migration PRs like the LibArchive task-based installation migration.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1405
File: components/clp-package-utils/pyproject.toml:5-15
Timestamp: 2025-10-13T03:24:35.074Z
Learning: In the y-scope/clp repository, the Python 3.9 to 3.10 version requirement change was intentionally deferred to a separate PR (after PR #1405) to reduce review effort, as decided in an offline discussion between junhaoliao and kirkrodrigues.
📚 Learning: 2025-08-16T10:24:29.316Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-17T16:10:38.722Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-28T08:33:57.487Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-09T04:07:27.083Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-20T22:07:04.953Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/utils/config.py:121-123
Timestamp: 2025-08-20T22:07:04.953Z
Learning: For the CLP integration tests codebase, do not suggest deriving tarball filenames from URLs instead of hard-coding ".tar.gz" extension. The user has explicitly rejected this suggestion.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T10:07:04.654Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/macos/install-all.sh:11-12
Timestamp: 2025-05-06T10:07:04.654Z
Learning: In CLP installation scripts, temporary directories with downloaded files should not be automatically cleaned up on failure (e.g., with EXIT traps) to preserve artifacts for debugging purposes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-07T17:41:15.655Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:27-32
Timestamp: 2025-07-07T17:41:15.655Z
Learning: In CLP installation scripts, consistency across platform scripts is prioritized over defensive programming improvements. For example, when extracting Task binaries with tar in `install-prebuilt-packages.sh`, the extraction pattern should remain consistent with other platform scripts rather than adding defensive flags like `--strip-components=1` to handle potential tarball layout changes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-02T15:23:42.507Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:59-62
Timestamp: 2025-09-02T15:23:42.507Z
Learning: In the CoreConfig class (integration-tests/tests/utils/config.py), clp_binary_path and clp_s_binary_path are decorated with property, so they should be accessed as attributes (without parentheses) rather than method calls.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-03T13:33:27.460Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-07-03T13:33:27.460Z
Learning: In the CLP codebase, `from __future__ import annotations` imports are used to enable Python pipe notation for union types (e.g., `int | str`) in Python versions before 3.10, and should not be considered unused imports.

Applied to files:

  • integration-tests/tests/utils/config.py
🧬 Code graph analysis (2)
integration-tests/tests/utils/package_utils.py (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (53-73)
components/clp-py-utils/clp_py_utils/clp_config.py (4)
  • CLPConfig (613-853)
  • Package (136-160)
  • QueryEngine (112-115)
  • StorageEngine (96-98)
integration-tests/tests/utils/config.py (5)
  • PackageInstance (138-187)
  • PackageInstanceConfig (124-134)
  • PackageModeConfig (116-120)
  • start_script_path (105-107)
  • stop_script_path (110-112)
integration-tests/tests/utils/docker_utils.py (2)
  • inspect_container_state (48-73)
  • list_prefixed_containers (17-45)
integration-tests/tests/utils/config.py (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (53-73)
components/clp-py-utils/clp_py_utils/clp_config.py (1)
  • CLPConfig (613-853)
integration-tests/tests/utils/utils.py (3)
  • unlink (54-75)
  • validate_dir_exists (78-85)
  • validate_file_exists (88-95)
integration-tests/tests/fixtures/integration_test_config.py (1)
  • package_config (24-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: package-image

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (2)
integration-tests/pyproject.toml (1)

31-31: Per-module overrides recommended instead of global ignore_missing_imports.

Setting ignore_missing_imports = true globally silences all missing import errors project-wide, weakening strict type checking. Since types-PyYAML is already in dependencies, only clp_py_utils (imported in tests/utils/config.py and tests/utils/package_utils.py) lacks stubs.

Apply this diff to preserve strict checking for all modules except those genuinely lacking stubs:

 [tool.mypy]
 strict = true
-ignore_missing_imports = true
+
+[[tool.mypy.overrides]]
+module = ["clp_py_utils.*"]
+ignore_missing_imports = true
integration-tests/tests/test_package_start.py (1)

38-41: Consider removing redundant assertion.

If is_package_running correctly implements its contract, fail_msg should always be non-None when running is False. The assertion on Line 40 is redundant in that case.

Apply this diff if the contract is guaranteed:

 running, fail_msg = is_package_running(package_instance)
 if not running:
-    assert fail_msg is not None
     pytest.fail(fail_msg)

The same applies to Lines 56-59 for is_running_mode_correct.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 63f3ae4 and 0ff9465.

📒 Files selected for processing (7)
  • integration-tests/pyproject.toml (2 hunks)
  • integration-tests/tests/fixtures/integration_test_config.py (0 hunks)
  • integration-tests/tests/fixtures/package_config_fixtures.py (1 hunks)
  • integration-tests/tests/fixtures/package_instance_fixtures.py (1 hunks)
  • integration-tests/tests/test_package_start.py (1 hunks)
  • integration-tests/tests/utils/config.py (3 hunks)
  • integration-tests/tests/utils/package_utils.py (1 hunks)
💤 Files with no reviewable changes (1)
  • integration-tests/tests/fixtures/integration_test_config.py
🧰 Additional context used
🧠 Learnings (21)
📓 Common learnings
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1122
File: components/core/src/clp/clp/CMakeLists.txt:175-195
Timestamp: 2025-07-23T09:54:45.185Z
Learning: In the CLP project, when reviewing CMakeLists.txt changes that introduce new compression library dependencies (BZip2, LibLZMA, LZ4, ZLIB), the team prefers to address conditional linking improvements in separate PRs rather than expanding the scope of focused migration PRs like the LibArchive task-based installation migration.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1405
File: components/clp-package-utils/pyproject.toml:5-15
Timestamp: 2025-10-13T03:24:35.074Z
Learning: In the y-scope/clp repository, the Python 3.9 to 3.10 version requirement change was intentionally deferred to a separate PR (after PR #1405) to reduce review effort, as decided in an offline discussion between junhaoliao and kirkrodrigues.
📚 Learning: 2025-08-16T10:24:29.316Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/tests/fixtures/package_config_fixtures.py
  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-10-22T21:02:31.113Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-08-17T16:10:38.722Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/tests/fixtures/package_config_fixtures.py
  • integration-tests/tests/fixtures/package_instance_fixtures.py
  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-09-26T21:12:21.655Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1338
File: components/clp-py-utils/clp_py_utils/clp_config.py:753-753
Timestamp: 2025-09-26T21:12:21.655Z
Learning: Python linting rules that catch YODA conditions exist but are not enabled for Python modules in the CLP package due to time constraints. The team prefers to avoid YODA conditions in Python for consistency.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-07-03T13:33:27.460Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-07-03T13:33:27.460Z
Learning: In the CLP codebase, `from __future__ import annotations` imports are used to enable Python pipe notation for union types (e.g., `int | str`) in Python versions before 3.10, and should not be considered unused imports.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-10-27T04:05:01.560Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1507
File: taskfiles/deps/lock.yaml:66-76
Timestamp: 2025-10-27T04:05:01.560Z
Learning: In the CLP project, the `uv` CLI tool is documented as a prerequisite in docs/src/dev-docs/building-package.md and is not installed via a task dependency like the rust toolchain. UV is expected to be available in the environment rather than being provisioned by the taskfile system.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-08-24T17:10:44.565Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: taskfiles/lint.yaml:780-781
Timestamp: 2025-08-24T17:10:44.565Z
Learning: The CLP repository is gradually migrating from Black to Ruff for Python formatting. Some modules haven't been set up for Ruff yet, so there's intentional mixed usage of Black and Ruff formatters during this transition period. This should not be flagged as an inconsistency in PR reviews.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-08-20T08:36:38.391Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/__init__.py:1-1
Timestamp: 2025-08-20T08:36:38.391Z
Learning: In the CLP project, __init__.py files should include short module-level docstrings describing the package purpose, as required by their ruff linting configuration, rather than being left empty.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-08-29T07:31:24.032Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1271
File: components/core/tools/scripts/lib_install/centos-stream-9/install-prebuilt-packages.sh:41-43
Timestamp: 2025-08-29T07:31:24.032Z
Learning: In CLP's build tool installation scripts, uv version constraints should use lower bound constraints (uv>=0.8) rather than exact version pinning, following the same philosophy used for other build tools to accommodate platform differences while ensuring minimum required functionality.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-07-28T08:33:57.487Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.

Applied to files:

  • integration-tests/tests/utils/config.py
  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-08-09T04:07:27.083Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-20T22:07:04.953Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/utils/config.py:121-123
Timestamp: 2025-08-20T22:07:04.953Z
Learning: For the CLP integration tests codebase, do not suggest deriving tarball filenames from URLs instead of hard-coding ".tar.gz" extension. The user has explicitly rejected this suggestion.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T10:07:04.654Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/macos/install-all.sh:11-12
Timestamp: 2025-05-06T10:07:04.654Z
Learning: In CLP installation scripts, temporary directories with downloaded files should not be automatically cleaned up on failure (e.g., with EXIT traps) to preserve artifacts for debugging purposes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-07T17:41:15.655Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:27-32
Timestamp: 2025-07-07T17:41:15.655Z
Learning: In CLP installation scripts, consistency across platform scripts is prioritized over defensive programming improvements. For example, when extracting Task binaries with tar in `install-prebuilt-packages.sh`, the extraction pattern should remain consistent with other platform scripts rather than adding defensive flags like `--strip-components=1` to handle potential tarball layout changes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-02T15:23:42.507Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:59-62
Timestamp: 2025-09-02T15:23:42.507Z
Learning: In the CoreConfig class (integration-tests/tests/utils/config.py), clp_binary_path and clp_s_binary_path are decorated with property, so they should be accessed as attributes (without parentheses) rather than method calls.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-10-27T07:07:37.901Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1501
File: tools/deployment/presto-clp/scripts/init.py:10-13
Timestamp: 2025-10-27T07:07:37.901Z
Learning: In `tools/deployment/presto-clp/scripts/init.py`, the `DATABASE_COMPONENT_NAME` and `DATABASE_DEFAULT_PORT` constants are intentionally duplicated from `clp_py_utils.clp_config` because `clp_py_utils` is not installed in the Presto init script's runtime environment. The two flows are separate and this duplication is documented. There are plans to merge these flows after a future release.

Applied to files:

  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-08-20T05:38:30.720Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1242
File: taskfile.yaml:545-547
Timestamp: 2025-08-20T05:38:30.720Z
Learning: The python component directories in the y-scope/clp repository are kept very clean and only contain essential files: source code directories, pyproject.toml, poetry.lock, README.md, and the dist/ directory. No cache directories, virtual environments, or other transient files exist in the component directories, so additional exclude patterns beyond "dist/**/*" are unnecessary.

Applied to files:

  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-11-03T16:17:40.223Z
Learnt from: hoophalab
Repo: y-scope/clp PR: 1535
File: components/clp-rust-utils/src/clp_config/package/config.rs:47-61
Timestamp: 2025-11-03T16:17:40.223Z
Learning: In the y-scope/clp repository, the `ApiServer` struct in `components/clp-rust-utils/src/clp_config/package/config.rs` is a Rust-native configuration type and does not mirror any Python code, unlike other structs in the same file (Config, Database, ResultsCache, Package) which are mirrors of Python definitions.

Applied to files:

  • integration-tests/tests/test_package_start.py
📚 Learning: 2025-10-18T15:38:01.210Z
Learnt from: sitaowang1998
Repo: y-scope/clp PR: 1417
File: components/clp-py-utils/clp_py_utils/serialization_utils.py:6-13
Timestamp: 2025-10-18T15:38:01.210Z
Learning: In the y-scope/clp repository, parameter descriptions in docstrings are intentionally omitted when the parameter name is self-explanatory. This is the project's preferred documentation style.

Applied to files:

  • integration-tests/tests/test_package_start.py
🧬 Code graph analysis (5)
integration-tests/tests/fixtures/package_config_fixtures.py (3)
integration-tests/tests/utils/config.py (1)
  • PackageConfig (66-128)
integration-tests/tests/utils/package_utils.py (2)
  • get_dict_from_mode_name (72-81)
  • write_temp_config_file (104-126)
integration-tests/tests/utils/utils.py (1)
  • get_env_var (11-21)
integration-tests/tests/fixtures/package_instance_fixtures.py (3)
integration-tests/tests/utils/config.py (2)
  • PackageConfig (66-128)
  • PackageInstance (132-181)
integration-tests/tests/utils/package_utils.py (2)
  • start_clp_package (147-161)
  • stop_clp_package (164-177)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (51-70)
integration-tests/tests/utils/package_utils.py (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (51-70)
components/clp-py-utils/clp_py_utils/clp_config.py (4)
  • CLPConfig (613-853)
  • Package (136-160)
  • QueryEngine (112-115)
  • StorageEngine (96-98)
integration-tests/tests/utils/config.py (4)
  • PackageConfig (66-128)
  • PackageInstance (132-181)
  • start_script_path (121-123)
  • stop_script_path (126-128)
integration-tests/tests/utils/docker_utils.py (2)
  • inspect_container_state (48-73)
  • list_prefixed_containers (17-45)
integration-tests/tests/utils/config.py (2)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (51-70)
integration-tests/tests/utils/utils.py (3)
  • unlink (54-75)
  • validate_dir_exists (78-85)
  • validate_file_exists (88-95)
integration-tests/tests/test_package_start.py (3)
integration-tests/tests/utils/config.py (1)
  • PackageInstance (132-181)
integration-tests/tests/utils/package_utils.py (2)
  • is_package_running (180-213)
  • is_running_mode_correct (216-231)
integration-tests/tests/fixtures/package_instance_fixtures.py (1)
  • clp_package (21-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: package-image
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (9)
integration-tests/pyproject.toml (1)

77-78: LGTM!

The local path configuration for clp-py-utils enables integration tests to import from the adjacent component package during development.

integration-tests/tests/fixtures/package_config_fixtures.py (1)

50-70: LGTM!

The fixture correctly creates a temporary config, yields it for tests, and cleans up the temp file on teardown.

integration-tests/tests/utils/config.py (3)

88-118: LGTM with note on frozen dataclass pattern.

The __post_init__ correctly validates package structure, initializes cache directories, and sets temp_config_file_path as a placeholder (with the actual file written by the fixture). Using object.__setattr__ for frozen dataclasses is acceptable here since initialization happens in __post_init__.


147-163: LGTM!

The __post_init__ correctly validates that the log directory and required files exist, and retrieves the instance ID with proper error handling.


165-181: LGTM!

The instance ID validation with regex [0-9a-fA-F]{4} correctly enforces the 4-hex-digit format, with clear error messages for file read failures and invalid formats.

integration-tests/tests/utils/package_utils.py (4)

38-54: LGTM!

Reusing component names from clp_py_utils.clp_config and transforming them to container basenames avoids duplication and ensures consistency.


56-69: LGTM!

The mode configurations correctly map clp-text and clp-json to their respective storage and query engine pairs, enabling parameterized testing across modes.


180-213: LGTM!

The function correctly validates all components are running by checking Docker containers, accumulating issues, and returning a descriptive failure message when problems are found.


216-236: LGTM!

The mode verification correctly reads the shared config written by the package, validates it as a CLPConfig, and compares the derived mode with the intended mode.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)

37-44: Redundant path assignment already handled by PackageConfig.__post_init__.

Line 44 uses object.__setattr__ to assign temp_config_file_path, but PackageConfig.__post_init__ (lines 119-123 in config.py) already sets this field to temp_config_dir / f"clp-config-{mode_name}.yml". Since write_temp_config_file writes to that exact path and returns it, Line 44 is redundant and bypasses frozen immutability unnecessarily.

Apply this diff to remove the redundant assignment:

     mode_name: str = request.param
     logger.info("Creating a temporary config file for the %s package...", mode_name)

     package_config = _build_package_config_for_mode(mode_name)
-    clp_config_obj = get_clp_config_from_mode(mode_name)
-    temp_config_file_path: Path = write_temp_config_file(
+    write_temp_config_file(
         clp_config=clp_config_obj,
         temp_config_dir=package_config.temp_config_dir,
         mode_name=mode_name,
     )
-    object.__setattr__(package_config, "temp_config_file_path", temp_config_file_path)

     return package_config

Wait, I need to check the actual code more carefully. Let me re-read:

Lines 20-46 show _build_package_config_for_mode. Lines 37-44 show:

    # Write the temporary config file that the package will use.
    clp_config_obj = get_clp_config_from_mode(mode_name)
    temp_config_file_path: Path = write_temp_config_file(
        clp_config=clp_config_obj,
        temp_config_dir=package_config.temp_config_dir,
        mode_name=mode_name,
    )
    object.__setattr__(package_config, "temp_config_file_path", temp_config_file_path)

So the issue is that line 44 overwrites what post_init already set. Let me fix my diff:

     # Write the temporary config file that the package will use.
     clp_config_obj = get_clp_config_from_mode(mode_name)
-    temp_config_file_path: Path = write_temp_config_file(
+    write_temp_config_file(
         clp_config=clp_config_obj,
         temp_config_dir=package_config.temp_config_dir,
         mode_name=mode_name,
     )
-    object.__setattr__(package_config, "temp_config_file_path", temp_config_file_path)
 
     return package_config
integration-tests/tests/fixtures/package_instance_fixtures.py (1)

32-50: Potential NameError if PackageInstance construction fails.

If Line 35 raises an exception, the finally block at Line 45 will attempt to reference instance, which is undefined, causing a NameError that masks the original exception.

Apply this diff to initialize instance before the try block:

     start_clp_package(clp_config)
+    instance = None
 
     try:
         instance = PackageInstance(package_config=clp_config)
         instance_id = instance.clp_instance_id
         logger.info(
             "An instance of the %s package was started successfully. Its instance ID is '%s'",
             mode_name,
             instance_id,
         )
         yield instance
     finally:
         logger.info("Now stopping the %s package...", mode_name)
         if instance is not None:
             stop_clp_package(instance)
         else:
             # This means setup failed after start; fall back to calling stop script directly
             subprocess.run([str(clp_config.stop_script_path)], check=True)
         logger.info("The %s package was stopped successfully.", mode_name)
integration-tests/tests/utils/package_utils.py (2)

124-138: Consider capturing subprocess output for debugging.

The function runs the start script but doesn't capture stdout/stderr. If startup fails, diagnostic output from the script will be lost, making debugging more difficult.

Apply this diff to capture and include output in the error message:

 def start_clp_package(package_config: PackageConfig) -> None:
     """Start an instance of the CLP package."""
     start_script_path = package_config.start_script_path
     try:
         # fmt: off
         start_cmd = [
             str(start_script_path),
             "--config",
             str(package_config.temp_config_file_path)
         ]
         # fmt: on
-        subprocess.run(start_cmd, check=True)
-    except Exception as e:
-        err_msg = f"Failed to start an instance of the {package_config.mode_name} package."
+        subprocess.run(start_cmd, check=True, capture_output=True, text=True)
+    except subprocess.CalledProcessError as e:
+        err_msg = (
+            f"Failed to start an instance of the {package_config.mode_name} package.\n"
+            f"stdout: {e.stdout}\nstderr: {e.stderr}"
+        )
+        raise RuntimeError(err_msg) from e
+    except Exception as e:
+        err_msg = f"Failed to start an instance of the {package_config.mode_name} package."
         raise RuntimeError(err_msg) from e

141-154: Consider capturing subprocess output and ensure path type consistency.

Similar to start_clp_package, this function doesn't capture output, making debugging failed stops more difficult. Additionally, Line 148 passes stop_script_path directly, but for consistency with start_clp_package, it should be converted to a string.

Apply this diff:

 def stop_clp_package(instance: PackageInstance) -> None:
     """Stop an instance of the CLP package."""
     package_config = instance.package_config
     stop_script_path = package_config.stop_script_path
     try:
         # fmt: off
         stop_cmd = [
-            stop_script_path
+            str(stop_script_path)
         ]
         # fmt: on
-        subprocess.run(stop_cmd, check=True)
-    except Exception as e:
-        err_msg = f"Failed to stop an instance of the {package_config.mode_name} package."
+        subprocess.run(stop_cmd, check=True, capture_output=True, text=True)
+    except subprocess.CalledProcessError as e:
+        err_msg = (
+            f"Failed to stop an instance of the {package_config.mode_name} package.\n"
+            f"stdout: {e.stdout}\nstderr: {e.stderr}"
+        )
+        raise RuntimeError(err_msg) from e
+    except Exception as e:
+        err_msg = f"Failed to stop an instance of the {package_config.mode_name} package."
         raise RuntimeError(err_msg) from e
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ff9465 and cdcfaee.

📒 Files selected for processing (4)
  • integration-tests/tests/fixtures/package_config_fixtures.py (1 hunks)
  • integration-tests/tests/fixtures/package_instance_fixtures.py (1 hunks)
  • integration-tests/tests/utils/config.py (3 hunks)
  • integration-tests/tests/utils/package_utils.py (1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1122
File: components/core/src/clp/clp/CMakeLists.txt:175-195
Timestamp: 2025-07-23T09:54:45.185Z
Learning: In the CLP project, when reviewing CMakeLists.txt changes that introduce new compression library dependencies (BZip2, LibLZMA, LZ4, ZLIB), the team prefers to address conditional linking improvements in separate PRs rather than expanding the scope of focused migration PRs like the LibArchive task-based installation migration.
📚 Learning: 2025-08-16T10:24:29.316Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.

Applied to files:

  • integration-tests/tests/utils/config.py
  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/fixtures/package_instance_fixtures.py
  • integration-tests/tests/fixtures/package_config_fixtures.py
📚 Learning: 2025-08-17T16:10:38.722Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.

Applied to files:

  • integration-tests/tests/utils/config.py
  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/fixtures/package_instance_fixtures.py
  • integration-tests/tests/fixtures/package_config_fixtures.py
📚 Learning: 2025-07-28T08:33:57.487Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.

Applied to files:

  • integration-tests/tests/utils/config.py
  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-08-09T04:07:27.083Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-20T22:07:04.953Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/utils/config.py:121-123
Timestamp: 2025-08-20T22:07:04.953Z
Learning: For the CLP integration tests codebase, do not suggest deriving tarball filenames from URLs instead of hard-coding ".tar.gz" extension. The user has explicitly rejected this suggestion.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • integration-tests/tests/utils/config.py
  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-05-06T10:07:04.654Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/macos/install-all.sh:11-12
Timestamp: 2025-05-06T10:07:04.654Z
Learning: In CLP installation scripts, temporary directories with downloaded files should not be automatically cleaned up on failure (e.g., with EXIT traps) to preserve artifacts for debugging purposes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-07T17:41:15.655Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:27-32
Timestamp: 2025-07-07T17:41:15.655Z
Learning: In CLP installation scripts, consistency across platform scripts is prioritized over defensive programming improvements. For example, when extracting Task binaries with tar in `install-prebuilt-packages.sh`, the extraction pattern should remain consistent with other platform scripts rather than adding defensive flags like `--strip-components=1` to handle potential tarball layout changes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-02T15:23:42.507Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:59-62
Timestamp: 2025-09-02T15:23:42.507Z
Learning: In the CoreConfig class (integration-tests/tests/utils/config.py), clp_binary_path and clp_s_binary_path are decorated with property, so they should be accessed as attributes (without parentheses) rather than method calls.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-03T13:33:27.460Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-07-03T13:33:27.460Z
Learning: In the CLP codebase, `from __future__ import annotations` imports are used to enable Python pipe notation for union types (e.g., `int | str`) in Python versions before 3.10, and should not be considered unused imports.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2024-11-18T16:49:20.248Z
Learnt from: haiqi96
Repo: y-scope/clp PR: 594
File: components/clp-package-utils/clp_package_utils/scripts/del_archives.py:56-65
Timestamp: 2024-11-18T16:49:20.248Z
Learning: When reviewing wrapper scripts in `components/clp-package-utils/clp_package_utils/scripts/`, note that it's preferred to keep error handling simple without adding extra complexity.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
🧬 Code graph analysis (4)
integration-tests/tests/utils/config.py (3)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (50-69)
components/clp-py-utils/clp_py_utils/clp_config.py (1)
  • CLPConfig (613-853)
integration-tests/tests/utils/utils.py (3)
  • unlink (54-75)
  • validate_dir_exists (78-85)
  • validate_file_exists (88-95)
integration-tests/tests/utils/package_utils.py (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (50-69)
components/clp-py-utils/clp_py_utils/clp_config.py (4)
  • CLPConfig (613-853)
  • Package (136-160)
  • QueryEngine (112-115)
  • StorageEngine (96-98)
integration-tests/tests/utils/config.py (4)
  • PackageConfig (71-133)
  • PackageInstance (137-190)
  • start_script_path (126-128)
  • stop_script_path (131-133)
integration-tests/tests/utils/docker_utils.py (2)
  • inspect_container_state (48-73)
  • list_prefixed_containers (17-45)
integration-tests/tests/fixtures/package_instance_fixtures.py (3)
integration-tests/tests/utils/config.py (3)
  • PackageConfig (71-133)
  • PackageInstance (137-190)
  • stop_script_path (131-133)
integration-tests/tests/utils/package_utils.py (2)
  • start_clp_package (124-138)
  • stop_clp_package (141-154)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (50-69)
integration-tests/tests/fixtures/package_config_fixtures.py (3)
integration-tests/tests/utils/config.py (1)
  • PackageConfig (71-133)
integration-tests/tests/utils/package_utils.py (2)
  • get_clp_config_from_mode (73-80)
  • write_temp_config_file (101-121)
integration-tests/tests/utils/utils.py (1)
  • get_env_var (11-21)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: package-image
  • GitHub Check: lint-check (macos-15)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (3)
integration-tests/tests/fixtures/package_config_fixtures.py (1)

38-46: Remove redundant frozen dataclass mutation.

PackageConfig.__post_init__ (lines 122-126 in config.py) already sets temp_config_file_path to temp_config_dir / f"clp-config-{mode_name}.yml". Since write_temp_config_file returns the identical path (line 128 in package_utils.py), Line 45's object.__setattr__ overwrites the field with the same value—this is redundant.

Apply this diff to eliminate the unnecessary mutation:

     # Write the temporary config file that the package will use.
     clp_config_obj = build_config()
-    temp_config_file_path: Path = write_temp_config_file(
+    write_temp_config_file(
         clp_config=clp_config_obj,
         temp_config_dir=package_config.temp_config_dir,
         mode_name=mode_name,
     )
-    object.__setattr__(package_config, "temp_config_file_path", temp_config_file_path)
 
     return package_config
integration-tests/tests/utils/package_utils.py (2)

117-137: Fix typo in docstring.

Line 123: "CLPCongig" should be "CLPConfig".

Apply this diff:

     """
-    Writes a temporary config file to `temp_config_dir` for a CLPCongig object. Returns the path to
+    Writes a temporary config file to `temp_config_dir` for a CLPConfig object. Returns the path to
     the temporary file on success.
     """

140-170: Capture subprocess output for debugging.

Both start_clp_package (lines 140-154) and stop_clp_package (lines 157-170) run scripts without capturing output. When these operations fail, diagnostic messages from the scripts are lost.

Apply this diff to capture and include output in error messages:

 def start_clp_package(package_config: PackageConfig) -> None:
     """Start an instance of the CLP package."""
     start_script_path = package_config.start_script_path
     try:
         # fmt: off
         start_cmd = [
             str(start_script_path),
             "--config",
             str(package_config.temp_config_file_path)
         ]
         # fmt: on
-        subprocess.run(start_cmd, check=True)
+        subprocess.run(start_cmd, check=True, capture_output=True, text=True)
-    except Exception as e:
-        err_msg = f"Failed to start an instance of the {package_config.mode_name} package."
+    except subprocess.CalledProcessError as e:
+        err_out = (e.stderr or e.stdout or "").strip()
+        err_msg = f"Failed to start an instance of the {package_config.mode_name} package. Output: {err_out}"
         raise RuntimeError(err_msg) from e

 def stop_clp_package(instance: PackageInstance) -> None:
     """Stop an instance of the CLP package."""
     package_config = instance.package_config
     stop_script_path = package_config.stop_script_path
     try:
         # fmt: off
         stop_cmd = [
             stop_script_path
         ]
         # fmt: on
-        subprocess.run(stop_cmd, check=True)
+        subprocess.run(stop_cmd, check=True, capture_output=True, text=True)
-    except Exception as e:
-        err_msg = f"Failed to stop an instance of the {package_config.mode_name} package."
+    except subprocess.CalledProcessError as e:
+        err_out = (e.stderr or e.stdout or "").strip()
+        err_msg = f"Failed to stop an instance of the {package_config.mode_name} package. Output: {err_out}"
         raise RuntimeError(err_msg) from e
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cdcfaee and 53e7343.

📒 Files selected for processing (3)
  • integration-tests/tests/fixtures/package_config_fixtures.py (1 hunks)
  • integration-tests/tests/utils/config.py (3 hunks)
  • integration-tests/tests/utils/package_utils.py (1 hunks)
🧰 Additional context used
🧠 Learnings (12)
📓 Common learnings
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1122
File: components/core/src/clp/clp/CMakeLists.txt:175-195
Timestamp: 2025-07-23T09:54:45.185Z
Learning: In the CLP project, when reviewing CMakeLists.txt changes that introduce new compression library dependencies (BZip2, LibLZMA, LZ4, ZLIB), the team prefers to address conditional linking improvements in separate PRs rather than expanding the scope of focused migration PRs like the LibArchive task-based installation migration.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1405
File: components/clp-package-utils/pyproject.toml:5-15
Timestamp: 2025-10-13T03:24:35.074Z
Learning: In the y-scope/clp repository, the Python 3.9 to 3.10 version requirement change was intentionally deferred to a separate PR (after PR #1405) to reduce review effort, as decided in an offline discussion between junhaoliao and kirkrodrigues.
📚 Learning: 2025-08-17T16:10:38.722Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.

Applied to files:

  • integration-tests/tests/fixtures/package_config_fixtures.py
  • integration-tests/tests/utils/config.py
  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-08-16T10:24:29.316Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.

Applied to files:

  • integration-tests/tests/fixtures/package_config_fixtures.py
  • integration-tests/tests/utils/config.py
  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-07-28T08:33:57.487Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.

Applied to files:

  • integration-tests/tests/utils/config.py
  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-08-09T04:07:27.083Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-20T22:07:04.953Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/utils/config.py:121-123
Timestamp: 2025-08-20T22:07:04.953Z
Learning: For the CLP integration tests codebase, do not suggest deriving tarball filenames from URLs instead of hard-coding ".tar.gz" extension. The user has explicitly rejected this suggestion.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • integration-tests/tests/utils/config.py
  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-05-06T10:07:04.654Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/macos/install-all.sh:11-12
Timestamp: 2025-05-06T10:07:04.654Z
Learning: In CLP installation scripts, temporary directories with downloaded files should not be automatically cleaned up on failure (e.g., with EXIT traps) to preserve artifacts for debugging purposes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-07T17:41:15.655Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:27-32
Timestamp: 2025-07-07T17:41:15.655Z
Learning: In CLP installation scripts, consistency across platform scripts is prioritized over defensive programming improvements. For example, when extracting Task binaries with tar in `install-prebuilt-packages.sh`, the extraction pattern should remain consistent with other platform scripts rather than adding defensive flags like `--strip-components=1` to handle potential tarball layout changes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-02T15:23:42.507Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:59-62
Timestamp: 2025-09-02T15:23:42.507Z
Learning: In the CoreConfig class (integration-tests/tests/utils/config.py), clp_binary_path and clp_s_binary_path are decorated with property, so they should be accessed as attributes (without parentheses) rather than method calls.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-03T13:33:27.460Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-07-03T13:33:27.460Z
Learning: In the CLP codebase, `from __future__ import annotations` imports are used to enable Python pipe notation for union types (e.g., `int | str`) in Python versions before 3.10, and should not be considered unused imports.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2024-11-18T16:49:20.248Z
Learnt from: haiqi96
Repo: y-scope/clp PR: 594
File: components/clp-package-utils/clp_package_utils/scripts/del_archives.py:56-65
Timestamp: 2024-11-18T16:49:20.248Z
Learning: When reviewing wrapper scripts in `components/clp-package-utils/clp_package_utils/scripts/`, note that it's preferred to keep error handling simple without adding extra complexity.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
🧬 Code graph analysis (3)
integration-tests/tests/fixtures/package_config_fixtures.py (3)
integration-tests/tests/utils/config.py (1)
  • PackageConfig (71-136)
integration-tests/tests/utils/package_utils.py (1)
  • write_temp_config_file (117-137)
integration-tests/tests/utils/utils.py (1)
  • get_env_var (11-21)
integration-tests/tests/utils/config.py (3)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (51-70)
components/clp-py-utils/clp_py_utils/clp_config.py (1)
  • CLPConfig (613-853)
integration-tests/tests/utils/utils.py (3)
  • unlink (54-75)
  • validate_dir_exists (78-85)
  • validate_file_exists (88-95)
integration-tests/tests/utils/package_utils.py (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (51-70)
components/clp-py-utils/clp_py_utils/clp_config.py (4)
  • CLPConfig (613-853)
  • Package (136-160)
  • QueryEngine (112-115)
  • StorageEngine (96-98)
integration-tests/tests/utils/config.py (4)
  • PackageConfig (71-136)
  • PackageInstance (140-193)
  • start_script_path (129-131)
  • stop_script_path (134-136)
integration-tests/tests/utils/docker_utils.py (2)
  • inspect_container_state (48-73)
  • list_prefixed_containers (17-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: package-image
  • GitHub Check: lint-check (macos-15)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53e7343 and 796ffe3.

📒 Files selected for processing (1)
  • integration-tests/tests/utils/package_utils.py (1 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1122
File: components/core/src/clp/clp/CMakeLists.txt:175-195
Timestamp: 2025-07-23T09:54:45.185Z
Learning: In the CLP project, when reviewing CMakeLists.txt changes that introduce new compression library dependencies (BZip2, LibLZMA, LZ4, ZLIB), the team prefers to address conditional linking improvements in separate PRs rather than expanding the scope of focused migration PRs like the LibArchive task-based installation migration.
📚 Learning: 2025-08-16T10:24:29.316Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-08-17T16:10:38.722Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-07-28T08:33:57.487Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2024-11-18T16:49:20.248Z
Learnt from: haiqi96
Repo: y-scope/clp PR: 594
File: components/clp-package-utils/clp_package_utils/scripts/del_archives.py:56-65
Timestamp: 2024-11-18T16:49:20.248Z
Learning: When reviewing wrapper scripts in `components/clp-package-utils/clp_package_utils/scripts/`, note that it's preferred to keep error handling simple without adding extra complexity.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-10-27T07:07:37.901Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1501
File: tools/deployment/presto-clp/scripts/init.py:10-13
Timestamp: 2025-10-27T07:07:37.901Z
Learning: In `tools/deployment/presto-clp/scripts/init.py`, the `DATABASE_COMPONENT_NAME` and `DATABASE_DEFAULT_PORT` constants are intentionally duplicated from `clp_py_utils.clp_config` because `clp_py_utils` is not installed in the Presto init script's runtime environment. The two flows are separate and this duplication is documented. There are plans to merge these flows after a future release.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-07-01T14:51:19.172Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-packages-from-source.sh:6-8
Timestamp: 2025-07-01T14:51:19.172Z
Learning: In CLP installation scripts within `components/core/tools/scripts/lib_install/`, maintain consistency with existing variable declaration patterns across platforms rather than adding individual improvements like `readonly` declarations.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-10-13T03:32:19.293Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1414
File: tools/docker-images/clp-package/Dockerfile:20-24
Timestamp: 2025-10-13T03:32:19.293Z
Learning: In the clp repository's Dockerfiles (e.g., tools/docker-images/clp-package/Dockerfile), ENV directives should be split into separate lines for readability rather than consolidated to reduce layer count. This is especially true for PATH modifications, as agreed upon in PR #1166. Later ENV settings may depend on earlier ones (e.g., referencing CLP_HOME).

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-07-07T17:41:15.655Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:27-32
Timestamp: 2025-07-07T17:41:15.655Z
Learning: In CLP installation scripts, consistency across platform scripts is prioritized over defensive programming improvements. For example, when extracting Task binaries with tar in `install-prebuilt-packages.sh`, the extraction pattern should remain consistent with other platform scripts rather than adding defensive flags like `--strip-components=1` to handle potential tarball layout changes.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
🧬 Code graph analysis (1)
integration-tests/tests/utils/package_utils.py (4)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (51-70)
components/clp-py-utils/clp_py_utils/clp_config.py (5)
  • CLPConfig (613-853)
  • Package (136-160)
  • QueryEngine (112-115)
  • StorageEngine (96-98)
  • get_deployment_type (804-808)
integration-tests/tests/utils/config.py (4)
  • PackageConfig (71-136)
  • PackageInstance (140-193)
  • start_script_path (129-131)
  • stop_script_path (134-136)
integration-tests/tests/utils/docker_utils.py (2)
  • inspect_container_state (48-73)
  • list_prefixed_containers (17-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: package-image
  • GitHub Check: lint-check (ubuntu-24.04)
  • GitHub Check: lint-check (macos-15)
  • GitHub Check: build (macos-15)
🔇 Additional comments (5)
integration-tests/tests/utils/package_utils.py (5)

89-96: LGTM!

The function correctly retrieves the configuration factory from CLP_MODE_CONFIGS and provides clear error messaging for unsupported modes.


99-114: LGTM!

The function demonstrates robust error handling for YAML parsing and file I/O, with clear error messages and appropriate type validation.


117-137: LGTM!

The function uses an atomic write pattern (writing to a temporary file then renaming), which is excellent practice for preventing partial writes or corruption.


173-207: LGTM!

The function thoroughly validates that all required component containers exist and are running, providing detailed diagnostic information when issues are found.


225-248: LGTM with dependency on signature fix.

The function correctly loads and validates the running configuration against the intended configuration. Ensure the _compute_mode_signature function is fixed (as noted in the previous comment) so that the signature comparison captures all mode-defining properties.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9865a8 and 865e9ed.

📒 Files selected for processing (4)
  • integration-tests/pyproject.toml (3 hunks)
  • integration-tests/tests/fixtures/package_config_fixtures.py (1 hunks)
  • integration-tests/tests/utils/config.py (3 hunks)
  • integration-tests/tests/utils/package_utils.py (1 hunks)
🧰 Additional context used
🧠 Learnings (22)
📓 Common learnings
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1122
File: components/core/src/clp/clp/CMakeLists.txt:175-195
Timestamp: 2025-07-23T09:54:45.185Z
Learning: In the CLP project, when reviewing CMakeLists.txt changes that introduce new compression library dependencies (BZip2, LibLZMA, LZ4, ZLIB), the team prefers to address conditional linking improvements in separate PRs rather than expanding the scope of focused migration PRs like the LibArchive task-based installation migration.
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1405
File: components/clp-package-utils/pyproject.toml:5-15
Timestamp: 2025-10-13T03:24:35.074Z
Learning: In the y-scope/clp repository, the Python 3.9 to 3.10 version requirement change was intentionally deferred to a separate PR (after PR #1405) to reduce review effort, as decided in an offline discussion between junhaoliao and kirkrodrigues.
📚 Learning: 2025-08-17T16:10:38.722Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/fixtures/integration_test_logs.py:54-56
Timestamp: 2025-08-17T16:10:38.722Z
Learning: For PR #1100 (feat(integration-tests): Add CLP package integration tests boilerplate), do not raise cache weakness problems related to the pytest cache implementation in the integration test logs fixtures.

Applied to files:

  • integration-tests/tests/fixtures/package_config_fixtures.py
  • integration-tests/tests/utils/package_utils.py
  • integration-tests/pyproject.toml
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-16T10:24:29.316Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/pyproject.toml:11-13
Timestamp: 2025-08-16T10:24:29.316Z
Learning: In the CLP project's integration-tests directory, the integration tests package is not intended to be shipped or distributed - only the tests are leveraged for local testing purposes, so console script entry points should not be included in pyproject.toml.

Applied to files:

  • integration-tests/tests/fixtures/package_config_fixtures.py
  • integration-tests/tests/utils/package_utils.py
  • integration-tests/pyproject.toml
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-28T08:33:57.487Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:133-137
Timestamp: 2025-07-28T08:33:57.487Z
Learning: In CLP integration tests, the `run_and_assert` utility function should only be used for commands that test CLP package functionality (like clp/clp-s compression/decompression operations). For processing or helper commands (like jq, sort, etc.), direct `subprocess.run` calls should be used instead, as they serve different purposes and don't need the same error handling patterns.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-20T08:36:38.391Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/__init__.py:1-1
Timestamp: 2025-08-20T08:36:38.391Z
Learning: In the CLP project, __init__.py files should include short module-level docstrings describing the package purpose, as required by their ruff linting configuration, rather than being left empty.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
  • integration-tests/pyproject.toml
📚 Learning: 2024-11-18T16:49:20.248Z
Learnt from: haiqi96
Repo: y-scope/clp PR: 594
File: components/clp-package-utils/clp_package_utils/scripts/del_archives.py:56-65
Timestamp: 2024-11-18T16:49:20.248Z
Learning: When reviewing wrapper scripts in `components/clp-package-utils/clp_package_utils/scripts/`, note that it's preferred to keep error handling simple without adding extra complexity.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-05-06T09:48:55.408Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/ubuntu-jammy/install-prebuilt-packages.sh:35-41
Timestamp: 2025-05-06T09:48:55.408Z
Learning: For installation scripts in the CLP project, prefer explicit error handling over automatic dependency resolution (like `apt-get install -f`) when installing packages to give users more control over their system.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-10-27T07:07:37.901Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1501
File: tools/deployment/presto-clp/scripts/init.py:10-13
Timestamp: 2025-10-27T07:07:37.901Z
Learning: In `tools/deployment/presto-clp/scripts/init.py`, the `DATABASE_COMPONENT_NAME` and `DATABASE_DEFAULT_PORT` constants are intentionally duplicated from `clp_py_utils.clp_config` because `clp_py_utils` is not installed in the Presto init script's runtime environment. The two flows are separate and this duplication is documented. There are plans to merge these flows after a future release.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-07-01T14:51:19.172Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-packages-from-source.sh:6-8
Timestamp: 2025-07-01T14:51:19.172Z
Learning: In CLP installation scripts within `components/core/tools/scripts/lib_install/`, maintain consistency with existing variable declaration patterns across platforms rather than adding individual improvements like `readonly` declarations.

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-10-13T03:32:19.293Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1414
File: tools/docker-images/clp-package/Dockerfile:20-24
Timestamp: 2025-10-13T03:32:19.293Z
Learning: In the clp repository's Dockerfiles (e.g., tools/docker-images/clp-package/Dockerfile), ENV directives should be split into separate lines for readability rather than consolidated to reduce layer count. This is especially true for PATH modifications, as agreed upon in PR #1166. Later ENV settings may depend on earlier ones (e.g., referencing CLP_HOME).

Applied to files:

  • integration-tests/tests/utils/package_utils.py
📚 Learning: 2025-10-22T21:02:31.113Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-10-22T21:02:31.113Z
Learning: Repository y-scope/clp: Maintain deterministic CI/builds for Rust; add a check to verify Cargo.lock is in sync with Cargo.toml without updating dependencies (non-mutating verification in clp-rust-checks workflow).

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-09-26T21:12:21.655Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1338
File: components/clp-py-utils/clp_py_utils/clp_config.py:753-753
Timestamp: 2025-09-26T21:12:21.655Z
Learning: Python linting rules that catch YODA conditions exist but are not enabled for Python modules in the CLP package due to time constraints. The team prefers to avoid YODA conditions in Python for consistency.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-07-03T13:33:27.460Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 0
File: :0-0
Timestamp: 2025-07-03T13:33:27.460Z
Learning: In the CLP codebase, `from __future__ import annotations` imports are used to enable Python pipe notation for union types (e.g., `int | str`) in Python versions before 3.10, and should not be considered unused imports.

Applied to files:

  • integration-tests/pyproject.toml
  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-02T13:35:33.396Z
Learnt from: anlowee
Repo: y-scope/clp PR: 1228
File: tools/deployment/presto-clp/scripts/init.py:298-306
Timestamp: 2025-09-02T13:35:33.396Z
Learning: In the CLP codebase, all configuration values loaded from YAML files are string values, so functions that retrieve config values should use Optional[str] rather than Optional[Any] for type hints.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-08-24T17:10:44.565Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: taskfiles/lint.yaml:780-781
Timestamp: 2025-08-24T17:10:44.565Z
Learning: The CLP repository is gradually migrating from Black to Ruff for Python formatting. Some modules haven't been set up for Ruff yet, so there's intentional mixed usage of Black and Ruff formatters during this transition period. This should not be flagged as an inconsistency in PR reviews.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-10-27T04:05:01.560Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1507
File: taskfiles/deps/lock.yaml:66-76
Timestamp: 2025-10-27T04:05:01.560Z
Learning: In the CLP project, the `uv` CLI tool is documented as a prerequisite in docs/src/dev-docs/building-package.md and is not installed via a task dependency like the rust toolchain. UV is expected to be available in the environment rather than being provisioned by the taskfile system.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-08-29T07:31:24.032Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1271
File: components/core/tools/scripts/lib_install/centos-stream-9/install-prebuilt-packages.sh:41-43
Timestamp: 2025-08-29T07:31:24.032Z
Learning: In CLP's build tool installation scripts, uv version constraints should use lower bound constraints (uv>=0.8) rather than exact version pinning, following the same philosophy used for other build tools to accommodate platform differences while ensuring minimum required functionality.

Applied to files:

  • integration-tests/pyproject.toml
📚 Learning: 2025-08-09T04:07:27.083Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1156
File: components/core/CMakeLists.txt:772-772
Timestamp: 2025-08-09T04:07:27.083Z
Learning: In the CLP project's CMakeLists.txt, when reviewing changes related to the ${zstd_TARGET} variable usage in test linking, the team is planning a refactoring PR to improve this mechanism. Guards for undefined target variables should be deferred to that separate PR rather than being added in focused dependency migration PRs.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-08-20T22:07:04.953Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/utils/config.py:121-123
Timestamp: 2025-08-20T22:07:04.953Z
Learning: For the CLP integration tests codebase, do not suggest deriving tarball filenames from URLs instead of hard-coding ".tar.gz" extension. The user has explicitly rejected this suggestion.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-05-06T10:07:04.654Z
Learnt from: kirkrodrigues
Repo: y-scope/clp PR: 881
File: components/core/tools/scripts/lib_install/macos/install-all.sh:11-12
Timestamp: 2025-05-06T10:07:04.654Z
Learning: In CLP installation scripts, temporary directories with downloaded files should not be automatically cleaned up on failure (e.g., with EXIT traps) to preserve artifacts for debugging purposes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-07-07T17:41:15.655Z
Learnt from: jackluo923
Repo: y-scope/clp PR: 1054
File: components/core/tools/scripts/lib_install/musllinux_1_2/install-prebuilt-packages.sh:27-32
Timestamp: 2025-07-07T17:41:15.655Z
Learning: In CLP installation scripts, consistency across platform scripts is prioritized over defensive programming improvements. For example, when extracting Task binaries with tar in `install-prebuilt-packages.sh`, the extraction pattern should remain consistent with other platform scripts rather than adding defensive flags like `--strip-components=1` to handle potential tarball layout changes.

Applied to files:

  • integration-tests/tests/utils/config.py
📚 Learning: 2025-09-02T15:23:42.507Z
Learnt from: Bill-hbrhbr
Repo: y-scope/clp PR: 1100
File: integration-tests/tests/test_identity_transformation.py:59-62
Timestamp: 2025-09-02T15:23:42.507Z
Learning: In the CoreConfig class (integration-tests/tests/utils/config.py), clp_binary_path and clp_s_binary_path are decorated with property, so they should be accessed as attributes (without parentheses) rather than method calls.

Applied to files:

  • integration-tests/tests/utils/config.py
🧬 Code graph analysis (3)
integration-tests/tests/fixtures/package_config_fixtures.py (2)
integration-tests/tests/utils/config.py (1)
  • PackageConfig (73-153)
integration-tests/tests/utils/utils.py (2)
  • get_env_var (13-23)
  • unlink (81-102)
integration-tests/tests/utils/package_utils.py (5)
components/clp-py-utils/clp_py_utils/clp_config.py (1)
  • CLPConfig (613-853)
integration-tests/tests/utils/clp_mode_utils.py (2)
  • compute_mode_signature (75-87)
  • get_clp_config_from_mode (90-97)
integration-tests/tests/utils/config.py (2)
  • PackageConfig (73-153)
  • PackageInstance (157-210)
integration-tests/tests/utils/docker_utils.py (2)
  • inspect_container_state (48-73)
  • list_prefixed_containers (17-45)
integration-tests/tests/utils/utils.py (1)
  • load_yaml_to_dict (56-78)
integration-tests/tests/utils/config.py (3)
integration-tests/tests/fixtures/package_config_fixtures.py (1)
  • clp_config (37-56)
components/clp-py-utils/clp_py_utils/clp_config.py (1)
  • CLPConfig (613-853)
integration-tests/tests/utils/utils.py (3)
  • unlink (81-102)
  • validate_dir_exists (105-112)
  • validate_file_exists (115-122)
🔇 Additional comments (3)
integration-tests/pyproject.toml (3)

38-40: Good: Per-module mypy overrides properly implemented.

The use of [[tool.mypy.overrides]] with module pattern clp_py_utils.* correctly addresses the prior feedback to avoid a global ignore_missing_imports = true setting. This preserves strict type checking for local test code while selectively disabling it only for the untyped external module—a best practice that balances safety with pragmatism.


80-81: Path verification confirms correct resolution.

The uv source mapping in integration-tests/pyproject.toml correctly resolves to components/clp-py-utils. The relative path ../components/clp-py-utils successfully points to the existing package directory and requires no changes.


20-20: All dependency constraints are correctly configured.

The concerns from the original review are resolved:

  1. clp-py-utils lacks a version constraint by design—this is appropriate because it's sourced from a local path via uv sources (line 81), following the standard monorepo development pattern.
  2. PyYAML 6.0.3 (latest) is compatible with Python 3.10+, and types-PyYAML 6.0.12 is compatible with Python 3.10+. The project specifies requires-python = ">=3.10", ensuring full compatibility.
  3. The relative path ../components/clp-py-utils correctly resolves from the integration-tests directory.
  4. The mypy overrides (lines 38–40) appropriately implement selective type checking, addressing previous feedback about avoiding global ignore_missing_imports = true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants