Skip to content

Latest commit

 

History

History
99 lines (68 loc) · 2.6 KB

File metadata and controls

99 lines (68 loc) · 2.6 KB

Contributing to the OCM CLI

For the general contribution process (fork-and-pull workflow, commit requirements, code of conduct, and more), see the central contributing guide on the project website.

This document covers repository-specific development details.

Prerequisites

  • Go 1.26+
  • Make
  • Docker - required for integration tests

Project Structure

.
├── api/           # Core Go library (OCM, OCI, credentials, datacontext)
├── cmds/          # CLI entry-points and plugins
├── components/    # Component definitions for building OCM component versions
├── docs/          # CLI reference, plugin reference, ADRs
├── examples/      # Usage examples
├── hack/          # Development scripts (generate, format, install, cross-build)
├── Makefile       # Build automation
└── VERSION        # Current version

Common Tasks

# Build all binaries
make build

# Build ocm cli
make bin/ocm

# Run all tests (unit + integration; requires Docker)
make test

# Run unit tests only
make unit-test

# Format code (gci + gofumpt)
make format

# Lint
make check

# Lint with auto-fix
make check-fix

# Full pipeline: generate, format, generate-deepcopy, build, test, lint
make prepare

# Install dev dependencies (vault, oci-registry, ...)
make install-requirements

Testing

Tests use Ginkgo and Gomega.

Build tag Purpose Requirements
(none) Unit tests Go only
integration Integration tests Docker, vault, oci-registry
unix Unix-specific tests Linux / macOS

make test runs with the integration tag. make unit-test runs without tags.

Linting

  • Linter: golangci-lint, configured in .github/config/golangci.yaml

Code Generation

make generate            # go generate
make generate-deepcopy   # controller-gen for api/ocm/compdesc/

Run these before committing if you change types or CLI commands.

Pull Requests

PR titles must follow Conventional Commits:

<type>(<optional scope>): <description>

Allowed types: feat, fix, chore, docs, test, perf

Questions?