feat(integration-tests): Validate generated package service configuration integrity.#1660
Conversation
…ig file; address comments.
…er-level clp-config.yml
…E_CONFIGS other than clp-text and clp-json
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
integration-tests/tests/utils/asserting_utils.py (1)
71-91: Implementation looks correct.The function correctly:
- Loads and validates the shared config YAML
- Retrieves the intended config from the package instance
- Compares using the new
compare_mode_signatureshelperThe design choice to propagate
load_yaml_to_dicterrors (as documented in the docstring) is valid—it allows callers to distinguish between file/YAML issues and validation issues.Consider enhancing the mismatch error message. Adding details about what differs would aid debugging, though this was raised in a previous review.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
integration-tests/tests/utils/asserting_utils.py(2 hunks)integration-tests/tests/utils/clp_mode_utils.py(5 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 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).
📚 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/asserting_utils.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/tests/utils/asserting_utils.py
📚 Learning: 2025-10-20T20:19:40.504Z
Learnt from: 20001020ycx
Repo: y-scope/clp PR: 1436
File: components/clp-mcp-server/clp_mcp_server/clp_mcp_server.py:22-27
Timestamp: 2025-10-20T20:19:40.504Z
Learning: In the clp-mcp-server project (components/clp-mcp-server/clp_mcp_server/clp_mcp_server.py), the --config Click option should use exists=True to validate the configuration file path at option processing time, even though this requires the default path to exist on all machines.
Applied to files:
integration-tests/tests/utils/asserting_utils.py
📚 Learning: 2025-11-10T05:19:56.600Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 1575
File: components/clp-py-utils/clp_py_utils/clp_config.py:602-607
Timestamp: 2025-11-10T05:19:56.600Z
Learning: In the y-scope/clp repository, the `ApiServer` class in `components/clp-py-utils/clp_py_utils/clp_config.py` does not need a `transform_for_container()` method because no other containerized service depends on the API server - it's only accessed from the host, so no docker-network communication is expected.
Applied to files:
integration-tests/tests/utils/clp_mode_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/clp_mode_utils.py
🧬 Code graph analysis (1)
integration-tests/tests/utils/asserting_utils.py (4)
components/clp-py-utils/clp_py_utils/clp_config.py (1)
ClpConfig(779-1060)integration-tests/tests/utils/clp_mode_utils.py (1)
compare_mode_signatures(98-107)integration-tests/tests/utils/config.py (1)
PackageInstance(161-214)integration-tests/tests/utils/utils.py (1)
load_yaml_to_dict(69-93)
⏰ 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). (5)
- GitHub Check: package-image
- GitHub Check: lint-check (macos-15)
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: lint-check (ubuntu-24.04)
- GitHub Check: build (macos-15)
🔇 Additional comments (5)
integration-tests/tests/utils/clp_mode_utils.py (4)
4-4: LGTM!The new imports for
AnyandBaseModelare appropriate for the recursive type comparison helper.Also applies to: 24-24
54-69: LGTM!The reorganization to include
GARBAGE_COLLECTOR_COMPONENT_NAMEinCLP_BASE_COMPONENTSmakes sense, and the maintenance note aligns with the file's purpose.
98-107: LGTM!Clean wrapper function with appropriate typing. The separation between the public API and private implementation is good.
129-130: LGTM!The updated docstring clarifies the maintenance relationship with
CLP_MODE_CONFIGS.integration-tests/tests/utils/asserting_utils.py (1)
9-15: LGTM!The imports are well-organized and all are necessary for the new
validate_running_mode_correctfunction. The duplicate import issue from past reviews has been addressed.
junhaoliao
left a comment
There was a problem hiding this comment.
the rest lgtm. @Bill-hbrhbr may want to take a look as well
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
integration-tests/tests/utils/utils.py(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 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).
⏰ 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). (5)
- GitHub Check: package-image
- GitHub Check: build (macos-15)
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: lint-check (ubuntu-24.04)
- GitHub Check: lint-check (macos-15)
🔇 Additional comments (2)
integration-tests/tests/utils/utils.py (2)
8-8: LGTM! Imports are appropriate.The addition of
Anyandyamlimports are necessary for the new YAML parsing functionality.Also applies to: 10-10
10-10: No action needed — PyYAML is already declared inintegration-tests/pyproject.tomlwith appropriate version constraints (PyYAML>=6.0.3andtypes-PyYAML>=6.0.12.20250915).
|
@quinntaylormitchell @junhaoliao or something in the lines of: |
how about |
…tion integrity. (y-scope#1660) Co-authored-by: Bingran Hu <bingran.hu@yscope.com> Co-authored-by: Junhao Liao <junhao.liao@yscope.com>
…tion integrity. (y-scope#1660) Co-authored-by: Bingran Hu <bingran.hu@yscope.com> Co-authored-by: Junhao Liao <junhao.liao@yscope.com>
…tion integrity. (y-scope#1660) Co-authored-by: Bingran Hu <bingran.hu@yscope.com> Co-authored-by: Junhao Liao <junhao.liao@yscope.com>
Description
This PR introduces the
validate_running_mode_correctfunction to read the shared config file (clp-package/var/log/.clp-config.yaml, created when the package spins up) and ensure that the package is running in the correct mode.load_yaml_to_dictloads theyamlin the shared config file into a dictionary, which is then converted to aClpConfigobject withClpConfig.model_validate. The "signature" of thisClpConfigobject is compared to the signature of theClpConfigobject stored in thePackageConfigobject for the test run withcompare_mode_signatures.PR dependencies
This PR depends on the following being merged:
PackageConfigbased on the CLP package config. #1658Checklist
breaking change.
Validation performed
Ran the following command from
clp/integration-tests:uv run pytest -m 'package'Both the
clp-jsonandclp-texttests passed.Summary by CodeRabbit
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.