Skip to content

Latest commit

 

History

History
97 lines (64 loc) · 3.33 KB

File metadata and controls

97 lines (64 loc) · 3.33 KB

Contributing

Thanks for helping improve contentful-management.java.

Development with Dev Containers

This repository includes a .devcontainer configuration for a reproducible local setup. GitHub Actions uses the same devcontainer configuration for CI.

Visual Studio Code

Open the repository in Visual Studio Code, install the Dev Containers extension if needed, then run Dev Containers: Reopen in Container. Wait for the container build and post-create setup to finish.

Terminal or other editors

Install Docker and the Dev Container CLI (npm install -g @devcontainers/cli). From the repository root, run:

devcontainer up --workspace-folder .
devcontainer exec --workspace-folder . bash

Verify the environment

./mvnw -B test

Pull Requests

  1. Fork the repository and create a branch for your change.
  2. Run the relevant checks from the dev container.
  3. Open a pull request with a short summary of the change and any follow-up context.

Testing

  • Framework: JUnit 4 (runner), Kotlin test assertions (kotlin-test-junit), OkHttp MockWebServer
  • Unit tests: src/test/kotlin/com/contentful/java/cma/ — each resource module has a corresponding *Tests.kt file
  • E2E / integration tests: src/test/kotlin/com/contentful/java/cma/e2e/ — require live CMA credentials (CONTENTFUL_ACCESS_TOKEN, CONTENTFUL_SPACE_ID)
  • Run all tests: ./mvnw -B test
  • Run specific test class: ./mvnw -B -Dtest=EntryTests test
  • Test fixtures: JSON response mocks are in src/test/resources/

Code Style

Checkstyle is enforced on every verify run:

./mvnw -B verify

The configuration lives in checkstyle.xml at the repo root. Violations will fail the build. Run ./mvnw -B verify locally before pushing to catch checkstyle violations — CI only runs ./mvnw -B test, which skips the checkstyle phase.

Commit Convention

This repo follows Conventional Commits by convention:

type(scope): description

Valid types: feat, fix, chore, docs, refactor, test, perf, ci, build

Examples:

feat(entries): add PATCH support for partial updates
fix(rich-text): correct nodeType deserialization for embedded entries
chore: update OkHttp to 4.12.0

Branch Strategy

  • master — the main branch; all PRs target here
  • Feature/fix branches — use descriptive names, e.g., feat/add-taxonomy-module, fix/rate-limit-retry
  • Release branches — release/X.Y.Z used during the release process

Release Process

Releases are managed via maven-release-plugin:

# Prepare a release (updates pom.xml versions, creates release tag)
./mvnw release:prepare

# Perform the release (builds, signs, and publishes to Sonatype Central)
./mvnw release:perform

Artifacts are published to Maven Central under com.contentful.java:cma-sdk. Pre-release snapshots are available via Sonatype snapshots repository and jitpack.io.

CI/CD

Job Trigger What it does
CI / Test (Java 8) Push to master, PR to master Spins up devcontainer, runs ./mvnw -B test
CodeQL Push / PR / weekly schedule Static analysis for security vulnerabilities