Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge with master of aiven/karapace to our repository #8

Merged
merged 58 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c8b1480
tests/test_schema.py: splitting test_schema()
juha-aiven May 12, 2021
e37d996
Added information how to run integration tests against Confluence stack
juha-aiven May 18, 2021
058ef70
Kafka REST fixed version to 6.1.1 to match Schema Registry
juha-aiven May 19, 2021
49e254c
README.rst: clarified compatibility
juha-aiven May 19, 2021
1c97738
Configuration Keys as table
ftisiot May 19, 2021
f0018fd
fixed content table
ftisiot May 19, 2021
e279dd3
Fixed small spelling bugs
ftisiot May 19, 2021
0f306a6
Merge pull request #223 from aiven/testing-against-confluent
tvainika May 19, 2021
2a21a4c
Merge pull request #224 from aiven/ft_fix_readme_parameters
tvainika May 20, 2021
6d40c86
test_schema.py removed assert_schema_versions from test_schema_repost…
juha-aiven May 21, 2021
e1d237b
test_schema.py added -> None to all test method signatures.
juha-aiven May 21, 2021
72f0b2d
test_schema.py: added annotations to all functions
juha-aiven May 21, 2021
d627ca5
test_schema.py duplicate code removal
juha-aiven May 21, 2021
64d58ea
test_schema.py moved a comment to a an assert message
juha-aiven May 21, 2021
8639462
test_schema.py removed unneeded f-string wrappings
juha-aiven May 21, 2021
01495cf
utils.py AVRO name compatible (http://avro.apache.org/docs/current/sp…
juha-aiven May 21, 2021
7fedcb2
test_schema.py test_schema_version_numbering uses 'name' in the Avro …
juha-aiven May 21, 2021
f8c73b2
test_schema.py: str format() -> f-strings
juha-aiven May 21, 2021
e93fd1b
test_schema.py no more JSONs as strings, instead dicts that are dumpe…
juha-aiven May 21, 2021
4118132
Merge pull request #221 from aiven/split_test_schema
May 21, 2021
77ad049
utils.py add create_schema_name_factory, create safer names
juha-aiven May 17, 2021
0b11a61
test_schema.py: split test_schema_versions into two tests
juha-aiven May 17, 2021
a0d7653
test_schema.py: test_schema_remains_constant fixes
juha-aiven May 14, 2021
58bb9ba
test_schema.py removed test_enum_schema_compatibility
juha-aiven May 24, 2021
309360a
test_schema.py: fix test_schema_repost
juha-aiven May 14, 2021
979d238
test_schema.py test_compatibility_endpoint fix
juha-aiven May 24, 2021
7d07d10
test_schema.py test_record_schema_compatibility_backward split into two
juha-aiven May 17, 2021
49b4f5b
test_schema_version_number_existing_schema takes version ids from res…
juha-aiven May 14, 2021
9dcda60
test_schema.py: test_schema_subject_version_schema fix
juha-aiven May 17, 2021
67e3030
test_schema.py: test_schema_same_subject fix
juha-aiven May 14, 2021
41f8224
Handle gracefully if no node is master eligible
tvainika May 24, 2021
660a2ee
Merge pull request #225 from aiven/sr-compat-test-fixes
tvainika May 25, 2021
eb42fc4
schema_registry: breaking change in an error message
juha-aiven May 17, 2021
8930205
Merge pull request #228 from aiven/sr-compat-subject-post-error-message
tvainika May 26, 2021
2eda86a
schema_registry: breaking change in subjects/{}/versions/{}
juha-aiven May 14, 2021
6387480
test_schema.py test_version_number_validation fix
juha-aiven May 14, 2021
acf7610
Add some typing, rename eligible master flag for clarification
tvainika May 26, 2021
56a38dd
schema_registry: breaking change in POST subjects/{subject}/versions
juha-aiven May 14, 2021
069e134
schema_registry: breaking changes in some HTTP error messages
juha-aiven May 14, 2021
b9cedb1
Merge pull request #229 from aiven/sr-compat-post-subjects-versions-e…
tvainika May 26, 2021
6da1886
schema_registry: breaking change in /schemas/ids/<>/versions
juha-aiven May 17, 2021
d91b171
test_schema.py: test_schema_versions_deleting: No unique field
juha-aiven May 26, 2021
80b0353
Merge pull request #231 from aiven/sr-compat-subject-version-post-wit…
tvainika May 26, 2021
9dd407d
Merge pull request #233 from aiven/sr-compat-schema-deletion
tvainika May 26, 2021
4c8cacd
readme: clarified and separated readme
May 25, 2021
31a3e93
Remove explicit master eligibility flag and utilize optional master_url
tvainika May 26, 2021
e12d7c6
Merge pull request #232 from aiven/sr-compat-http-error-messages
May 26, 2021
f74c027
Merge pull request #227 from aiven/hacka-update-readme
tvainika May 27, 2021
7457275
CONTRIBUTING.md small fixes
juha-aiven May 27, 2021
092703d
Merge pull request #237 from aiven/juha-mynttinen-improving-contribut…
tvainika May 27, 2021
602d49b
doc: fixed grammar
May 27, 2021
6633aca
Merge pull request #226 from aiven/no-eligible-master
May 27, 2021
0a59001
Merge pull request #239 from aiven/hacka-fix-contributing
tvainika May 28, 2021
51feccf
KarapaceAll: startup fix
juha-aiven May 28, 2021
ebe22a1
Merge pull request #240 from aiven/juha-mynttinen-fix-karapace-all
tvainika May 28, 2021
467f18a
docs: locahost -> localhost
juha-aiven May 28, 2021
fa7211f
Merge pull request #242 from aiven/typo-fix-in-docs
May 28, 2021
620759f
merge for sync with aiven/karapace
libretto Jun 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 93 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,102 @@
# Welcome!

Contributions are very welcome on Karapace. Please follow the guidelines:
Contributions are very welcome on Karapace. When contributing please keep this in mind:

- It's recommended to open an issue to discuss a feature before putting in a lot of effort.
- Open an issue to discuss new bigger features.
- Write code consistent with the project style and make sure the tests are passing.
- Stay in touch with us if we have follow up questions or requests for further changes.

- We use [GitHub Flow](https://guides.github.com/introduction/flow/), check that your main branch is up to date, and create a new branch for changes.
# Development

- Commit messages should describe the changes, not the filenames. Win our admiration by following the [excellent advice from Chris Beams](https://chris.beams.io/posts/git-commit/) when composing commit messages.
## Local Environment

- Choose a meaningful title for your pull request.
There is very little you need to get started coding for Karapace:

- The pull request description should focus on what changed and why.
- Use [one of the supported python versions](https://github.com/aiven/karapace/blob/master/setup.py)
documented in the `setup.py` classifiers.
- Create [a virtual environment](https://docs.python.org/3/tutorial/venv.html) and install the dev dependencies in it:

- Check that the tests pass (and add test coverage for your changes if appropriate).
```python
python -m venv <path_to_venv>
source <path_to_venv>/bin/activate
pip install -r ./requirements-dev.txt
pip install -e .
```

- Stay in touch with us if we have follow up questions or requests for further changes.
## Tests

Tests are written with the [pytest](https://docs.pytest.org/) framework, and All PRs are tested for
each supported Python version using [GitHub Flow](https://guides.github.com/introduction/flow/).

There are two flavors of tests, unit tests and integration tests:

- Unit: These are faster and very useful for quick iterations. They are usually testing pure
functions.
- Integration: Are slower but more complete. These tests run Karapace, ZooKeeper, and Kafka servers,
pytest's fixtures are used to start/stop these for you.

Both flavors run in parallel using [pytest-xdist](https://github.com/pytest-dev/pytest-xdist). New
tests should be engineered with this in mind:

- Don't reuse schema/subject/topic names
- Expect other clients to be interacting with the servers at the same time.

To run the tests use `make`. It will download Kafka to be used in the tests for you:

```sh
make unittest
make integrationtest
```

### PyCharm

If you want to run the tests from within the IDE, first download Kafka using `make fetch-kafka`, and
use the project root as the working directory.

### Compatibility tests

The integration tests can be configured to use an external REST (`--rest-url`), Registry
(`--registry-url`) and Kafka (`--kafka-bootstrap-servers`). These can be used to make sure the
tests conform to the Kafka REST or Schema Registry APIs, and then that Karapace conform to the
tests:

```sh
docker-compose -f ./tests/integration/confluent-docker-compose.yml up -d
pytest --kafka-bootstrap-servers localhost:9092 --registry-url http://localhost:8081 --rest-url http://localhost:8082/ tests/integration
```

## Static checking and Linting

The code is statically checked and formatted using [a few
tools](https://github.com/aiven/karapace/blob/master/requirements-dev.txt). To run these
automatically on each commit please enable the [pre-commit](https://pre-commit.com) hooks.
Alternatively you can run it manually with `make pre-commit`.

## Manual testing

To use your development code, you just need to set up a Kafka server and run Karapace from you
virtual environment:

```
docker-compose -f ./container/docker-compose.yml up -d kafka
karapace karapace.config.json
```

### Configuration

To see descriptions of configuration keys see our
[README](https://github.com/aiven/karapace#configuration-keys).

Each configuration key can be overridden with an environment variable prefixed with `KARAPACE_`,
exception being configuration keys that actually start with the `karapace` string. For example, to
override the `bootstrap_uri` config value, one would use the environment variable
`KARAPACE_BOOTSTRAP_URI`.

# Opening a PR

- Commit messages should describe the changes, not the filenames. Win our admiration by following
the [excellent advice from Chris Beams](https://chris.beams.io/posts/git-commit/) when composing
commit messages.
- Choose a meaningful title for your pull request.
- The pull request description should focus on what changed and why.
- Check that the tests pass (and add test coverage for your changes if appropriate).
Loading