Skip to content

[repo] Contribution guide#2859

Open
chernser wants to merge 1 commit into
mainfrom
05/21/26/contribution_guide
Open

[repo] Contribution guide#2859
chernser wants to merge 1 commit into
mainfrom
05/21/26/contribution_guide

Conversation

@chernser
Copy link
Copy Markdown
Contributor

Summary

Reworked contribution guide to tell more about process and expectations.
We should value every ones time and reduce review cycles so we explain how to prepare PR for best result.

@chernser chernser requested a review from mzitnik as a code owner May 21, 2026 19:31
@github-actions
Copy link
Copy Markdown

Repository collaborators can run the JMH benchmark suite against this PR by commenting:

/benchmark

Optional regression threshold override (Δ% on Time or Alloc/op; defaults to 10%):

/benchmark threshold=15

Only one benchmark run per PR is active at a time — issuing a new /benchmark comment cancels the previous run. After the run finishes a separate comment will be posted comparing it against the latest scheduled run on main; the PR check fails if any benchmark regresses by more than the threshold.

Comment thread CONTRIBUTING.md
- what tests will prove the behavior
- whether documentation, `CHANGELOG.md`, or `docs/features.md` needs to change

It is fine to use AI tools to draft an implementation proposal, explore design options, or prepare a first implementation. AI-generated code is welcome when the specification is detailed, the resulting code follows project patterns, and the tests clearly validate the expected behavior. Special attention should be paid to tests because they are the main guardrails for code changes.
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.

AI-generated code is welcome when

should we add AI_POLICY.md and link it here?

Comment thread CONTRIBUTING.md

Contributions are always welcome: issues, pull requests, questions, ideas, tests, documentation, and examples all help the project.

ClickHouse Java is maintained by a team responsible for the stability and quality of released artifacts. Because this repository publishes client libraries and drivers used by applications, every contribution needs enough context and validation for maintainers to review its safety. At minimum, a code change should include a clear description and tests that prove the intended behavior.
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.

every contribution needs enough context and validation for maintainers to review its safety

I'd suggest rephrase to something > here's what makes them easy to review, otherwise, it reads too defensively

Comment thread CONTRIBUTING.md

Contributions are always welcome: issues, pull requests, questions, ideas, tests, documentation, and examples all help the project.

ClickHouse Java is maintained by a team responsible for the stability and quality of released artifacts. Because this repository publishes client libraries and drivers used by applications, every contribution needs enough context and validation for maintainers to review its safety. At minimum, a code change should include a clear description and tests that prove the intended behavior.
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.

Because this repository publishes client libraries and drivers used by applications, every contribution needs enough context and validation for maintainers to review its safety.

I'd even strengthen it

The libraries are foundational infrastructure for the software built on top of them, thus a regression or breaking change in a client propagates to applications that depends on it, often with limited ability for users to work around the issue

Comment thread CONTRIBUTING.md

### Big Contributions

Large changes are easier to review and merge when they are split into a few smaller pull requests. From our experience, it is often better to prepare the codebase first with focused cleanup, refactoring, or test-only PRs, and then add the feature or behavior change in a later PR.
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.

The principle is right but the guidance doesn't have an easy to follow definition. Let's give contributors a concrete threshold. For example (numbers are taken from this study https://www.propelcode.ai/blog/pr-size-impact-code-review-quality-data-study):

As a rough guideline, if a pull request is over 300–400 lines of code (excluding docs and tests), consider whether it can be split. Smaller PRs are reviewed and merged faster, and the savings in review time usually outweigh the overhead of splitting

Comment thread CONTRIBUTING.md
- a link to the related issue, when one exists
- an explanation of the user-visible behavior and compatibility impact
- tests for the changed behavior, including integration tests when the change interacts with ClickHouse server behavior
- the local test commands that were run
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.

not sure we need that level of noize in every PR. I'd just set expectations: you run test before opening a PR

Comment thread CONTRIBUTING.md

Changes to CI workflows are currently restricted. Please discuss CI workflow changes with maintainers before opening a pull request.

## Pull Request Checklist
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.

I'd add a couple of things to set clearer expectations on both sides:

  • CI must be runnable on the PR. For external contributors, the initial CI run requires approval from a maintainer (as of today, probably should be revisited). Let’s explicitly mention this and commit to triggering it promptly to avoid contributors being stuck waiting. For internal PRs, the CI suite should actually run against the proposed change before the review process begins. If tests are scoped down, skipped, or disabled, the PR should clearly indicate this.

  • Reviews occur when CI is green. Clearly state that the team will review the code once CI passes. Additionally, contributors should either fix PRs with failing CI or move them to the draft. This approach is fair in both directions: contributors have a clear understanding of what means ready for review, and reviewers avoid spending cycles on changes that are not ready

Comment thread CONTRIBUTING.md
@@ -1,125 +1,194 @@
## Getting started
ClickHouse-JDBC client is an open-source project, and we welcome any contributions from the community. Please share your ideas, contribute to the codebase, and help us maintain up-to-date documentation.
# Contributing to ClickHouse Java
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.

Most of the guidance provided in the document (Testing, Contribution Process, significant contributions, and the PR checklist) is also relevant to AI coding agents. Considering the significant portion of our contributions made by agents, we should either mirror these rules into AGENTS.md or extract them into a shared file that both documents reference.
This can be done in a separate PR.

Comment thread CONTRIBUTING.md

Some good ideas need time to design and implement. We are open to discussion and welcome collaboration in issues, even when the final implementation is not ready yet.

### Big Contributions
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.

One logical change per PR: a feature, a bug fix, a refactor, or a doc update. Mixed-purpose PRs complicate reviews and increase the likelihood of unintended regressions.

Comment thread CONTRIBUTING.md

Large changes are easier to review and merge when they are split into a few smaller pull requests. From our experience, it is often better to prepare the codebase first with focused cleanup, refactoring, or test-only PRs, and then add the feature or behavior change in a later PR.

Avoid packing unrelated cleanup, infrastructure changes, test rewrites, and the feature itself into one large pull request. Smaller PRs help maintainers verify intent, reduce review time, and lower the risk of regressions.
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 a new feature, implement the smallest change that solves the problem. Polish, additional configuration, optimization, and extensions can be addressed in the follow-up PRs

Comment thread CONTRIBUTING.md
- a link to the related issue, when one exists
- an explanation of the user-visible behavior and compatibility impact
- tests for the changed behavior, including integration tests when the change interacts with ClickHouse server behavior
- the local test commands that were run
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.

  • run the project's code review skill against your diff before requesting human review

this and run tests locally can be moved to before you open a PR

Comment thread CONTRIBUTING.md

Every pull request should include:

- a clear description of what changed and why
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.

Suggested change
- a clear description of what changed and why
- a clear description of what changed, why and why now

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.

3 participants