Skip to content

Commit

Permalink
feat!: reorganize crates (#4970)
Browse files Browse the repository at this point in the history
* feat!: rename `iroha_client_cli` crate to `iroha_cli`, match directory and crate names
* refactor: merge `iroha_wasm_builder` with its CLI, move `iroha_swarm` CLI to `main.rs`
* refactor: move `iroha_executor` and `iroha_trigger` out of `iroha_smart_contract`
* refactor: rename `config` directory to `iroha_config`
* refactor: rename `core` directory to `iroha_core`
* refactor: rename `crypto` directory to `iroha_crypto`
* refactor: rename `data_model` directory to `iroha_data_model`
* refactor: rename `futures` directory to `iroha_futures`
* refactor: rename `logger` directory to `iroha_logger`
* refactor: rename `macro` directory to `iroha_macro`
* refactor: rename `p2p` directory to `iroha_p2p`
* refactor: rename `telemetry` directory to `iroha_telemetry`
* refactor: rename `version` directory to `iroha_version`
* refactor: rename `genesis` directory to `iroha_genesis`
* refactor: rename `ffi` directory to `iroha_ffi`
* refactor: rename `executor` directory to `iroha_executor`
* refactor: rename `trigger` directory to `iroha_trigger`
* refactor: rename `smart_contract` directory to `iroha_smart_contract`
* refactor: rename `primitives` directory to `iroha_primitives`
* refactor: rename `torii` directory to `iroha_torii`
* refactor: rename `schema` directory to `iroha_schema`
* refactor: rename `test_samples` to `iroha_test_samples`
* refactor: rename `wasm_builder` to `iroha_wasm_builder`
* refactor: rename `wasm_codec` to `iroha_wasm_codec`
* refactor: unnest and rename `wasm_test_runner` to `iroha_wasm_test_runner`
* refactor: unnest and rename `kagami` to `iroha_kagami`
* refactor: unnest `kura_inspector`
* refactor: unnest and rename `parity_scale_cli` to `iroha_parity_scale_cli`
* test: ignore test_docker directory
* build: use bin names in dockerfile
* feat: rename `iroha_parity_scale_cli` to `iroha_codec`
* refactor: unnest `iroha_config` satellite crates
* refactor: unnest and rename `test_network` to `iroha_test_network`
* refactor: unnest `iroha_data_model_derive`
* refactor: unnest `iroha_ffi_derive`
* refactor: unnest `iroha_futures_derive`
* refactor: unnest `iroha_executor` satellite crates
* refactor: unnest `iroha_macro` satellite crates
* refactor: unnest `iroha_primitives` satellite crates
* refactor: unnest `iroha_schema` satellite crates
* refactor: unnest `iroha_smart_contract` satellite crates
* refactor: unnest `iroha_telemetry` satellite crates
* refactor: unnest `iroha_torii` satellite crates
* refactor: unnest `iroha_trigger` satellite crates
* refactor: unnest `iroha_version` satellite crates
* refactor: unnest `iroha_wasm_codec_derive`, rename from `iroha_core_wasm_codec_derive`
* refactor: move crates to `crates` directory
* refactor: unnest pytests from crate directories
* refactor: use wildcard in workspace members
---------
Signed-off-by: Nurzhan Sakén <[email protected]>
  • Loading branch information
nxsaken authored Sep 11, 2024
1 parent 83fa265 commit 69643cd
Show file tree
Hide file tree
Showing 655 changed files with 676 additions and 749 deletions.
16 changes: 5 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ updates:

- package-ecosystem: "pip"
target-branch: "main"
directory: "/client_cli/pytests/"
directories:
- /pytests/*
schedule:
interval: "daily"
commit-message:
Expand All @@ -30,16 +31,9 @@ updates:

- package-ecosystem: "cargo"
target-branch: "main"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: chore
include: scope

- package-ecosystem: "cargo"
target-branch: "main"
directory: "/wasm_samples/"
directories:
- /
- /wasm_samples
schedule:
interval: "daily"
commit-message:
Expand Down
4 changes: 2 additions & 2 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ api-changes:
- changed-files:
- any-glob-to-any-file:
- 'docs/source/references/schema.json'
- 'torii/src/**'
- 'torii/const/src/**'
- 'crates/iroha_torii/src/**'
- 'crates/iroha_torii_const/src/**'

config-changes:
- all:
Expand Down
40 changes: 13 additions & 27 deletions .github/workflows/iroha2-dev-pr-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: I2::Dev::Static

on:
pull_request:
branches: [main]
branches: [ main ]
paths:
- '**.rs'
- '**.json'
- '**.toml'
- '.github/workflows/iroha2-dev-pr-static.yml'
- 'client_cli/pytests/**/*.py'
- 'pytests/**.py'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -62,39 +62,25 @@ jobs:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
strategy:
matrix:
suite: [ iroha_cli_tests, iroha_torii_tests ]
steps:
- uses: actions/checkout@v4
- name: Install dependencies using Poetry for client_cli/pytests
working-directory: client_cli/pytests
- name: Install dependencies using Poetry for pytests/${{ matrix.suite }}
working-directory: pytests/${{ matrix.suite }}
run: |
poetry lock --no-update
poetry install
- name: Install dependencies using Poetry for torii/pytests
working-directory: torii/pytests
run: |
poetry lock --no-update
poetry install
- name: Check code formatting with Black in client_cli/pytests
working-directory: client_cli/pytests
run: |
poetry run black --check .
- name: Check code formatting with Black in torii/pytests
working-directory: torii/pytests
- name: Check code formatting with Black in pytests/${{ matrix.suite }}
working-directory: pytests/${{ matrix.suite }}
run: |
poetry run black --check .
- name: Run mypy (Type Checker) in client_cli/pytests
working-directory: client_cli/pytests
- name: Run mypy (Type Checker) in pytests/${{ matrix.suite }}
working-directory: pytests/${{ matrix.suite }}
run: |
poetry run mypy --explicit-package-bases --ignore-missing-imports .
- name: Run mypy (Type Checker) in torii/pytests
working-directory: torii/pytests
run: |
poetry run mypy --explicit-package-bases --ignore-missing-imports .
- name: Run flake8 (Linter) in client_cli/pytests
working-directory: client_cli/pytests
run: |
poetry run flake8 . --max-line-length=110 --ignore=F401,W503,E203
- name: Run flake8 (Linter) in torii/pytests
working-directory: torii/pytests
- name: Run flake8 (Linter) in pytests/${{ matrix.suite }}
working-directory: pytests/${{ matrix.suite }}
run: |
poetry run flake8 . --max-line-length=110 --ignore=F401,W503,E203
30 changes: 20 additions & 10 deletions .github/workflows/iroha2-dev-pr-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ on:
pull_request:
branches: [main]
paths:
- 'data_model/**.rs'
- 'data_model/**.yml'
- 'data_model/**.json'
- 'data_model/**.toml'
- 'crates/iroha_data_model/**.rs'
- 'crates/iroha_data_model/**.yml'
- 'crates/iroha_data_model/**.json'
- 'crates/iroha_data_model/**.toml'

- 'smart_contract/**.rs'
- 'smart_contract/**.yml'
- 'smart_contract/**.json'
- 'smart_contract/**.toml'
- 'crates/iroha_smart_contract/**.rs'
- 'crates/iroha_smart_contract/**.yml'
- 'crates/iroha_smart_contract/**.json'
- 'crates/iroha_smart_contract/**.toml'

- 'crates/iroha_executor/**.rs'
- 'crates/iroha_executor/**.yml'
- 'crates/iroha_executor/**.json'
- 'crates/iroha_executor/**.toml'

- 'crates/iroha_trigger/**.rs'
- 'crates/iroha_trigger/**.yml'
- 'crates/iroha_trigger/**.json'
- 'crates/iroha_trigger/**.toml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -54,7 +64,7 @@ jobs:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Install iroha_wasm_test_runner
run: cargo install --path tools/wasm_test_runner
run: cargo install --path crates/iroha_wasm_test_runner
- name: Run smart contract tests on WebAssembly VM
working-directory: smart_contract
working-directory: crates/iroha_smart_contract
run: mold --run cargo test -p iroha_smart_contract -p iroha_smart_contract_utils --release --tests --target wasm32-unknown-unknown --no-fail-fast --quiet
28 changes: 16 additions & 12 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ concurrency:

env:
CARGO_TERM_COLOR: always
CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"
IROHA_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"
DOCKER_COMPOSE_PATH: defaults
TEST_DIR: "tmp/test"
IROHA_BIN: "iroha"
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
path: ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
retention-days: 1

# exclude: client/tests/integration/
# exclude: iroha/tests/integration/
with_coverage:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
Expand All @@ -83,16 +83,16 @@ jobs:
LLVM_PROFILE_FILE: "iroha-%p-%m.profraw"
- name: Generate lcov report
if: always()
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/client_cli" --ignore "**/main.rs" -o lcov.info
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "crates/iroha_cli" --ignore "**/main.rs" -o lcov.info
- name: Upload lcov report artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: lcov.info
path: lcov.info

# include: client/tests/integration/
# exclude: client/tests/integration/extra_functional
# include: iroha/tests/integration/
# exclude: iroha/tests/integration/extra_functional
integration:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
Expand All @@ -110,7 +110,7 @@ jobs:
- name: Run tests, with no-default-features
run: mold --run cargo test --no-default-features --no-fail-fast -p iroha integration -- --skip extra_functional

# include: client/tests/integration/extra_functional
# include: iroha/tests/integration/extra_functional
extra_functional:
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
Expand Down Expand Up @@ -230,18 +230,21 @@ jobs:
docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.local.yml down
- name: Run docker-compose.yml containers
run: docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml up --wait || exit 1

- name: Install Python and Poetry
run: |
yum install -y python${{ env.PYTHON_VERSION }} python${{ env.PYTHON_VERSION }}-devel
curl -sSL https://install.python-poetry.org | python3 -
echo 'export PATH="${{ env.POETRY_PATH }}:$PATH"' >> /etc/profile
source /etc/profile
- name: Install Torii API Dependencies
working-directory: torii/pytests
working-directory: pytests/iroha_torii_tests
run: ${{ env.POETRY_PATH }} install
- name: Run Torii API Tests
working-directory: torii/pytests
working-directory: pytests/iroha_torii_tests
run: ${{ env.POETRY_PATH }} run pytest

- name: Copy Client CLI Binary from Iroha Container
if: always()
run: |
Expand All @@ -251,14 +254,15 @@ jobs:
- name: Make Binaries Executable
run: chmod +x ${{ env.TEST_DIR }}/${{ env.IROHA_BIN }}
- name: Install Client CLI Dependencies
working-directory: client_cli/pytests
working-directory: pytests/iroha_cli_tests
run: ${{ env.POETRY_PATH }} install
- name: Run Client CLI Tests
working-directory: client_cli/pytests
working-directory: pytests/iroha_cli_tests
env:
CLIENT_CLI_BINARY: ../../${{ env.TEST_DIR }}/${{ env.IROHA_BIN }}
CLIENT_CLI_CONFIG: ../../${{ env.TEST_DIR }}/client.toml
IROHA_CLI_BINARY: ../../${{ env.TEST_DIR }}/${{ env.IROHA_BIN }}
IROHA_CLI_CONFIG: ../../${{ env.TEST_DIR }}/client.toml
run: ${{ env.POETRY_PATH }} run pytest

- name: Wipe docker-compose.yml containers
if: always()
run: docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml down
3 changes: 2 additions & 1 deletion .github/workflows/iroha2-pr-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
pull_request:
branches: [main, stable, lts]
paths:
- '**/derive/**.rs'
- 'crates/*_derive/**.rs'
- 'crates/*_macro*/**.rs'
- '**/tests/ui.rs'
- '**/tests/ui_*/**'
- 'rust-toolchain.toml'
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
**/rusty-tags.vi
/**/Cargo.lock

config/__pycaсhe__
crates/iroha_config/__pycaсhe__
**/__pycache__/*
__pycache__/*
build/*
Expand Down Expand Up @@ -32,7 +32,7 @@ CMakeFiles/*
cmake-build-debu/*
cmake-build-debug/*
external/*
core/infra/protobuf
crates/iroha_core/infra/protobuf
include/generated/*
.obsidian/
.scannerwork/
Expand All @@ -50,5 +50,5 @@ result
/iroha-java/
/lcov.info
**/test-smartcontracts/

test_docker
**/*.wasm
Loading

0 comments on commit 69643cd

Please sign in to comment.