Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing ROS2 messages into Capella model #3

Merged
merged 47 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2b62414
feat: Convert ROS Messages to Capella package
huyenngn Oct 27, 2023
e10fac1
feat: Implement CLI
huyenngn Oct 31, 2023
bbb16ea
fix: Create basic type if type not found
huyenngn Nov 10, 2023
03d9527
fix: Implement overwrite overlap
huyenngn Nov 10, 2023
67bd277
feat: Capella model to .msg files
huyenngn Nov 13, 2023
896bac7
refactor: Rename to capella-ros-tools
huyenngn Nov 15, 2023
6ab8cf7
docs: Add examples
huyenngn Nov 17, 2023
02a5cc9
chore: Update toml file
freshavocado7 Nov 30, 2023
861dc4d
feat: Import from git
huyenngn Dec 15, 2023
2b122bd
fix: Eliminate duplicates
huyenngn Dec 21, 2023
bf68a03
feat: Convert capella to messages
huyenngn Dec 21, 2023
09fa50e
feat: Make tree view draggable
huyenngn Jan 9, 2024
0ae37a6
fix: Local path input
huyenngn Jan 9, 2024
42678da
feat: Export Capella
huyenngn Jan 9, 2024
fc005b8
docs: Install pandoc github action
huyenngn Jan 10, 2024
eded719
refactor: Rework CLI and adjust docs
huyenngn Jan 16, 2024
26093fd
docs: Update Message Layout docs
huyenngn Jan 17, 2024
65e6a6a
fix: Apply suggestions from code review
huyenngn Feb 15, 2024
3b1ac00
docs: Add instructions for downloading model viewer
huyenngn Feb 17, 2024
69ce305
test: Add capella and messages tests
huyenngn Feb 21, 2024
a82fbb8
fix: Apply suggestions from code review
huyenngn Feb 22, 2024
f62e33b
fix: Rewrite import to utilize decl
huyenngn Mar 6, 2024
cad6dc6
docs: Add type annotations to tests
huyenngn Mar 6, 2024
8214ada
docs: Fixed docs to reflect current implementation
huyenngn Mar 6, 2024
be6b070
fix: Accumulate comment lines
huyenngn Mar 7, 2024
f4c6ae3
docs: Update docs regarding comments
huyenngn Mar 7, 2024
ba2f429
fix: Use nested sync
huyenngn Mar 11, 2024
9179d6e
fix: Add kind to props
huyenngn Mar 12, 2024
18b6648
fix: Add association for every composition
huyenngn Mar 13, 2024
20e17ee
fix: Fix duplicate promise ids issue
huyenngn Mar 15, 2024
5f1988b
fix: Raise error when attempting to create duplicate element
huyenngn Mar 15, 2024
9958953
feat: Ignore license header in .msg files
huyenngn Mar 17, 2024
8e630cc
fix: Parse upper bounds
huyenngn Mar 17, 2024
be01be5
fix: Sync associations
huyenngn Mar 19, 2024
1865020
fix: Fix test package
huyenngn Mar 25, 2024
88854ab
refactor: Add type hints to tests
huyenngn Mar 25, 2024
564f750
ci: Please pre-commit hooks
huyenngn Mar 25, 2024
7a4a6af
feat: Add option to specify import package
huyenngn Mar 26, 2024
3d60eec
fix: Sync class properties
huyenngn Apr 2, 2024
5d669be
docs: Add examples to README
huyenngn Apr 15, 2024
61bf653
fix: Sync enum literals
huyenngn Apr 16, 2024
59ebd74
fix: Adapt tests to new fixes
huyenngn Apr 24, 2024
b1e4ca1
docs: Adapt docs to new fixes
huyenngn Apr 26, 2024
36395cd
fix: Apply suggestions from review
huyenngn May 13, 2024
172935e
docs: Add consistent quoting
huyenngn May 21, 2024
cfc44f9
docs: Add GIF to README
huyenngn May 21, 2024
be8b3b4
fix: Deterministic order of packages and messages
ewuerger May 22, 2024
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
17 changes: 17 additions & 0 deletions .commitlintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0
rules:
body-leading-blank: [2, always]
footer-leading-blank: [2, always]
scope-case: [2, always, lower-case]
subject-case: [2, always, sentence-case]
subject-empty: [2, never]
subject-full-stop: [2, never, .]
subject-max-length: [2, always, 72]
type-empty: [2, never]
type-enum:
[
2,
always,
[build, chore, ci, docs, feat, fix, merge, perf, refactor, revert, test],
]
2 changes: 1 addition & 1 deletion .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright DB Netz AG and contributors
Copyright DB InfraGO AG and contributors
SPDX-License-Identifier: CC0-1.0

node: $Format:%H$
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

* text=auto
Expand Down
133 changes: 66 additions & 67 deletions .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,74 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

name: Build

on:
push:
branches: ["*"]
pull_request: [master]
tags: ["v*.*.*"]
push:
branches: ["*"]
pull_request: [master]
tags: ["v*.*.*"]

jobs:
test:
name: Test with Python ${{matrix.python_version}} on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python_version:
- "3.10"
include:
- os: windows-latest
python_version: "3.10"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.python_version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python_version}}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{runner.os}}-pip-${{hashFiles('pyproject.toml')}}
restore-keys: |
${{runner.os}}-pip-
${{runner.os}}-
- name: Upgrade Pip
run: |-
python -m pip install -U pip
- name: Install test dependencies
run: |-
python -m pip install '.[test]'
- name: Run unit tests
run: |-
python -m pytest --cov-report=term --cov=rosidl2capella --rootdir=.
test:
name: Test with Python ${{matrix.python_version}} on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python_version:
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.python_version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python_version}}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{runner.os}}-pip-${{hashFiles('pyproject.toml')}}
restore-keys: |
${{runner.os}}-pip-
${{runner.os}}-
- name: Upgrade Pip
run: |-
python -m pip install -U pip
- name: Install test dependencies
run: |-
python -m pip install '.[test]'
- name: Run unit tests
run: |-
python -m pytest --cov-report=term --cov=capella_ros_tools --rootdir=.

publish:
name: Publish artifacts
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |-
python -m pip install -U pip
python -m pip install build twine
- name: Build packages
run: |-
python -m build
- name: Verify packages
run: |-
python -m twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: 'dist/*'
- name: Publish to PyPI (release only)
if: startsWith(github.ref, 'refs/tags/v')
run: python -m twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --non-interactive dist/*
publish:
name: Publish artifacts
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |-
python -m pip install -U pip
python -m pip install build twine
- name: Build packages
run: |-
python -m build
- name: Verify packages
run: |-
python -m twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: "dist/*"
- name: Publish to PyPI (release only)
if: startsWith(github.ref, 'refs/tags/v')
run: python -m twine upload -u __token__ -p ${{ secrets.PYPI_TOKEN }} --non-interactive dist/*
57 changes: 57 additions & 0 deletions .github/workflows/commit-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# SPDX-FileCopyrightText: Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

name: Conventional Commits

on:
pull_request:
branches: [master]

jobs:
conventional-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install commitlint
run: npm install -g @commitlint/cli
- name: Validate commit messages
id: conventional-commits
env:
SHA_FROM: ${{ github.event.pull_request.base.sha }}
SHA_TO: ${{ github.event.pull_request.head.sha }}
run: |
delim="_EOF_$(uuidgen)"
echo "validation-result<<$delim" >> "$GITHUB_OUTPUT"
r=0
commitlint --from "$SHA_FROM" --to "$SHA_TO" >> "$GITHUB_OUTPUT" 2>&1 || r=$?
echo "$delim" >> "$GITHUB_OUTPUT"
exit $r
- name: Post comment if validation failed
if: always() && steps.conventional-commits.outcome == 'failure'
uses: actions/github-script@v6
env:
TEXT: |-
The pull request does not conform to the conventional commit specification. Please ensure that your commit messages follow the spec: <https://www.conventionalcommits.org/>.
We also strongly recommend that you set up your development environment with pre-commit, as described in our [CONTRIBUTING guidelines](https://github.com/DSD-DBS/capella-ros-tools/blob/master/CONTRIBUTING.md). This will run all the important checks right before you commit your changes, and avoids lengthy CI wait time and round trips.

This is the commit validation log:
```
${{ steps.conventional-commits.outputs.validation-result }}
```

Here are some examples of valid commit messages:
```
build: Bump dependency versions
docs(user): Add model creation workflow
feat: Add a monitoring dashboard
```
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: process.env.TEXT
})
66 changes: 34 additions & 32 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

name: Docs

on:
push:
branches: ["master"]
workflow_dispatch:
push:
branches: [master]

jobs:
sphinx:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Upgrade pip
run: |
python -m pip install -U pip
- name: Install dependencies
run: |
python -m pip install '.[docs]'
- name: Auto-generate APIDOC sources
run: |-
sphinx-apidoc --output-dir docs/source/code --force .
- name: Create docs
run: |
make -C docs html
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
force_orphan: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
sphinx:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
cache: pip
cache-dependency-path: pyproject.toml
python-version: "3.12"
- name: Upgrade pip
run: python -m pip install -U pip
- name: Install dependencies
run: |
sudo apt-get install -y pandoc
python -m pip install '.[docs]'
- name: Auto-generate APIDOC sources
run: make -C docs apidoc
- name: Create docs
run: make -C docs html
- name: Deploy
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
force_orphan: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/html
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

name: Lint
Expand Down Expand Up @@ -39,4 +39,4 @@ jobs:
python -m pip install pylint
- name: Run pylint
run: |-
pylint -dfixme rosidl2capella || exit $(($? & ~24))
pylint -dfixme capella_ros_tools || exit $(($? & ~24))
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright DB Netz AG and contributors
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: CC0-1.0

# Byte-compiled / optimized / DLL files
Expand Down
Loading
Loading