Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ dist/
**/.pytest_cache/
**/__pycache__/
**/*.pyc

81 changes: 81 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Pre-commit checks for pull requests
# Ensures all commits follow project conventions

name: Pre-commit Checks

on:
pull_request:
branches: [ "main" ]

jobs:
pre-commit:
name: Pre-commit Validation
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for commit message validation

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit on all files
run: pre-commit run --all-files --show-diff-on-failure

- name: Validate commit messages
run: |
# Get the range of commits in this PR
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"

echo "Checking commits from $BASE_SHA to $HEAD_SHA"

# Install conventional-pre-commit for validation
pip install conventional-pre-commit

# Check each commit message in the PR
FAILED=0
for COMMIT in $(git rev-list $BASE_SHA..$HEAD_SHA); do
MSG=$(git log --format=%B -n 1 $COMMIT)
echo "Checking commit $COMMIT:"
echo "$MSG"
echo "---"

# Validate using conventional-pre-commit pattern
if ! echo "$MSG" | grep -qE "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .+"; then
echo "❌ Commit message does not follow Conventional Commits format"
echo " Expected: <type>(<optional scope>): <description>"
echo " Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert"
FAILED=1
else
echo "✅ Valid commit message"
fi
echo ""
done

if [ $FAILED -eq 1 ]; then
echo ""
echo "============================================"
echo "❌ One or more commit messages are invalid!"
echo "============================================"
echo ""
echo "Please follow the Conventional Commits format:"
echo " <type>(<optional scope>): <description>"
echo ""
echo "Examples:"
echo " feat: add new UDP transport option"
echo " fix(sd): resolve multicast join issue"
echo " docs: update README with build instructions"
echo " chore: update dependencies"
echo ""
exit 1
fi

echo "✅ All commit messages are valid!"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ docs/diagrams/svg/
# Git
.git/
*.patch
*.diff
*.diff
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Pre-commit hooks configuration
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks

repos:
# Standard pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
# File quality checks
- id: trailing-whitespace
exclude: ^(.*\.patch|.*\.diff)$
- id: end-of-file-fixer
exclude: ^(.*\.patch|.*\.diff)$
- id: check-yaml
- id: check-json
- id: check-added-large-files
args: ['--maxkb=500']
- id: check-merge-conflict
- id: detect-private-key

# C++ specific
- id: check-case-conflict
- id: mixed-line-ending
args: ['--fix=lf']

# Commit message linting (Conventional Commits)
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.1.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args:
- feat
- fix
- docs
- style
- refactor
- perf
- test
- build
- ci
- chore
- revert
77 changes: 61 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Thank you for your interest in contributing to the SOME/IP Stack! This document
- [Code of Conduct](#code-of-conduct)
- [Getting Started](#getting-started)
- [Development Workflow](#development-workflow)
- [Branch Naming](#branch-naming)
- [Commit Messages](#commit-messages)
- [Pre-commit Hooks Setup](#pre-commit-hooks-setup)
- [Coding Standards](#coding-standards)
- [Testing](#testing)
- [Documentation](#documentation)
Expand Down Expand Up @@ -82,34 +85,68 @@ This project follows a code of conduct to ensure a welcoming environment for all

### Commit Messages

Follow conventional commit format:
We enforce [Conventional Commits](https://www.conventionalcommits.org/) format using pre-commit hooks and CI validation. **All commits in PRs must follow this format or the pipeline will fail.**

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

[optional body]

[optional footer]
```

Types:
**Types:**
- `feat`: New features
- `fix`: Bug fixes
- `docs`: Documentation
- `style`: Code style changes
- `refactor`: Code refactoring
- `test`: Testing
- `chore`: Maintenance

Examples:
- `docs`: Documentation changes
- `style`: Code style changes (formatting, no logic change)
- `refactor`: Code refactoring (no feature/fix)
- `perf`: Performance improvements
- `test`: Adding or updating tests
- `build`: Build system or dependencies
- `ci`: CI/CD configuration
- `chore`: Maintenance tasks
- `revert`: Reverting previous commits

**Examples:**
```
feat(transport): add TCP transport binding

fix(serialization): handle endianness correctly on ARM

test(message): add comprehensive message validation tests

docs: update README with build instructions

chore: update dependencies
```

### Pre-commit Hooks Setup

We use [pre-commit](https://pre-commit.com/) to enforce code quality and commit message format locally:

```bash
# Install pre-commit
pip install pre-commit

# Install hooks (one-time setup)
pre-commit install
pre-commit install --hook-type commit-msg

# Run manually on all files
pre-commit run --all-files
```

**What the hooks check:**
- Trailing whitespace and end-of-file issues
- Valid YAML and JSON files
- No large files added (>500KB)
- No merge conflicts or private keys
- Consistent line endings (LF)
- Commit message follows Conventional Commits format

> **Note:** The CI pipeline will run these same checks on all PRs. Setting up pre-commit locally helps catch issues before pushing.

## Coding Standards

### C++ Standards
Expand Down Expand Up @@ -289,11 +326,13 @@ Result send_message(const Message& message, const Endpoint& destination);

### Before Submitting

1. **Code Review**: Self-review your code
2. **Tests**: Add/update tests for new functionality
3. **Documentation**: Update relevant documentation
4. **Linting**: Ensure code follows style guidelines
5. **Testing**: All tests pass locally
1. **Pre-commit Hooks**: Run `pre-commit run --all-files` to check for issues
2. **Commit Messages**: Ensure all commits follow Conventional Commits format
3. **Code Review**: Self-review your code
4. **Tests**: Add/update tests for new functionality
5. **Documentation**: Update relevant documentation
6. **Linting**: Ensure code follows style guidelines
7. **Testing**: All tests pass locally (`ctest --output-on-failure`)

### Pull Request Template

Expand Down Expand Up @@ -325,11 +364,17 @@ Any additional information or context

### Review Process

1. **Automated Checks**: CI/CD runs tests and linting
1. **Automated Checks**: CI/CD runs:
- Pre-commit hooks (code quality checks)
- Commit message validation (Conventional Commits format)
- Build verification (multiple compilers)
- Test suite execution
2. **Peer Review**: At least one maintainer review
3. **Approval**: Maintainers approve changes
4. **Merge**: Squash merge with descriptive commit message

> **Important:** PRs with invalid commit messages will fail CI and cannot be merged.

## Reporting Issues

### Bug Reports
Expand Down
1 change: 0 additions & 1 deletion docs/SOMEIP_ACCEPTANCE_TEST_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,3 @@ See `TRACEABILITY_MATRIX.md` for full requirement mapping.
---

*This test plan ensures comprehensive validation of the SOME/IP stack implementation against the Open SOME/IP Specification, following industry-standard V-Model methodology.*

5 changes: 2 additions & 3 deletions docs/TEST_PLAN_STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

# SOME/IP Test Plan Implementation Status

**Reference Document**: [SOMEIP_ACCEPTANCE_TEST_PLAN.md](./SOMEIP_ACCEPTANCE_TEST_PLAN.md)
**Last Updated**: 2025-12-14
**Reference Document**: [SOMEIP_ACCEPTANCE_TEST_PLAN.md](./SOMEIP_ACCEPTANCE_TEST_PLAN.md)
**Last Updated**: 2025-12-14
**Overall Progress**: 🟡 ~65% Complete

---
Expand Down Expand Up @@ -374,4 +374,3 @@ grep -c "TEST\|TEST_F" tests/test_*.cpp
---

*This document tracks the implementation status of tests defined in [SOMEIP_ACCEPTANCE_TEST_PLAN.md](./SOMEIP_ACCEPTANCE_TEST_PLAN.md)*

15 changes: 7 additions & 8 deletions docs/diagrams/v_model_test_strategy.puml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ rectangle "**5. Unit Testing**\n(Level 1)" as UT #FFEBEE {
- test_endpoint.cpp
- test_tp.cpp
- test_sd.cpp

**Coverage Target:** ≥95%
**Requirements:**
**Requirements:**
- feat_req_someip_44-103
- feat_req_someip_167-299
- feat_req_someiptp_759-820
Expand All @@ -81,7 +81,7 @@ rectangle "**4. Component Testing**\n(Level 2)" as CT #FCE4EC {
- TP segmentation/reassembly
- RPC client/server
- SD client/server

**Framework:** GTest + pytest
end note
}
Expand All @@ -93,7 +93,7 @@ rectangle "**3. Integration Testing**\n(Level 3)" as IT #F3E5F5 {
- Service Discovery flow
- Event publish/subscribe
- TP with transport

**Location:**
tests/integration/
tests/test_integration.py
Expand All @@ -107,7 +107,7 @@ rectangle "**2. System Testing**\n(Level 4)" as ST #E8EAF6 {
- Behavior conformance
- Robustness testing
- Performance testing

**Location:**
tests/specification_test.py
tests/conformance_test.py
Expand All @@ -122,8 +122,8 @@ rectangle "**1. Acceptance Testing**\n(Level 5)" as AT #E3F2FD {
- Functional completeness
- Quality attributes
- Documentation
**Validation:**

**Validation:**
Cross-stack testing
Wireshark verification
end note
Expand Down Expand Up @@ -165,4 +165,3 @@ endlegend
footer Open SOME/IP Specification v2025 | Test Plan v1.0

@enduml

1 change: 0 additions & 1 deletion examples/cross_platform_demo/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@ EXPOSE 30490/udp 30490/tcp

USER 1000
CMD ["./hello_world_server"]

1 change: 0 additions & 1 deletion examples/cross_platform_demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,3 @@ On native Linux, Docker containers share the host network namespace (when using
./examples/cross_platform_demo/stop_linux_server.sh
docker image rm someip-linux-server:local
```

1 change: 0 additions & 1 deletion examples/cross_platform_demo/run_linux_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ docker run -d --name "${CONTAINER_NAME}" \

echo "Container '${CONTAINER_NAME}' is running. Follow logs with:"
echo " docker logs -f ${CONTAINER_NAME}"

1 change: 0 additions & 1 deletion examples/cross_platform_demo/run_mac_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@ fi
echo "Running hello_world_client against ${SERVER_HOST}:${PORT} ..."
HELLO_SERVER_HOST="${SERVER_HOST}" HELLO_SERVER_PORT="${PORT}" \
"${BUILD_DIR}/bin/hello_world_client" <<<"${MSG}"

1 change: 0 additions & 1 deletion examples/cross_platform_demo/stop_linux_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ CONTAINER_NAME="${CONTAINER_NAME:-someip-server}"
echo "Stopping container '${CONTAINER_NAME}' (if running)..."
docker rm -f "${CONTAINER_NAME}" >/dev/null 2>&1 || true
echo "Done."

6 changes: 2 additions & 4 deletions examples/infra_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ docker network create someip-net

# Run listener container
docker run --rm -it --network someip-net --name listener python:3.11-slim \
python3 -c "..."
python3 -c "..."

# Run sender container
# Run sender container
docker run --rm --network someip-net python:3.11-slim \
python3 -c "..."
```
Expand All @@ -133,5 +133,3 @@ Note: Standard Docker bridge networks don't support multicast. You may need:
- `--network host` (Linux only)
- macvlan network
- Or run both apps in same container


Loading