Skip to content

Commit e9b246f

Browse files
authored
Add CONTRIBUTING.md guide (#1943)
## Changes Adds a root `CONTRIBUTING.md` — the repository has never had one. The guide covers: - **Prerequisites** — Node.js `>=22`, Yarn `3.2.x`, Python - **Getting started** — `yarn install` and fetching the bundled Databricks CLI - **Building and running** — `yarn build`, the `F5` Extension Development Host, and `watch` - **Testing** — the real `test:*` scripts (`test:lint`, `test:unit`, `test:python`, `test:cov`, `test:integ`) - **Code style** — `yarn fix` and the CI lint gate - **Pull requests** — the contribution flow - **Contributor License Agreement** — the manual, maintainer-driven CLA process required for Databricks-Licensed projects (no self-service form; the CLA is sent during review if a change is accepted, and must be signed before merge) Closes #2 — the earliest open issue in the repo ("Add contribution instructions"), filed at project inception. ## Tests Docs-only change; no code paths affected. Commands, script names, and versions were cross-checked against `package.json` and the `README`. The file is prettier-formatted. This pull request and its description were written by Isaac.
1 parent 34b9abc commit e9b246f

1 file changed

Lines changed: 179 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# Contributing to the Databricks extension for VSCode
2+
3+
Thank you for your interest in contributing! This document explains how to set
4+
up your environment, make a change, and open a pull request.
5+
6+
## Found an issue?
7+
8+
If you find a bug or have a feature request, please file an issue:
9+
https://github.com/databricks/databricks-vscode/issues/new
10+
11+
When reporting a bug, please attach the extension logs as described here:
12+
https://docs.databricks.com/dev-tools/vscode-ext.html#send-usage-logs-to-databricks
13+
14+
## Prerequisites
15+
16+
- **Node.js** `>=22`
17+
- **Yarn** `3.2.x` (the repo pins `yarn@3.2.1` via `packageManager`)
18+
- **Python** (for the Python-side unit tests and the bundled runtime scripts)
19+
20+
## Getting started
21+
22+
Prepare Yarn and install dependencies:
23+
24+
```sh
25+
npm install -g yarn@3
26+
yarn install
27+
```
28+
29+
The Databricks JavaScript SDK (`@databricks/sdk-experimental`) is a regular npm
30+
dependency and is installed automatically by `yarn install` — no separate step
31+
is required.
32+
33+
Fetch the Databricks CLI that the extension bundles:
34+
35+
```sh
36+
yarn workspace databricks run package:cli:fetch
37+
```
38+
39+
After that you're ready to build, run, and test the extension.
40+
41+
## Building and running
42+
43+
Build all workspaces:
44+
45+
```sh
46+
yarn build
47+
```
48+
49+
To develop the extension interactively, open the repository in VSCode and press
50+
`F5` to launch the Extension Development Host. Use the `watch` script for
51+
incremental rebuilds while you work:
52+
53+
```sh
54+
yarn workspace databricks run watch
55+
```
56+
57+
## Testing
58+
59+
Run the full check (lint + unit tests) across all workspaces from the repo root:
60+
61+
```sh
62+
yarn test
63+
```
64+
65+
Within the `databricks-vscode` package you can run the individual suites:
66+
67+
```sh
68+
# Lint (eslint + prettier check)
69+
yarn workspace databricks run test:lint
70+
71+
# TypeScript unit tests (VSCode test runner)
72+
yarn workspace databricks run test:unit
73+
74+
# Python unit tests
75+
yarn workspace databricks run test:python
76+
77+
# Unit tests with coverage
78+
yarn workspace databricks run test:cov
79+
80+
# End-to-end / integration tests (see "Integration test environment" below —
81+
# these require a live Databricks workspace and extra environment variables)
82+
yarn workspace databricks run test:integ
83+
```
84+
85+
Please add tests for any new behavior, and make sure the full suite passes
86+
before opening a pull request.
87+
88+
### Integration test environment
89+
90+
Unlike the lint and unit suites, `test:integ` runs against a **live Databricks
91+
workspace**, so it needs credentials and a cluster before it will start. The
92+
e2e runner resolves authentication through the standard Databricks SDK unified
93+
auth (environment variables or a `.databrickscfg` profile), and it asserts that
94+
a default cluster is configured.
95+
96+
Set the following before running `yarn workspace databricks run test:integ`:
97+
98+
| Variable | Required | Description |
99+
| --------------------------------------------------- | -------------------- | ----------------------------------------------------------------------------------- |
100+
| `DATABRICKS_HOST` | Yes | Workspace URL, e.g. `https://my-workspace.cloud.databricks.com`. |
101+
| `TEST_DEFAULT_CLUSTER_ID` | Yes | ID of an existing cluster in that workspace; the runner starts it before the tests. |
102+
| `DATABRICKS_TOKEN` | For PAT auth | Personal access token. Provide this **or** the OAuth pair below. |
103+
| `DATABRICKS_CLIENT_ID` / `DATABRICKS_CLIENT_SECRET` | For OAuth (M2M) auth | Service principal credentials, used when no token is set. |
104+
105+
For example, using a personal access token:
106+
107+
```sh
108+
export DATABRICKS_HOST="https://my-workspace.cloud.databricks.com"
109+
export DATABRICKS_TOKEN="dapi..."
110+
export TEST_DEFAULT_CLUSTER_ID="0101-234567-abcdefgh"
111+
112+
yarn workspace databricks run test:integ
113+
```
114+
115+
Instead of exporting `DATABRICKS_HOST`/`DATABRICKS_TOKEN` you may point the SDK
116+
at an existing profile (for example `export DATABRICKS_CONFIG_PROFILE=DEFAULT`);
117+
`TEST_DEFAULT_CLUSTER_ID` is still required in that case. The extension e2e tests
118+
also build a `.vsix` package as part of `test:integ:prepare`, so make sure you
119+
have run `yarn build` first.
120+
121+
## Code style
122+
123+
Formatting and linting are enforced by prettier and eslint. Auto-fix
124+
formatting and lint issues with:
125+
126+
```sh
127+
yarn fix
128+
```
129+
130+
CI runs `yarn test`, which includes `test:lint`, so unformatted or lint-failing
131+
code will not pass.
132+
133+
## Pull requests
134+
135+
1. Fork the repository and create a topic branch from `main`.
136+
2. Keep each PR focused on a single change; split unrelated fixes or
137+
refactors into separate PRs.
138+
3. Make sure `yarn test` passes and add tests for new behavior.
139+
4. Fill in the PR template — describe **what** changed and **how** it was
140+
tested.
141+
5. Open your pull request. You do **not** need to sign anything up front — a
142+
maintainer will request the Contributor License Agreement during review if
143+
your change is accepted (see below).
144+
145+
## Contributor License Agreement
146+
147+
This project is licensed under the [Databricks License](LICENSE). To accept
148+
contributions, we need to confirm that you have the right to submit your
149+
contribution and that you grant Databricks the right to distribute it. For
150+
projects under the Databricks License this is done through a **Contributor
151+
License Agreement (CLA)** rather than a DCO commit sign-off.
152+
153+
### How the CLA process works
154+
155+
The CLA is handled manually by the maintainers — there is no self-service form
156+
to sign in advance:
157+
158+
1. **Open your pull request** as normal. There is no need to sign anything
159+
before you do — just author your commits with your real name and email (git
160+
records these automatically).
161+
2. **A maintainer reviews your change.** If we would like to accept it, we will
162+
send you the Databricks CLA and ask you, in a PR comment, to sign and return
163+
it.
164+
3. **Sign the CLA** and return it as instructed, then confirm on the pull
165+
request.
166+
4. **We merge** once the signed CLA is in place and the review is complete.
167+
168+
Notes:
169+
170+
- If you are contributing on behalf of a company, you may need internal
171+
approval to sign the CLA, and it may require signature from an officer of the
172+
company. Please start this process early so it doesn't block your PR.
173+
- Once the CLA is signed it covers subsequent contributions from the same
174+
contributor or company — you only need to sign once.
175+
176+
## License
177+
178+
By contributing, you agree that your contributions will be licensed under the
179+
terms of the [LICENSE](LICENSE) in this repository (the Databricks License).

0 commit comments

Comments
 (0)