From 796e7797cf0d97bdedebf6a13e62b4e6191d74c4 Mon Sep 17 00:00:00 2001 From: tushar-mahalya Date: Mon, 23 Nov 2026 15:04:25 +0530 Subject: [PATCH] chore: add CodeRabbit review config and a contributor license agreement Every pull request now gets an automatic CodeRabbit review, tuned to this repo's layering, offline tests and pinned workflows, and a CLA Assistant check. The CLA is the SAP Individual CLA that CLA Assistant offers by default, with only the names and project adapted; its signed copy lives in a public gist. CONTRIBUTING (and its website copy) explains both. --- .coderabbit.yaml | 138 +++++++++++++++++++++++ CLA.md | 30 +++++ CONTRIBUTING.md | 24 +++- website/src/content/docs/contributing.md | 24 +++- 4 files changed, 214 insertions(+), 2 deletions(-) create mode 100644 .coderabbit.yaml create mode 100644 CLA.md diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..b25f029 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,138 @@ +# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json +# Reviews are advice: CodeRabbit is not a required check, and a maintainer +# decides what merges. Switch `profile` to `assertive` for stricter reviews. +language: en-US + +reviews: + profile: chill + request_changes_workflow: false + high_level_summary: true + poem: false + review_status: true + + auto_review: + enabled: true + drafts: false + base_branches: + - main + ignore_usernames: + - dependabot[bot] + - renovate[bot] + - github-actions[bot] + + path_filters: + - "!uv.lock" + - "!website/package-lock.json" + - "!.secrets.baseline" + - "!**/dist/**" + - "!**/build/**" + - "!**/node_modules/**" + - "!htmlcov/**" + - "!coverage.md" + # Search-engine verification files; their bytes must not change. + - "!website/public/google*.html" + - "!website/public/[0-9a-f]*.txt" + + path_instructions: + - path: "src/kdev/**/*.py" + instructions: | + Layering (see CONTRIBUTING.md and docs/ARCHITECTURE.md): `commands/` parses + arguments, calls logic and renders with `ui`, making no Kaggle API calls of + its own beyond reads. The behaviour lives in `session`, `persistence`, + `quota` and `notebook` and must stay testable without a terminal. + Everything the user sees goes through `ui.py`; flag new output that + bypasses it. A failure the user can act on is a `KdevError` that + names the command that fixes it, not a bare exception or traceback. + Flag any path by which OAuth tokens, tunnel credentials or deploy keys + could reach logs (including `-v` API logging) or error messages. + Type hints are checked by basedpyright (basic mode); ruff is configured in + pyproject.toml, so skip pure style comments it would already catch. + - path: "src/kdev/kdev_box.py" + instructions: | + This module is shipped into the Kaggle container and runs there: it must + stay standard-library only, with no imports from the rest of `kdev`. + Restore must never touch a file that existed before it started, and + `.kdev/state.json` must say `restored: false` until every layer is in + place. Flag anything that could break either rule or that assumes a + clean exit (a session can be killed at any point). + - path: "src/kdev/ui.py" + instructions: | + The design system. New elements use the tokens, glyphs and gutter + documented in the module docstring, and the docstring is updated when a + component is added or changed. Piped (non-TTY) output stays plain words. + - path: "tests/**/*.py" + instructions: | + Tests stay offline: Kaggle is faked (see the fake in tests/test_cli.py), + and nothing may reach the network or a real account. A bug fix comes + with a test that fails without the fix; check that the assertion would + actually catch a regression. Tests are split by module, one + `test_.py` each. + - path: ".github/workflows/**" + instructions: | + Every action is pinned to a full commit SHA with a `# vX.Y.Z` comment; + flag tag- or branch-pinned `uses:`. Workflows default to + `permissions: contents: read` and widen per job only where needed. Flag + `pull_request_target`, untrusted `${{ github.event.* }}` interpolated into + `run:` scripts, and secrets exposed to jobs that run on fork PRs. + - path: "website/src/content/docs/**" + instructions: | + User docs, published at https://kdev-cli.pages.dev. Commands, flags and + defaults must match the CLI in src/kdev. contributing.md mirrors the + repo's CONTRIBUTING.md; a change to one usually belongs in both. + - path: "website/**/*.{astro,ts,mjs}" + instructions: | + Astro static site deployed to Cloudflare Pages. Keep it static: no new + runtime dependencies or third-party scripts without a stated reason. + - path: "CHANGELOG.md" + instructions: | + Keep a Changelog 1.1.0. New entries go under `## [Unreleased]`, in + Added/Changed/Fixed/Removed, written for users: what they will notice, + not how it was implemented. + - path: "**/*.md" + instructions: | + Plain, direct prose in the second person, as in the existing docs. When a + command or its behaviour changes, README.md, the website docs and + docs/ARCHITECTURE.md must agree with each other and with the code. + + tools: + ruff: + enabled: true + config_file: pyproject.toml + actionlint: + enabled: true + zizmor: + enabled: true + yamllint: + enabled: true + markdownlint: + enabled: true + gitleaks: + enabled: true + osvScanner: + enabled: true + biome: + enabled: true + github-checks: + enabled: true + # Covered by ruff, biome, gitleaks and detect-secrets, or no matching files here. + pylint: + enabled: false + flake8: + enabled: false + eslint: + enabled: false + oxc: + enabled: false + trufflehog: + enabled: false + hadolint: + enabled: false + languagetool: + enabled: false + shellcheck: + enabled: false + htmlhint: + enabled: false + +chat: + auto_reply: true diff --git a/CLA.md b/CLA.md new file mode 100644 index 0000000..bbbe8a1 --- /dev/null +++ b/CLA.md @@ -0,0 +1,30 @@ +# kdev Individual Contributor License Agreement + +> Derived from the SAP Individual Contributor License Agreement, the default +> agreement offered by [CLA Assistant](https://cla-assistant.io) +> ([source](https://gist.github.com/CLAassistant/bd1ea8ec8aa0357414e8)). Only the +> names of the parties and the project, the contact line and two line-wrap +> typos have been changed. You accept it by +> following the link CLA Assistant posts on your first pull request. + +Thank you for your interest in contributing to kdev, the open source software project made available at https://github.com/tushar-mahalya/kdev (the “Project”) by Tushar Sharma (GitHub: tushar-mahalya) (the “Maintainer”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to the Maintainer in respect of the Project (collectively “Contributions”). If you have any questions respecting this Agreement, please ask in the Project's discussions at https://github.com/tushar-mahalya/kdev/discussions. + +You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions. + +**Copyright License.** You hereby grant, and agree to grant, to the Maintainer a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute your Contributions and such derivative works, with the right to sublicense the foregoing rights through multiple tiers of sublicensees. + +**Patent License.** You hereby grant, and agree to grant, to the Maintainer a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your Contributions, where such license applies only to those patent claims licensable by you that are necessarily infringed by your Contributions alone or by combination of your Contributions with the Project, with the right to sublicense the foregoing rights through multiple tiers of sublicensees. + +**Moral Rights.** To the fullest extent permitted under applicable law, you hereby waive, and agree not to assert, all of your “moral rights” in or relating to your Contributions for the benefit of the Maintainer, the Maintainer's assigns, and their respective direct and indirect sublicensees. + +**Third Party Content/Rights.** If your Contribution includes or is based on any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that were not authored by you (“Third Party Content”) or if you are aware of any third party intellectual property or proprietary rights associated with your Contribution (“Third Party Rights”), then you agree to include with the submission of your Contribution full details respecting such Third Party Content and Third Party Rights, including, without limitation, identification of which aspects of your Contribution contain Third Party Content or are associated with Third Party Rights, the owner/author of the Third Party Content and Third Party Rights, where you obtained the Third Party Content, and any applicable third party license terms or restrictions respecting the Third Party Content and Third Party Rights. For greater certainty, the foregoing obligations respecting the identification of Third Party Content and Third Party Rights do not apply to any portion of the Project that is incorporated into your Contribution to the Project. + +**Representations.** You represent that, other than the Third Party Content and Third Party Rights identified by you in accordance with this Agreement, you are the sole author of your Contributions and are legally entitled to grant the foregoing licenses and waivers in respect of your Contributions. If your Contributions were created in the course of your employment with your past or present employer(s), you represent that such employer(s) has authorized you to make your Contributions on behalf of such employer(s) or such employer(s) has waived all of their right, title or interest in or to your Contributions. + +**Disclaimer.** To the fullest extent permitted under applicable law, your Contributions are provided on an "as-is" basis, without any warranties or conditions, express or implied, including, without limitation, any implied warranties or conditions of non-infringement, merchantability or fitness for a particular purpose. You are not required to provide support for your Contributions, except to the extent you desire to provide support. + +**No Obligation.** You acknowledge that the Maintainer is under no obligation to use or incorporate your Contributions into the Project. The decision to use or incorporate your Contributions into the Project will be made at the sole discretion of the Maintainer or the Maintainer's authorized delegates. + +**Disputes.** This Agreement shall be governed by and construed in accordance with the laws of the State of New York, United States of America, without giving effect to its principles or rules regarding conflicts of laws, other than such principles directing application of New York law. The parties hereby submit to venue in, and jurisdiction of the courts located in New York, New York for purposes relating to this Agreement. In the event that any of the provisions of this Agreement shall be held by a court or other tribunal of competent jurisdiction to be unenforceable, the remaining portions hereof shall remain in full force and effect. + +**Assignment.** You agree that the Maintainer may assign this Agreement, and all of its rights, obligations and licenses hereunder. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aaa0991..691b8d5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -96,6 +96,27 @@ on-box restore against a temporary directory. the [README](README.md), the [website docs](website/src/content/docs/) and, for how things work inside, [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md). +## Automated review + +[CodeRabbit](https://coderabbit.ai) reviews every pull request: it posts a +summary and line comments within a few minutes, and reviews again when you +push. Its comments are suggestions. Fix what is right, reply to what isn't, +and leave the rest; a maintainer decides what merges. You can talk to it in +the pull request: mention `@coderabbitai` with a question, or +`@coderabbitai review` to ask for a fresh review. + +## Contributor License Agreement + +Before your first pull request can merge, you sign the kdev +[Contributor License Agreement](CLA.md). It says that you wrote what you +contribute (or have the right to submit it) and lets the project keep +distributing it. You keep the copyright in your work. + +You don't need to do anything in advance: the CLA Assistant bot comments on +your first pull request with a link, and signing takes one click with your +GitHub account. It covers all your later pull requests. If the agreement +itself changes, the bot asks you to sign the new version. + ## Releasing For maintainers: bump `version` in `pyproject.toml`, move the `Unreleased` @@ -107,4 +128,5 @@ with the wheel and sdist attached. ## License kdev is [MIT licensed](LICENSE). By contributing, you agree that your -contributions are licensed under the same terms. +contributions are licensed under the same terms, and you grant the rights +set out in the [Contributor License Agreement](CLA.md). diff --git a/website/src/content/docs/contributing.md b/website/src/content/docs/contributing.md index 9d39af6..eed19f4 100644 --- a/website/src/content/docs/contributing.md +++ b/website/src/content/docs/contributing.md @@ -93,6 +93,27 @@ on-box restore against a temporary directory. [CHANGELOG.md](https://github.com/tushar-mahalya/kdev/blob/main/CHANGELOG.md), and update the README if a command or its behaviour changes. +## Automated review + +[CodeRabbit](https://coderabbit.ai) reviews every pull request: it posts a +summary and line comments within a few minutes, and reviews again when you +push. Its comments are suggestions. Fix what is right, reply to what isn't, +and leave the rest; a maintainer decides what merges. You can talk to it in +the pull request: mention `@coderabbitai` with a question, or +`@coderabbitai review` to ask for a fresh review. + +## Contributor License Agreement + +Before your first pull request can merge, you sign the kdev +[Contributor License Agreement](https://github.com/tushar-mahalya/kdev/blob/main/CLA.md). It says that you wrote what you +contribute (or have the right to submit it) and lets the project keep +distributing it. You keep the copyright in your work. + +You don't need to do anything in advance: the CLA Assistant bot comments on +your first pull request with a link, and signing takes one click with your +GitHub account. It covers all your later pull requests. If the agreement +itself changes, the bot asks you to sign the new version. + ## Releasing For maintainers: bump `version` in `pyproject.toml`, move the `Unreleased` @@ -104,4 +125,5 @@ with the wheel and sdist attached. ## License kdev is [MIT licensed](https://github.com/tushar-mahalya/kdev/blob/main/LICENSE). By contributing, you agree that your -contributions are licensed under the same terms. +contributions are licensed under the same terms, and you grant the rights +set out in the [Contributor License Agreement](https://github.com/tushar-mahalya/kdev/blob/main/CLA.md).