Skip to content

feat: add CI workflow, linter configuration, and unit tests for ClickHouse Cloud check#1

Merged
pythonicrahul merged 2 commits into
mainfrom
Added-Linter-And-UT-with-Some-improvements
Apr 3, 2026
Merged

feat: add CI workflow, linter configuration, and unit tests for ClickHouse Cloud check#1
pythonicrahul merged 2 commits into
mainfrom
Added-Linter-And-UT-with-Some-improvements

Conversation

@pythonicrahul
Copy link
Copy Markdown
Owner

This pull request introduces CI/CD automation, configuration improvements, and enhancements to log attribution for the ClickHouse Cloud integration. The most significant changes are the addition of GitHub Actions for continuous integration, improved configuration and documentation for log collection, and the ability to customize the Datadog "service" field for logs. Several code quality and test improvements are also included.

CI/CD and Tooling:

  • Added GitHub Actions workflows for linting (using Ruff) and running tests across multiple Python versions, enabling automated CI for pushes and pull requests to main. (.github/workflows/ci.yml)
  • Introduced Dependabot configuration to automate dependency updates for Python and GitHub Actions. (.github/dependabot.yml)
  • Added development dependencies (pytest, ruff, requests) to requirements-dev.txt and introduced a Ruff configuration for consistent linting and formatting. (requirements-dev.txt, ruff.toml) [1] [2]

Configuration and Log Attribution Enhancements:

  • Added a cluster_name config option, allowing users to set the Datadog "service" field for logs (defaults to "clickhouse"), and updated log payloads to use this value. (checks/clickhouse_cloud.py, conf.d/clickhouse_cloud.d/conf.yaml.example) [1] [2] [3] [4]
  • Updated example configuration to clarify log collection settings and document the new cluster_name option. (conf.d/clickhouse_cloud.d/conf.yaml.example) [1] [2]

Code Quality and Style:

  • Modernized string formatting to use f-strings and simplified conditional logic in log payload construction. (checks/clickhouse_cloud.py) [1] [2] [3]
  • Improved import ordering and code style in both source and test files. (checks/clickhouse_cloud.py, tests/conftest.py, tests/test_logs.py) [1] [2] [3]

Testing Improvements:

  • Enhanced and expanded tests to verify the new cluster_name behavior, log payloads, and error handling. Refactored test code for clarity and conciseness. (tests/test_logs.py) [1] [2] [3] [4] [5] [6] [7] [8] [9]

These changes collectively improve the maintainability, reliability, and configurability of the integration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds CI automation and developer tooling, and updates the ClickHouse Cloud check to improve log attribution by allowing a configurable service value in emitted log payloads.

Changes:

  • Add GitHub Actions CI for Ruff linting/format checks and pytest runs across Python 3.10–3.12.
  • Introduce Ruff configuration and dev dependency set for consistent linting and test execution.
  • Add cluster_name configuration and use it as the Datadog log service field; update tests and example config accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/ci.yml Adds CI jobs for Ruff and pytest across multiple Python versions.
.github/dependabot.yml Enables scheduled dependency update PRs for pip and GitHub Actions.
requirements-dev.txt Adds dev/CI dependencies for running tests and linting locally/CI.
ruff.toml Establishes Ruff lint/format configuration for the repo.
checks/clickhouse_cloud.py Adds cluster_name config and uses it as log service; refactors formatting; updates log payload fields.
conf.d/clickhouse_cloud.d/conf.yaml.example Documents cluster_name and includes a logs configuration example.
tests/conftest.py Minor import ordering adjustments for tests.
tests/test_logs.py Updates assertions and adds coverage for cluster_name service attribution; refactors some test constructs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml Outdated
Comment thread checks/clickhouse_cloud.py
Comment thread checks/clickhouse_cloud.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@pythonicrahul pythonicrahul merged commit d430be5 into main Apr 3, 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