Skip to content

Commit c935ca2

Browse files
committed
sync contributing guide
Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com>
1 parent 812557b commit c935ca2

2 files changed

Lines changed: 100 additions & 4 deletions

File tree

CONTRIBUTING.md

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,99 @@
1-
# Welcome to the OCM community
1+
# Contributing to the OCM CLI
22

3-
We welcome many different types of contributions.
3+
For the general contribution process (fork-and-pull workflow, commit requirements, code of conduct, and more), see the
4+
[central contributing guide](https://ocm.software/community/contributing/) on the project website.
45

5-
Please refer to the [Contributing Guide in the Community repository](https://github.com/open-component-model/.github/blob/main/CONTRIBUTING.md) for more information on how to get support from maintainers, find work to contribute, the Pull Request checklist, the Pull Request process, and other useful information on how to contribute to OCM.
6+
This document covers repository-specific development details.
7+
8+
## Prerequisites
9+
10+
- **Go 1.26+**
11+
- **Make**
12+
- **Docker** - required for integration tests
13+
14+
## Project Structure
15+
16+
```text
17+
.
18+
├── api/ # Core Go library (OCM, OCI, credentials, datacontext)
19+
├── cmds/ # CLI entry-points and plugins
20+
├── components/ # Component definitions for building OCM component versions
21+
├── docs/ # CLI reference, plugin reference, ADRs
22+
├── examples/ # Usage examples
23+
├── hack/ # Development scripts (generate, format, install, cross-build)
24+
├── Makefile # Build automation
25+
└── VERSION # Current version
26+
```
27+
28+
## Common Tasks
29+
30+
```bash
31+
# Build all binaries
32+
make build
33+
34+
# Build ocm cli
35+
make bin/ocm
36+
37+
# Run all tests (unit + integration; requires Docker)
38+
make test
39+
40+
# Run unit tests only
41+
make unit-test
42+
43+
# Format code (gci + gofumpt)
44+
make format
45+
46+
# Lint
47+
make check
48+
49+
# Lint with auto-fix
50+
make check-fix
51+
52+
# Full pipeline: generate, format, generate-deepcopy, build, test, lint
53+
make prepare
54+
55+
# Install dev dependencies (vault, oci-registry, ...)
56+
make install-requirements
57+
```
58+
59+
## Testing
60+
61+
Tests use [Ginkgo](https://onsi.github.io/ginkgo/) and [Gomega](https://onsi.github.io/gomega/).
62+
63+
| Build tag | Purpose | Requirements |
64+
|-----------|---------|--------------|
65+
| *(none)* | Unit tests | Go only |
66+
| `integration` | Integration tests | Docker, vault, oci-registry |
67+
| `unix` | Unix-specific tests | Linux / macOS |
68+
69+
`make test` runs with the `integration` tag. `make unit-test` runs without tags.
70+
71+
## Linting
72+
73+
- **Linter**: golangci-lint, configured in `.github/config/golangci.yaml`
74+
75+
## Code Generation
76+
77+
```bash
78+
make generate # go generate
79+
make generate-deepcopy # controller-gen for api/ocm/compdesc/
80+
```
81+
82+
Run these before committing if you change types or CLI commands.
83+
84+
## Pull Requests
85+
86+
PR titles must follow [Conventional Commits](https://www.conventionalcommits.org/):
87+
88+
```text
89+
<type>(<optional scope>): <description>
90+
```
91+
92+
Allowed types: `feat`, `fix`, `chore`, `docs`, `test`, `perf`
93+
94+
## Questions?
95+
96+
- [Project issues](https://github.com/open-component-model/ocm-project/issues)
97+
- [Repository issues](https://github.com/open-component-model/ocm/issues)
98+
- [Community engagement](https://ocm.software/community/engagement/)
99+
- [NeoNephos Code of Conduct](https://github.com/neonephos/.github/blob/main/CODE_OF_CONDUCT.md)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ You can find the old keys in the website github repository
170170

171171
## Contributing
172172

173-
Code contributions, feature requests, bug reports, and help requests are very welcome. Please refer to the [Contributing Guide in the Community repository](https://github.com/open-component-model/community/blob/main/CONTRIBUTING.md) for more information on how to contribute to OCM.
173+
Code contributions, feature requests, bug reports, and help requests are very welcome.
174+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and workflow details,
175+
or the [central contributing guide](https://ocm.software/community/contributing/) for the general process.
174176

175177
OCM follows the [NeoNephos Code of Conduct](https://github.com/neonephos/.github/blob/main/CODE_OF_CONDUCT.md).
176178

0 commit comments

Comments
 (0)