Skip to content

fix(clp-package): Update DB credential access in decompress.py to match recent Database model refactor (fixes #1711).#1718

Merged
Eden-D-Zhang merged 2 commits into
y-scope:mainfrom
Eden-D-Zhang:fix-decompress-user
Dec 2, 2025
Merged

fix(clp-package): Update DB credential access in decompress.py to match recent Database model refactor (fixes #1711).#1718
Eden-D-Zhang merged 2 commits into
y-scope:mainfrom
Eden-D-Zhang:fix-decompress-user

Conversation

@Eden-D-Zhang

@Eden-D-Zhang Eden-D-Zhang commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Description

This PR fixes the access of database credentials in the native decompress.py script.

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

Decompressed unstructured log files using sbin/decompress.sh x command.

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation of database connection parameters to enhance reliability during data extraction operations.

✏️ Tip: You can customize this high-level summary in your review settings.

@Eden-D-Zhang Eden-D-Zhang requested a review from a team as a code owner December 2, 2025 20:11
@coderabbitai

coderabbitai Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

A single file is modified to add validation when accessing database credentials. The credential retrieval is wrapped with Database.model_validate() to validate connection parameters before accessing the credentials property, while preserving the original credential usage and surrounding logic.

Changes

Cohort / File(s) Summary
Credential access validation
components/clp-package-utils/clp_package_utils/scripts/native/decompress.py
Updated credential retrieval to use Database.model_validate(clp_db_connection_params).credentials instead of direct access, adding a validation step for connection parameters prior to credential access.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify that Database.model_validate() properly validates the connection parameters without raising unexpected errors
  • Confirm the credentials object structure remains compatible with downstream usage in the extract_env construction
  • Ensure the validation method is the intended approach for this use case (vs. alternative validation patterns)

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.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title accurately describes the main change: updating DB credential access in decompress.py to align with a recent Database model refactor.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@junhaoliao junhaoliao self-requested a review December 2, 2025 20:12

@junhaoliao junhaoliao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for the title, how about

fix(clp-package): Update DB credential access in `decompress.py` to match recent Database model refactor (fixes #1711).

@Eden-D-Zhang Eden-D-Zhang changed the title fix(clp-package): Fix DB credential access in native decompress.py (fixes #1711). fix(clp-package): Update DB credential access in decompress.py to match recent Database model refactor (fixes #1711). Dec 2, 2025
@Eden-D-Zhang Eden-D-Zhang merged commit f2a512e into y-scope:main Dec 2, 2025
19 checks passed
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
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