Commit a74a5502 authored by Giulio Carota's avatar Giulio Carota
Browse files

Merge branch 'main' into feature/add-network-oai

parents 4d0f500a 939c7c21
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
[flake8]
max-line-length = 88
 No newline at end of file
max-line-length = 100
max-complexity = 18
select = B,C,E,F,W,T4,B9
ignore = E203, E266, E501, W503
per-file-ignores =
    __init__.py:F401
exclude =
    .git,
    __pycache__,
    build,
    dist,
    .venv,
    .tox,
    .mypy_cache,
    .pytest_cache
extend-ignore = E203
extend-select = B950
+47 −0
Original line number Diff line number Diff line
name: CI Pipeline

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  # tests:
  #   name: Run tests
  #   runs-on: ubuntu-latest
  #   container:
  #     image: python:3.12-slim

  #   steps:
  #   - name: Checkout code
  #     uses: actions/checkout@v4

  #   - name: Install dependencies
  #     run: pip install -r requirements.txt

  #   - name: Run pytest
  #     run: pytest tests/edgecloud

  lint:
    name: Run linters
    if: github.event_name == 'pull_request'
    runs-on: ubuntu-latest
    container:
      image: python:3.12-slim

    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Install dependencies
      run: pip install -r requirements.txt

    - name: isort check
      run: isort src tests --check --profile black --filter-files

    - name: black check
      run: black src tests --check

    - name: flake8 check
      run: flake8 src tests
+26 −0
Original line number Diff line number Diff line
repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v5.0.0
    hooks:
    -   id: check-added-large-files
    -   id: end-of-file-fixer
    -   id: requirements-txt-fixer
    -   id: trailing-whitespace
-   repo: https://github.com/pycqa/isort
    rev: 6.0.1
    hooks:
    -   id: isort
        name: isort (python)
        args: ["--profile", "black", "--filter-files"]
-   repo: https://github.com/psf/black
    rev: 25.1.0
    hooks:
    -   id: black
        args:
            # - "--check"
            - "--target-version=py310"
-   repo: https://github.com/pycqa/flake8
    rev: 7.2.0
    hooks:
    -   id: flake8
        additional_dependencies: []
+23 −22
Original line number Diff line number Diff line
# OpenSDK - Contribution Guidelines
# OpenSDK

Thank you for contributing to this project! Please follow the guidelines below to ensure a smooth collaboration.
Open source SDK to abstract CAMARA/GSMA Transformation Functions (TFs) for Edge Cloud platforms & 5G network cores

## Branch Naming Convention
Each partner should create a feature branch following the naming convention based on the type of adapter they are contributing:
## Contributing Guidelines
Thank you for contributing to this project. Please follow the guidelines below to ensure a smooth collaboration.

### Directory Structure
Each contribution should be made in the appropriate directory:
- **EdgeCloud Adapters**`src/edgecloud/clients/`
- **Network Adapters**`src/network/clients/`

### Testing (Mandatory)
To merge a feature branch into `main`, the adapter **must pass the unit tests**. Instructions to do so available at [TESTING.md](docs/TESTING.md)

### Contributing
1. **Check Guidelines at [CONTRIBUTING.md](docs/CONTRIBUTING.md).**
2. **Create a New Branch** following the naming convention.
3. **Develop Your Feature** inside the correct directory.
4. **Ensure All Tests Pass**  before the merge.
5. **Submit a Merge Request (MR)** to the `main` branch.

### Branch Naming Convention
Each partner should create a feature branch following the naming convention based on the type of adapter they are contributing:

### ☁️ EdgeCloud Adapters
#### ☁️ EdgeCloud Adapters
Branch Name Format:
```
feature/add-edgecloud-<EDGE_CLOUD_PLATFORM_NAME>
@@ -16,7 +33,7 @@ Example:
feature/add-edgecloud-i2edge
```

### 🌐 Network Adapters
#### 🌐 Network Adapters
Branch Name Format:
```
feature/add-network-<5G_CORE_NAME>
@@ -26,22 +43,6 @@ Example:
feature/add-network-open5gs
```

## Directory Structure
Each contribution should be made in the appropriate directory:
- **EdgeCloud Adapters**`src/edgecloud/clients/`
- **Network Adapters**`src/network/clients/`

## Unit Tests Requirement
To merge a feature branch into `main`, the adapter **must pass the unit tests** under the `/tests` directory. Please use `/tests/edgecloud` for edgecloud, and `/tests/network` for the 5G cores)

## Steps to Contribute
1. **Fork the Repository** (if applicable).
2. **Create a New Branch** following the naming convention.
3. **Develop Your Feature** inside the correct directory.
4. **Write Unit Tests** under `/tests`.
5. **Submit a Merge Request (MR)** to the `main` branch.
6. **Ensure All Tests Pass** before the merge.

## Sequence Diagram Example
Refer to the sequence diagram example from `docs/workflows/edgecloud/get_av_zones.md` for guidance on workflow structure:

docs/CONTRIBUTING.md

0 → 100644
+21 −0
Original line number Diff line number Diff line
# Contributing

To contribute with code, follow the instructions below to enforce automatic syntax formatting and linting.
Configuration is taken from https://www.pre-commit.com/#2-add-a-pre-commit-configuration and from git-hooks.

*Note*: apply commands from the root of the repository.

```bash
# Required: install the pre-commit hooks
pip3 install pre-commit
pre-commit install

# Optional: manual trigger (to know how validation will be applied or to force it manually on files before/after commit)
pre-commit run --all-files

# Optional: to keep the pre-commit versions of validation up-to-date
pre-commit autoupdate

# Optional: to remove the pre-commit git-hook binding
pre-commit uninstall
```
Loading