Skip to content

Conversation

@tisnik
Copy link
Contributor

@tisnik tisnik commented Sep 12, 2025

Description

LCORE-663: Updated contributing guide

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement

Related Tickets & Documents

  • Related Issue #LCORE-663

Summary by CodeRabbit

  • Documentation
    • Reorganized contributor guidelines: promoted Code coverage measurement and Linters to top-level; added dedicated Ruff and Pylint sections; introduced a Formatting rules subsection under Code style with Black details; updated table of contents and spacing for clearer navigation.
    • Updated testing guidance: recommend using pytest for all new tests and avoiding mixing pytest and unittest within the same suite to maintain consistency.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 12, 2025

Walkthrough

Reorganizes documentation: CONTRIBUTING.md’s sections are restructured (moving Code coverage and Linters to top-level; splitting Linters into Ruff and Pylint; adding a Formatting rules subsection under Code style; adjusting TOC). Adds a note in docs/testing.md advising using pytest exclusively and not mixing pytest and unittest.

Changes

Cohort / File(s) Summary of changes
Documentation structure and TOC updates
CONTRIBUTING.md
Promotes Code coverage measurement and Linters to top-level; restructures Linters into separate Ruff and Pylint sections; introduces a Code style → Formatting rules subsection with Black details; updates TOC; formatting/spacing adjustments.
Testing guidance note
docs/testing.md
Adds a note under Unit tests recommending using pytest for all tests and avoiding mixing pytest and unittest.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Pre-merge checks (3 passed)

✅ 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 "LCORE-663: Updated contributing guide" accurately and concisely summarizes the primary change in this changeset (documentation updates to CONTRIBUTING.md and related docs) and is relevant and clear for a quick scan of project history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

A rabbit taps on docs with care,
Shifts headings up the ladder’s stair.
Ruff and Pylint hop in line,
Black keeps borders clean and fine.
Tests now leap with pytest’s zest—
No mixed tracks, just one best.
Thump-thump: tidy burrow, blessed. 🐇✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing touches
🧪 Generate unit tests
  • 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.

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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CONTRIBUTING.md (1)

139-155: Invalid Ruff CLI command; replace with correct guidance.

ruff linter is not a valid subcommand. Recommend pointing to docs and using ruff rule <CODE> or ruff --explain <CODE>.

-List of all _Ruff_ rules recognized by Ruff can be retrieved by:
-
-```
-ruff linter
-```
-
-Description of all _Ruff_ rules are available on https://docs.astral.sh/ruff/rules/
-
-Ruff rules can be disabled in source code (for given line or block) by using special `noqa` comment line. For example:
+See the complete list of rules: https://docs.astral.sh/ruff/rules/
+
+Explain a specific rule from the CLI:
+```
+ruff rule E402
+# or
+ruff --explain E402
+```
+
+Disable a rule inline with `noqa`, for example:
🧹 Nitpick comments (3)
CONTRIBUTING.md (3)

14-22: Fix TOC nesting to satisfy markdownlint MD007 (2-space indents).

Current nested bullets use 4 spaces; expected is 2.

-* [Linters](#linters)
-    * [Type hints checks](#type-hints-checks)
-    * [Ruff](#ruff)
-    * [Pylint](#pylint)
+* [Linters](#linters)
+  * [Type hints checks](#type-hints-checks)
+  * [Ruff](#ruff)
+  * [Pylint](#pylint)
 * [Code style](#code-style)
-    * [Formatting rules](#formatting-rules)
+  * [Formatting rules](#formatting-rules)

123-124: Grammar fix and tool name formatting.

Minor clarity/readability improvements.

-_Black_, _Ruff_, Pyright, _Pylint_, __Pydocstyle__, __Mypy__, and __Bandit__ tools are used as linters. There are a bunch of linter rules enabled for this repository. All of them are specified in `pyproject.toml`, such us in sections `[tool.ruff]` and `[tool.pylint."MESSAGES CONTROL"]`. Some specific rules can be disabled using `ignore` parameter (empty now).
+_Black_, _Ruff_, _Pyright_, _Pylint_, _pydocstyle_, _mypy_, and _Bandit_ are used. Linter rules are configured in `pyproject.toml` (for example, `[tool.ruff]` and `[tool.pylint."MESSAGES CONTROL"]`). Some rules can be disabled using the `ignore` parameter (currently empty).

186-189: Optional: mention formatter invocation for consistency.

If Black is the sole formatter, reference the existing Make target to reduce ambiguity.

-Code formatting rules are checked by __Black__. More info can be found on [https://black.readthedocs.io/en/stable/](https://black.readthedocs.io/en/stable/).
+Code formatting is enforced by Black. Run `make format` (or via pre-commit). More info: https://black.readthedocs.io/en/stable/
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09b8675 and d105119.

📒 Files selected for processing (2)
  • CONTRIBUTING.md (5 hunks)
  • docs/testing.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
CONTRIBUTING.md

16-16: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


17-17: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


18-18: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


19-19: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


21-21: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

⏰ 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: build-pr
  • GitHub Check: e2e_tests

Comment on lines +113 to +119
## Code coverage measurement

During testing, code coverage is measured. If the coverage is below defined threshold (see `pyproject.toml` settings for actual value stored in section `[tool.coverage.report]`), tests will fail. We measured and checked code coverage in order to be able to develop software with high quality.

Code coverage reports are generated in JSON and also in format compatible with [_JUnit_ test automation framework](https://junit.org/junit5/). It is also possible to start `make coverage-report` to generate code coverage reports in the form of interactive HTML pages. These pages are stored in the `htmlcov` subdirectory. Just open the index page from this subdirectory in your web browser.


Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify coverage report formats match what CI actually produces.

Text states “JSON and JUnit-compatible” coverage outputs. Coverage.py typically emits XML/HTML; JUnit is usually for test results, not coverage.

Consider aligning this with the Makefile/CI. To check:


🏁 Script executed:

#!/bin/bash
# Inspect coverage targets and report outputs
rg -nC2 -i 'coverage|cov' Makefile **/.github/workflows/*.yml **/pyproject.toml

Length of output: 1024


Clarify coverage vs. JUnit outputs.

Makefile shows coverage is emitted as JSON (--cov-report "json:...") and pytest writes JUnit XML as test-result files (--junit-xml). CONTRIBUTING.md (lines 113–119) is misleading — JUnit XML is not a coverage report. Update CONTRIBUTING.md to state coverage reports are JSON and that test results are produced in JUnit XML, and either add/point to pyproject.toml if it contains the coverage threshold or remove/replace that reference (Makefile unit/integration targets are the authoritative source).

🤖 Prompt for AI Agents
In CONTRIBUTING.md around lines 113–119, the text incorrectly implies JUnit XML
is a coverage report; update the paragraph to state that coverage reports are
generated as JSON (and HTML via make coverage-report/htmlcov) and that pytest
writes JUnit XML files containing test results (not coverage), and then either
point readers to pyproject.toml for the coverage threshold or remove that
reference and instead point to the Makefile (unit/integration targets) as the
authoritative source for how coverage and test result outputs are produced; make
the wording concise and replace the misleading sentence accordingly.

Comment on lines +72 to +73
[NOTE] Please do not mix pytest and unittest modules in new tests. It is preferred to use pytest in every tests, which will help the team to maintain consistency.

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Clarify pytest vs unittest guidance; fix grammar.

Current note conflicts with earlier guidance that unittest is used for mocking/patching and has grammar issues.

Apply:

-[NOTE] Please do not mix pytest and unittest modules in new tests. It is preferred to use pytest in every tests, which will help the team to maintain consistency.
+[NOTE] Prefer pytest for all new tests and avoid writing unittest.TestCase-based tests. Using unittest.mock within pytest tests is fine. This consistency helps the team maintain the suite.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[NOTE] Please do not mix pytest and unittest modules in new tests. It is preferred to use pytest in every tests, which will help the team to maintain consistency.
[NOTE] Prefer pytest for all new tests and avoid writing unittest.TestCase-based tests. Using unittest.mock within pytest tests is fine. This consistency helps the team maintain the suite.
🤖 Prompt for AI Agents
In docs/testing.md around lines 72 to 73, the current note both has grammar
problems and conflicts with earlier guidance about using unittest for
mocking/patching; replace it with a clear, grammatically-correct sentence that
says: prefer writing tests with pytest for consistency, do not mix pytest and
unittest frameworks within the same test file, and it is acceptable to use
unittest.mock (or the mock library) for mocking/patching when needed. Ensure the
wording is concise and consistent with the earlier section about mocking.

@tisnik tisnik merged commit 826dadb into lightspeed-core:main Sep 12, 2025
19 checks passed
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.

1 participant