diff --git a/.dx/README.adoc b/.dx/README.adoc new file mode 100644 index 00000000..6adc2d2a --- /dev/null +++ b/.dx/README.adoc @@ -0,0 +1,23 @@ += Окружения + +== Эксплуатация (opsenv) + +shannon:: Клод Шеннон +lamport:: Лесли Лампорт + +== Разработка (devenv) + +church:: Алонзо Чёрч +turing:: Алан Тьюринг + +== В запасе + +brouwer:: Бертус Брауэр +godel:: Курт Гёдель +gentzen:: Герхард Генцен +girard:: Рене Жирар +milner:: Робин Мильнер +martin-lof:: Пер Мартин-Лёф +honda:: Кохэй Хонда +voevodsky:: Владимир Воеводский +nakamoto:: Сатоши Накомото diff --git a/.dx/binaries.yml b/.dx/binaries.yml index 59837e37..429ba542 100644 --- a/.dx/binaries.yml +++ b/.dx/binaries.yml @@ -81,4 +81,4 @@ chdir: "{{ playbook_dir }}/.." strip_empty_ends: false changed_when: true - when: focus == 'pipeline' + when: focus != 'solution' diff --git a/.dx/codebase.yml b/.dx/codebase.yml index a85f2963..0af17254 100644 --- a/.dx/codebase.yml +++ b/.dx/codebase.yml @@ -11,7 +11,7 @@ --batch-mode {% if focus == 'solution' %} --projects apps/sepuling - {% elif focus == 'pipeline' %} + {% elif focus == 'toolchain' %} --projects tests/e2e {% endif %} --also-make @@ -30,6 +30,7 @@ # list all top level playbooks cmd: > ansible-lint + toolchain.yaml codebase.yml stacks.yml strip_empty_ends: false diff --git a/.environs/amber/.env b/.dx/envs/dev/church/.env similarity index 100% rename from .environs/amber/.env rename to .dx/envs/dev/church/.env diff --git a/.environs/amber/requirements.txt b/.dx/envs/dev/church/requirements.txt similarity index 100% rename from .environs/amber/requirements.txt rename to .dx/envs/dev/church/requirements.txt diff --git a/.dx/envs/dev/church/vars.yaml b/.dx/envs/dev/church/vars.yaml new file mode 100644 index 00000000..cd61aa8a --- /dev/null +++ b/.dx/envs/dev/church/vars.yaml @@ -0,0 +1,8 @@ +--- +maven_version: + min: 3.8.0 + max: 3.10.0 + +docker_version: + min: 24.0.0 + max: 25.0.0 diff --git a/.environs/green/.env b/.dx/envs/dev/turing/.env similarity index 100% rename from .environs/green/.env rename to .dx/envs/dev/turing/.env diff --git a/.environs/green/requirements.txt b/.dx/envs/dev/turing/requirements.txt similarity index 100% rename from .environs/green/requirements.txt rename to .dx/envs/dev/turing/requirements.txt diff --git a/.dx/envs/dev/turing/vars.yaml b/.dx/envs/dev/turing/vars.yaml new file mode 100644 index 00000000..cd61aa8a --- /dev/null +++ b/.dx/envs/dev/turing/vars.yaml @@ -0,0 +1,8 @@ +--- +maven_version: + min: 3.8.0 + max: 3.10.0 + +docker_version: + min: 24.0.0 + max: 25.0.0 diff --git a/.dx/envs/ops/lamport.yaml b/.dx/envs/ops/lamport.yaml new file mode 100644 index 00000000..8d1fd575 --- /dev/null +++ b/.dx/envs/ops/lamport.yaml @@ -0,0 +1,6 @@ +--- +postgres_version: 16.0 +config_mapping_mode: spring_config +config_file_name: + source: lamport.yaml + target: application.yaml diff --git a/.dx/envs/ops/shannon.yaml b/.dx/envs/ops/shannon.yaml new file mode 100644 index 00000000..2d242b85 --- /dev/null +++ b/.dx/envs/ops/shannon.yaml @@ -0,0 +1,6 @@ +--- +postgres_version: 15.4 +config_mapping_mode: lightbend_config +config_file_name: + source: shannon.conf + target: application.conf diff --git a/.dx/group_vars/all.yml b/.dx/group_vars/all.yml index b512f4df..2edd0ca3 100644 --- a/.dx/group_vars/all.yml +++ b/.dx/group_vars/all.yml @@ -2,8 +2,10 @@ organization: smecalculus project: bezmen +opsenv: lamport +devenv: turing + usage: toy -prefs: turing lib_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=libs')[:7] }}" lib_cids: @@ -20,20 +22,14 @@ schema_cids: postgres: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=schemas/postgres')[:7] }}" solution_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=solutions')[:7] }}" -lib_version: 0.1.0-{{ lib_cid }} -app_version: 0.1.0-{{ app_cid }} - test_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=tests')[:7] }}" -environ: green - dx_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.dx')[:7] }}" tool_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=tools')[:7] }}" -environ_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.environs/' ~ environ)[:7] }}" pipeline_cid: "{{ lookup('ansible.builtin.pipe', 'git write-tree --prefix=.github')[:7] }}" # solution - focus on solution changes -# pipeline - focus on pipeline changes +# toolchain - focus on toolchain changes # null - without any particular focus focus: null @@ -45,8 +41,8 @@ app_images: schema_images: postgres: "{{ image_repo }}/{{ organization }}/{{ project }}/schema/postgres" stack_images: - solution: "{{ image_repo }}/{{ organization }}/{{ project }}/stack/solution-{{ usage }}-{{ prefs }}" - pipeline: "{{ image_repo }}/{{ organization }}/{{ project }}/stack/pipeline-{{ environ }}" + solution: "{{ image_repo }}/{{ organization }}/{{ project }}/stack/solution-{{ usage }}-{{ opsenv }}" + toolchain: "{{ image_repo }}/{{ organization }}/{{ project }}/stack/toolchain-{{ devenv }}" docker_entity: "{{ 'image' if image_repo == 'local' else 'manifest' }}" diff --git a/.dx/inventory/aliases.yml b/.dx/inventory/aliases.yml index 248d598d..8ee70fba 100644 --- a/.dx/inventory/aliases.yml +++ b/.dx/inventory/aliases.yml @@ -16,6 +16,6 @@ codebase: stack: hosts: solution: - pipeline: + toolchain: vars: ansible_connection: local diff --git a/.dx/stacks.yml b/.dx/stacks.yml index 57db5138..480287c6 100644 --- a/.dx/stacks.yml +++ b/.dx/stacks.yml @@ -11,11 +11,11 @@ tags: [always] - name: Capturing - hosts: pipeline + hosts: toolchain run_once: true tasks: - ansible.builtin.import_tasks: # noqa: name[missing] - file: tasks/pipeline/status.yml + file: tasks/toolchain/status.yml tags: [always] - name: Testing @@ -27,13 +27,13 @@ tags: [build] when: > hostvars.solution.stack_status is changed or - hostvars.pipeline.stack_status is changed + hostvars.toolchain.stack_status is changed - ansible.builtin.import_tasks: # noqa: name[missing] file: tasks/solution/test.yml tags: [test] when: > hostvars.solution.stack_status is changed or - hostvars.pipeline.stack_status is changed + hostvars.toolchain.stack_status is changed - name: Packaging hosts: solution @@ -45,10 +45,10 @@ when: stack_status is changed - name: Packaging - hosts: pipeline + hosts: toolchain run_once: true tasks: - ansible.builtin.import_tasks: # noqa: name[missing] - file: tasks/pipeline/package.yml + file: tasks/toolchain/package.yml tags: [package] when: stack_status is changed diff --git a/.dx/tasks/solution/build.yml b/.dx/tasks/solution/build.yml index 7228e29e..1cc1ae41 100644 --- a/.dx/tasks/solution/build.yml +++ b/.dx/tasks/solution/build.yml @@ -10,42 +10,37 @@ state: directory recurse: true +- name: Capture env + ansible.builtin.include_vars: + file: envs/ops/{{ opsenv }}.yaml + name: ops + +- name: Build conf + ansible.builtin.command: + cmd: > + cp props/{{ ops.config_file_name.source }} + target/context/{{ ops.config_file_name.target }} + chdir: "{{ playbook_dir }}/../solutions" + changed_when: true + - name: Build spec - vars: - config_files: - turing: application.yaml - church: application.conf - config_mapping_modes: - turing: spring_config - church: lightbend_config ansible.builtin.command: cmd: > docker compose --file usages/basis.yml --file usages/{{ usage }}.yml - --profile {{ prefs }} + --profile {{ opsenv }} config --output target/context/compose.yml --no-path-resolution strip_empty_ends: false chdir: "{{ playbook_dir }}/../solutions" environment: + POSTGRES_VERSION: "{{ ops.postgres_version }}" SCHEMA_TAG: "{{ schema_cids.postgres }}" SCHEMA_IMAGE: "{{ schema_images.postgres }}" SEPULING_TAG: "{{ hostvars.app.image_cids.sepuling[:7] }}" SEPULING_IMAGE: "{{ app_images.sepuling }}" - CONFIG_FILE_NAME: "{{ config_files[prefs] }}" - CONFIG_MAPPING_MODE: "{{ config_mapping_modes[prefs] }}" - changed_when: true - -- name: Build conf - vars: - config_extensions: - turing: yaml - church: conf - ansible.builtin.command: - cmd: > - cp prefs/{{ prefs }}.{{ config_extensions[prefs] }} - target/context/application.{{ config_extensions[prefs] }} - chdir: "{{ playbook_dir }}/../solutions" + CONFIG_FILE_NAME: "{{ ops.config_file_name.target }}" + CONFIG_MAPPING_MODE: "{{ ops.config_mapping_mode }}" changed_when: true diff --git a/.dx/tasks/solution/test.yml b/.dx/tasks/solution/test.yml index 47f3d8cf..af70699f 100644 --- a/.dx/tasks/solution/test.yml +++ b/.dx/tasks/solution/test.yml @@ -1,5 +1,4 @@ --- -# todo: think about backward compatibility aspect - name: Remove stand (or part of it) ansible.builtin.command: cmd: docker rm -f env-db @@ -11,7 +10,7 @@ cmd: > docker compose --file compose.yml - --profile {{ prefs }} + --profile {{ opsenv }} up --remove-orphans --quiet-pull @@ -27,13 +26,13 @@ mvn --no-snapshot-updates --batch-mode - --threads 1C + --threads 2 --projects tests/e2e --activate-profiles {{ usage }} --also-make clean test - --define prefs={{ prefs }} + --define props={{ opsenv }} {% if reminder is defined %} --define bezmen.sharding.reminder={{ reminder }} {% endif %} diff --git a/.dx/tasks/pipeline/package.yml b/.dx/tasks/toolchain/package.yml similarity index 68% rename from .dx/tasks/pipeline/package.yml rename to .dx/tasks/toolchain/package.yml index 1df292b0..0343e9b0 100644 --- a/.dx/tasks/pipeline/package.yml +++ b/.dx/tasks/toolchain/package.yml @@ -3,7 +3,7 @@ name: image vars: image_tag: "{{ stack_cid.stdout[:7] }}" - image_name: "{{ stack_images.pipeline }}" + image_name: "{{ stack_images.toolchain }}" image_home: "{{ playbook_dir }}/../.github" image_context: . - image_push: "{{ focus == 'pipeline' }}" + image_push: "{{ focus != 'solution' }}" diff --git a/.dx/tasks/pipeline/status.yml b/.dx/tasks/toolchain/status.yml similarity index 79% rename from .dx/tasks/pipeline/status.yml rename to .dx/tasks/toolchain/status.yml index e75a2ac8..350c0037 100644 --- a/.dx/tasks/pipeline/status.yml +++ b/.dx/tasks/toolchain/status.yml @@ -5,14 +5,13 @@ stdin: | {{ dx_cid }} {{ tool_cid }} - {{ environ_cid }} {{ test_cid }} register: stack_cid changed_when: false - name: Capture status ansible.builtin.command: - cmd: docker {{ docker_entity }} inspect {{ stack_images.pipeline }}:{{ stack_cid.stdout[:7] }} + cmd: docker {{ docker_entity }} inspect {{ stack_images.toolchain }}:{{ stack_cid.stdout[:7] }} register: stack_status changed_when: - stack_status.rc != 0 diff --git a/.dx/toolchain.yaml b/.dx/toolchain.yaml new file mode 100644 index 00000000..ca379330 --- /dev/null +++ b/.dx/toolchain.yaml @@ -0,0 +1,34 @@ +--- +- name: Toolchain + hosts: toolchain + tasks: + - name: Capture dev env + ansible.builtin.include_vars: + file: envs/dev/{{ devenv }}/vars.yaml + name: dev + + - name: Capture maven version + ansible.builtin.command: + cmd: mvn --version --quiet + register: maven_version + changed_when: false + - name: Check maven version + ansible.builtin.assert: + quiet: true + that: + - maven_version.stdout is version(dev.maven_version.min, '>=', version_type='semver') + - maven_version.stdout is version(dev.maven_version.max, '<', version_type='semver') + msg: "{{ dev.maven_version.min }} <= maven < {{ dev.maven_version.max }}" + + - name: Capture docker version + ansible.builtin.command: + cmd: docker version --format {{'{{.Server.Version}}'}} + register: docker_version + changed_when: false + - name: Check docker version + ansible.builtin.assert: + quiet: true + that: + - docker_version.stdout is version(dev.docker_version.min, '>=', version_type='semver') + - docker_version.stdout is version(dev.docker_version.max, '<', version_type='semver') + msg: "{{ dev.docker_version.min }} <= docker < {{ dev.docker_version.max }}" diff --git a/.github/actions/prepare/action.yml b/.github/actions/prepare/action.yml index 5d08fbca..8f42e586 100644 --- a/.github/actions/prepare/action.yml +++ b/.github/actions/prepare/action.yml @@ -1,11 +1,11 @@ --- name: Prepare tools -description: Tools preparation action for specific environment +description: Tools preparation for specific environment inputs: name: - description: Environment name + description: Env name required: true - default: green + default: turing tools: description: Tools to prepare required: true @@ -18,7 +18,7 @@ runs: - id: dotenv uses: falti/dotenv-action@v1.0.4 with: - path: .environs/${{ inputs.name }}/.env + path: .dx/envs/dev/${{ inputs.name }}/.env - uses: actions/setup-python@v4.7.0 if: ${{ contains(inputs.tools, 'python') }} with: @@ -26,13 +26,16 @@ runs: cache: 'pip' - shell: bash if: ${{ contains(inputs.tools, 'python') }} - run: pip install -r .environs/${{ inputs.name }}/requirements.txt + run: pip install -r .dx/envs/dev/${{ inputs.name }}/requirements.txt - uses: actions/setup-java@v3.12.0 if: ${{ contains(inputs.tools, 'java') }} with: distribution: 'temurin' java-version: ${{ steps.dotenv.outputs.java_version }} cache: 'maven' + - shell: bash + run: ansible-playbook toolchain.yaml + working-directory: .dx - uses: docker/login-action@v2.2.0 if: ${{ contains(inputs.tools, 'docker') }} with: diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3636331f..aa53f904 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -23,11 +23,11 @@ updates: schedule: interval: "weekly" - package-ecosystem: "pip" - directory: "/.environs/green" + directory: "/.dx/envs/dev/turing" schedule: interval: "weekly" - package-ecosystem: "pip" - directory: "/.environs/amber" + directory: "/.dx/envs/dev/church" schedule: interval: "weekly" ignore: diff --git a/.github/workflows/solution-beyond-doubt.yml b/.github/workflows/solution-beyond-doubt.yml index 2cb40549..9bab5e4e 100644 --- a/.github/workflows/solution-beyond-doubt.yml +++ b/.github/workflows/solution-beyond-doubt.yml @@ -65,7 +65,7 @@ jobs: fail-fast: false matrix: usage: [func] - prefs: [turing, church] + opsenv: [shannon, lamport] runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4.1.0 @@ -77,11 +77,11 @@ jobs: ansible-playbook stacks.yml -t build -e image_repo=${{ env.IMAGE_REPO }} -e usage=${{ matrix.usage }} - -e prefs=${{ matrix.prefs }} + -e props=${{ matrix.opsenv }} working-directory: .dx - uses: actions/upload-artifact@v3.1.3 with: - name: solution-${{ matrix.usage }}-${{ matrix.prefs }} + name: solution-${{ matrix.usage }}-${{ matrix.opsenv }} path: solutions/target/context if-no-files-found: ignore @@ -93,7 +93,7 @@ jobs: fail-fast: false matrix: usage: [func] - prefs: [turing, church] + opsenv: [shannon, lamport] shard: [0, 1] runs-on: ubuntu-22.04 steps: @@ -105,13 +105,13 @@ jobs: - uses: actions/download-artifact@v3.0.2 continue-on-error: true # it's ok because stack building can be skipped with: - name: solution-${{ matrix.usage }}-${{ matrix.prefs }} + name: solution-${{ matrix.usage }}-${{ matrix.opsenv }} path: solutions/target/context - run: > ansible-playbook stacks.yml -t test -e image_repo=${{ env.IMAGE_REPO }} -e usage=${{ matrix.usage }} - -e prefs=${{ matrix.prefs }} + -e props=${{ matrix.opsenv }} -e reminder=${{ matrix.shard }} -e modulus=2 working-directory: .dx @@ -121,7 +121,7 @@ jobs: - uses: actions/upload-artifact@v3.1.3 if: ${{ !cancelled() }} with: - name: e2e-test-report-${{ matrix.usage }}-${{ matrix.prefs }}-${{ matrix.shard }} + name: e2e-test-report-${{ matrix.usage }}-${{ matrix.opsenv }}-${{ matrix.shard }} path: tests/e2e/target/surefire-reports/*.xml if-no-files-found: ignore @@ -133,7 +133,7 @@ jobs: fail-fast: false matrix: usage: [func] - prefs: [turing, church] + opsenv: [shannon, lamport] runs-on: ubuntu-22.04 permissions: packages: write @@ -146,14 +146,14 @@ jobs: - uses: actions/download-artifact@v3.0.2 continue-on-error: true # it's ok because stack building can be skipped with: - name: solution-${{ matrix.usage }}-${{ matrix.prefs }} + name: solution-${{ matrix.usage }}-${{ matrix.opsenv }} path: solutions/target/context - run: > ansible-playbook stacks.yml -t package -e image_repo=${{ env.IMAGE_REPO }} -e focus=solution -e usage=${{ matrix.usage }} - -e prefs=${{ matrix.prefs }} + -e props=${{ matrix.opsenv }} working-directory: .dx stack-reporting: diff --git a/.github/workflows/solution-sanity.yml b/.github/workflows/solution-sanity.yml index b48e2550..f2d5c746 100644 --- a/.github/workflows/solution-sanity.yml +++ b/.github/workflows/solution-sanity.yml @@ -25,6 +25,7 @@ jobs: - uses: ./.github/actions/prepare with: tools: python java + token: ${{ secrets.GITHUB_TOKEN }} - run: ansible-playbook codebase.yml -e focus=solution working-directory: .dx env: diff --git a/.github/workflows/pipeline-beyond-doubt.yml b/.github/workflows/toolchain-beyond-doubt.yml similarity index 69% rename from .github/workflows/pipeline-beyond-doubt.yml rename to .github/workflows/toolchain-beyond-doubt.yml index 1b71585b..472cd8d3 100644 --- a/.github/workflows/pipeline-beyond-doubt.yml +++ b/.github/workflows/toolchain-beyond-doubt.yml @@ -1,5 +1,5 @@ --- -name: Pipeline beyond doubt +name: Toolchain beyond doubt on: pull_request: @@ -9,27 +9,27 @@ on: jobs: everything: - name: Everything in ${{ matrix.environ.name }} environ + name: Everything in ${{ matrix.devenv.name }} env timeout-minutes: 10 strategy: fail-fast: false matrix: - environ: - - name: green + devenv: + - name: turing os: ubuntu-22.04 - - name: amber + - name: church os: ubuntu-20.04 - runs-on: ${{ matrix.environ.os }} + runs-on: ${{ matrix.devenv.os }} permissions: packages: write steps: - uses: actions/checkout@v4.1.0 - uses: ./.github/actions/prepare with: - name: ${{ matrix.environ.name }} + name: ${{ matrix.devenv.name }} tools: python java docker token: ${{ secrets.GITHUB_TOKEN }} - - run: ansible-playbook codebase.yml -e focus=pipeline + - run: ansible-playbook codebase.yml -e focus=toolchain working-directory: .dx env: GITHUB_ACTOR: ${{ github.actor }} @@ -38,8 +38,8 @@ jobs: ansible-playbook stacks.yml -e binary_repo=maven.pkg.github.com -e image_repo=ghcr.io - -e environ=${{ matrix.environ.name }} - -e focus=pipeline + -e devenv=${{ matrix.devenv.name }} + -e focus=toolchain working-directory: .dx env: GITHUB_ACTOR: ${{ github.actor }} diff --git a/.github/workflows/pipeline-sanity.yml b/.github/workflows/toolchain-sanity.yml similarity index 67% rename from .github/workflows/pipeline-sanity.yml rename to .github/workflows/toolchain-sanity.yml index 2dd721f4..ef5bce69 100644 --- a/.github/workflows/pipeline-sanity.yml +++ b/.github/workflows/toolchain-sanity.yml @@ -1,5 +1,5 @@ --- -name: Pipeline sanity +name: Toolchain sanity on: pull_request: @@ -7,30 +7,30 @@ on: - main paths: # waiting for https://github.com/actions/runner/issues/2324 - .dx/** - - .environs/** - .github/** - tools/** workflow_dispatch: jobs: up-to-binaries: - name: Up to binaries in ${{ matrix.environ.name }} environ + name: Up to binaries in ${{ matrix.devenv.name }} env timeout-minutes: 5 strategy: matrix: - environ: - - name: green + devenv: + - name: turing os: ubuntu-22.04 - - name: amber + - name: church os: ubuntu-20.04 - runs-on: ${{ matrix.environ.os }} + runs-on: ${{ matrix.devenv.os }} steps: - uses: actions/checkout@v4.1.0 - uses: ./.github/actions/prepare with: - revision: ${{ matrix.environ.name }} + name: ${{ matrix.devenv.name }} tools: python java - - run: ansible-playbook codebase.yml -e focus=pipeline + token: ${{ secrets.GITHUB_TOKEN }} + - run: ansible-playbook codebase.yml -e focus=toolchain working-directory: .dx env: GITHUB_ACTOR: ${{ github.actor }} @@ -38,7 +38,8 @@ jobs: - run: > ansible-playbook binaries.yml -e binary_repo=maven.pkg.github.com - -e focus=pipeline + -e devenv=${{ matrix.devenv.name }} + -e focus=toolchain working-directory: .dx env: GITHUB_ACTOR: ${{ github.actor }} diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientIT.java index 0fba37f3..dc1b77f4 100644 --- a/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientIT.java +++ b/apps/sepuling/src/test/java/smecalculus/bezmen/interior/messaging/SepulkaClientIT.java @@ -34,13 +34,13 @@ void shouldRegisterSepulka() { // given UUID id = UUID.randomUUID(); // and - SepulkaRegisterSlice command = sepulkaRegisterSlice(); + SepulkaRegisterSlice request = sepulkaRegisterSlice(); // and when(serviceMock.register(any(SepulkaRegisterSlice.class))).thenReturn(sepulka(id)); // and SepulkaRegisteredSlice expectedResponse = sepulkaRegisteredSlice(id); // when - SepulkaRegisteredSlice actualResponse = externalClient.register(command); + SepulkaRegisteredSlice actualResponse = externalClient.register(request); // then assertThat(actualResponse) .usingRecursiveComparison() diff --git a/docs/pipeline.adoc b/docs/pipeline.adoc index 881a60dd..8988d470 100644 --- a/docs/pipeline.adoc +++ b/docs/pipeline.adoc @@ -2,20 +2,20 @@ == Ключевые принципы -Решение и конвейер как сущности первого класса:: -Решение (solution) - система, реализуемая для клиентов. Конвейер (pipeline) - система, реализуемая для разработчиков. +Сущности первого класса:: +Решение (solution) - система, реализуемая для клиентов. Конвейер (pipeline) - система, реализуемая для внедренцев. Инструментарий (toolchain) - система, реализуемая для разработчиков. -Единый интерфейс для локальной разработки и непрерывной интеграции:: +Единый инструментарий для локальной разработки и непрерывной интеграции:: Семантика интерфейса подразумевает набор предопределенных абстракций, артефакты которых последовательно конструируются в ходе сборки. Перед началом конструирования выполняются обязательные проверки. Примеры абстракций: кодовая база (codebase), бинарники (binaries), образы (images), стеки (stacks) и другие. Контентная адресация (aka идентификация по содержимому):: Контентная адресация (content addressability) делает конструирование *идемпотентным*. Для директорий с исходным кодом вычисляются их контентные идентификаторы (CID's). Затем вычисляются корневые идентификаторы решения и конвейера. Таким образом формируется 2 небольших дерева Меркла, хеши которых подставляются в качестве тегов/классификаторов артефактов соответствующих абстракций. Артефакт конструируется, только когда его контентный идентификатор меняется. -Множественность окружений, назначений и настроек:: -Решение/конвейер используется клиентами/разработчиками в разных окружениях (environs) для разных назначений (usages) и с разными настройками (prefs). Ключевые окружения/назначения/настройки именуются и проверяются в рамках непрерывной интеграции. Устаревшие окружения/назначения/настройки снимаются с поддержки. +Множественность окружений и назначений:: +Решение/инструментарий используется клиентами/разработчиками в разных окружениях (envs) для разных назначений (usages). Ключевые окружения/назначения именуются и проверяются в рамках непрерывной интеграции. Устаревшие окружения/назначения снимаются с поддержки. Тесты! Тесты! Тесты!:: -Тестирование - один из самых важных (или даже самый важный) аспектов разработки! При тестировании проверяется поведение целевого объекта в различных ситуациях. В зависимости от подхода к подготовке зависимостей целевого объекта тесты можно разделить на 3 категории. +Тестирование - один из самых важных (или даже самый важный) аспектов разработки! При тестировании проверяется поведение целевого объекта в различных ситуациях. В зависимости от подхода к подготовке зависимостей целевого объекта тесты можно подразделить на 3 категории. Модульные тесты (unit tests)::: Все зависимости целевого объекта глушатся (stub) или мокируются (mock). Интеграционные тесты (integration tests)::: @@ -31,7 +31,7 @@ Планы делим на 2 категории: . Проверяющие решение (solution) -. Проверяющие конвейер (pipeline) +. Проверяющие инструментарий (toolchain) === Проверка решения @@ -39,27 +39,27 @@ ==== В пределах разумного (sanity) -Запускаем анализ зависимостей, линтинг, статический анализ, компиляцию, модульные тесты и собираем/публикуем бинарники. +Запускаем анализ зависимостей, линтинг, статический анализ, компиляцию, модульные тесты, собираем и публикуем бинарники. ==== Убедительная (convincing) -Все перечисленное ранее. Плюс запускаем интеграционные тесты, анализируем покрытие и собираем/публикуем образы. +Все перечисленное ранее. Плюс запускаем интеграционные тесты, анализируем покрытие, собираем и публикуем образы. ==== За пределами сомнений (beyond doubt) Все перечисленное ранее. Плюс запускаем сквозные тесты, собираем и публикуем стеки. -=== Проверка конвейера +=== Проверка инструментария -Конвейер проверяем во всех окружениях, в которых его могут эксплуатировать разработчики. +Инструментарий проверяем во всех окружениях, в которых его могут эксплуатировать разработчики. ==== В пределах разумного (sanity) -Запускаем линтинг исходного кода конвейера. +Запускаем линтинг исходного кода инструментария. ==== За пределами сомнений (beyond doubt) -Запускаем весь конвейер на минимально необходимом наборе тестов. +Запускаем проверку работы всего инструментария. == Частые вопросы (FAQ) diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaClient.java b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaClient.java index d9af5993..10c3d74d 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaClient.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/exterior/messaging/SepulkaClient.java @@ -1,5 +1,5 @@ package smecalculus.bezmen.exterior.messaging; public interface SepulkaClient { - SepulkaRegisteredSlice register(SepulkaRegisterSlice command); + SepulkaRegisteredSlice register(SepulkaRegisterSlice request); } diff --git a/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java index 1cdbb189..597ab982 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingMyBatisBeans.java @@ -9,9 +9,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -@Configuration(proxyBeanMethods = false) @ConditionalOnStateMappingMode(MY_BATIS) @MapperScan(basePackages = "smecalculus.bezmen.interior.storage.mybatis") +@Configuration(proxyBeanMethods = false) public class MappingMyBatisBeans { @Bean diff --git a/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringDataBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringDataBeans.java index e2067624..1fb4d643 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringDataBeans.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/interior/construction/MappingSpringDataBeans.java @@ -16,9 +16,9 @@ import smecalculus.bezmen.interior.configuration.StorageProps; import smecalculus.bezmen.interior.configuration.StorageProtocolProps; -@Configuration(proxyBeanMethods = false) @ConditionalOnStateMappingMode(SPRING_DATA) @EnableJdbcRepositories("smecalculus.bezmen.interior.storage.springdata") +@Configuration(proxyBeanMethods = false) public class MappingSpringDataBeans extends AbstractJdbcConfiguration { @Bean diff --git a/solutions/prefs/turing.yaml b/solutions/props/lamport.yaml similarity index 100% rename from solutions/prefs/turing.yaml rename to solutions/props/lamport.yaml diff --git a/solutions/prefs/church.conf b/solutions/props/shannon.conf similarity index 100% rename from solutions/prefs/church.conf rename to solutions/props/shannon.conf diff --git a/solutions/usages/basis.yml b/solutions/usages/basis.yml index 0a9ce0df..5c5050a9 100644 --- a/solutions/usages/basis.yml +++ b/solutions/usages/basis.yml @@ -11,11 +11,8 @@ configs: services: db: - image: postgres:15.3-alpine + image: postgres:${POSTGRES_VERSION}-alpine container_name: env-db - profiles: - - turing - - church ports: - 5432:5432 environment: @@ -33,9 +30,6 @@ services: schema-dba: image: ${SCHEMA_IMAGE}:${SCHEMA_TAG} container_name: schema-dba - profiles: - - turing - - church depends_on: db: condition: service_healthy @@ -59,9 +53,6 @@ services: schema-owner: image: ${SCHEMA_IMAGE}:${SCHEMA_TAG} container_name: schema-owner - profiles: - - turing - - church depends_on: schema-dba: condition: service_completed_successfully diff --git a/tests/e2e/README.adoc b/tests/e2e/README.adoc index 3d024531..8a580a75 100644 --- a/tests/e2e/README.adoc +++ b/tests/e2e/README.adoc @@ -1 +1 @@ -Сквозные тесты, в которых через публичные интерфейсы проверяется целевое приложение \ No newline at end of file +Сквозные тесты, в которых через публичные интерфейсы проверяется решение \ No newline at end of file diff --git a/tests/pom.xml b/tests/pom.xml index e9023611..634e50b3 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -15,7 +15,7 @@ - turing + shannon 1.18.30 UTF-8 @@ -35,20 +35,22 @@ + com.diffplug.spotless + spotless-maven-plugin + + + org.apache.maven.plugins maven-surefire-plugin - ${project.parent.basedir}/prefs/${prefs}.properties + ${project.parent.basedir}/props/${props}.properties - - com.diffplug.spotless - spotless-maven-plugin - + org.apache.maven.plugins maven-enforcer-plugin 3.4.1 @@ -91,6 +93,7 @@ + org.apache.maven.plugins maven-compiler-plugin 3.11.0 @@ -105,6 +108,7 @@ + org.apache.maven.plugins maven-surefire-plugin 3.1.2 diff --git a/tests/prefs/turing.properties b/tests/props/lamport.properties similarity index 100% rename from tests/prefs/turing.properties rename to tests/props/lamport.properties diff --git a/tests/prefs/church.properties b/tests/props/shannon.properties similarity index 100% rename from tests/prefs/church.properties rename to tests/props/shannon.properties