Skip to content

Commit da53db0

Browse files
committed
fix(ci): tolerate missing live platform secrets
- soft-skip live smoke when bundle secrets are absent - keep Windows test build away from Unix-only shell fakes
1 parent d2c0a4b commit da53db0

4 files changed

Lines changed: 95 additions & 49 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,61 +95,77 @@ jobs:
9595
bash --version
9696
python3 --version
9797
98-
- name: Select platform bundle secret for trusted live path
99-
if: steps.trust.outputs.trusted == 'true'
98+
- name: Resolve platform bundle live mode
99+
id: live
100100
env:
101101
MATRIX_OS: ${{ matrix.os }}
102+
TRUSTED: ${{ steps.trust.outputs.trusted }}
102103
V8TR_PLATFORM_BUNDLE_URL_LINUX: ${{ secrets.V8TR_PLATFORM_BUNDLE_URL_LINUX }}
103104
V8TR_PLATFORM_BUNDLE_SHA256_LINUX: ${{ secrets.V8TR_PLATFORM_BUNDLE_SHA256_LINUX }}
104105
V8TR_PLATFORM_BUNDLE_URL_WINDOWS: ${{ secrets.V8TR_PLATFORM_BUNDLE_URL_WINDOWS }}
105106
V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS: ${{ secrets.V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS }}
106107
run: |
108+
live_available="false"
109+
107110
case "$MATRIX_OS" in
108111
ubuntu-latest)
109112
bundle_url="$V8TR_PLATFORM_BUNDLE_URL_LINUX"
110113
bundle_sha256="$V8TR_PLATFORM_BUNDLE_SHA256_LINUX"
114+
url_secret_name="V8TR_PLATFORM_BUNDLE_URL_LINUX"
115+
sha_secret_name="V8TR_PLATFORM_BUNDLE_SHA256_LINUX"
111116
;;
112117
windows-latest)
113118
bundle_url="$V8TR_PLATFORM_BUNDLE_URL_WINDOWS"
114119
bundle_sha256="$V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS"
120+
url_secret_name="V8TR_PLATFORM_BUNDLE_URL_WINDOWS"
121+
sha_secret_name="V8TR_PLATFORM_BUNDLE_SHA256_WINDOWS"
115122
;;
116123
*)
117124
echo "Unsupported matrix.os: $MATRIX_OS" >&2
118125
exit 2
119126
;;
120127
esac
121128
122-
if [[ -z "$bundle_url" ]]; then
123-
echo "Trusted happy-path requires a platform bundle URL secret for $MATRIX_OS" >&2
124-
exit 2
125-
fi
129+
if [[ "$TRUSTED" == "true" && -n "$bundle_url" && -n "$bundle_sha256" ]]; then
130+
live_available="true"
131+
{
132+
echo "V8TR_PLATFORM_BUNDLE_URL<<__V8TR_ENV__"
133+
echo "$bundle_url"
134+
echo "__V8TR_ENV__"
135+
echo "V8TR_PLATFORM_BUNDLE_SHA256<<__V8TR_ENV__"
136+
echo "$bundle_sha256"
137+
echo "__V8TR_ENV__"
138+
} >> "$GITHUB_ENV"
139+
else
140+
missing=()
141+
if [[ "$TRUSTED" == "true" ]]; then
142+
[[ -n "$bundle_url" ]] || missing+=("$url_secret_name")
143+
[[ -n "$bundle_sha256" ]] || missing+=("$sha_secret_name")
144+
fi
145+
146+
if [[ "${#missing[@]}" -gt 0 ]]; then
147+
printf -v missing_text '%s, ' "${missing[@]}"
148+
missing_text="${missing_text%, }"
149+
echo "::notice title=Live Designer smoke skipped::$MATRIX_OS platform bundle secrets are not configured: $missing_text. Rust contract and non-live happy-path checks remain blocking."
150+
fi
126151
127-
if [[ -z "$bundle_sha256" ]]; then
128-
echo "Trusted happy-path requires a platform bundle SHA256 secret for $MATRIX_OS" >&2
129-
exit 2
152+
echo "V8TR_DESIGNER_ALLOW_MISSING_CONFIG=1" >> "$GITHUB_ENV"
130153
fi
131154
132-
{
133-
echo "V8TR_PLATFORM_BUNDLE_URL<<__V8TR_ENV__"
134-
echo "$bundle_url"
135-
echo "__V8TR_ENV__"
136-
echo "V8TR_PLATFORM_BUNDLE_SHA256<<__V8TR_ENV__"
137-
echo "$bundle_sha256"
138-
echo "__V8TR_ENV__"
139-
} >> "$GITHUB_ENV"
155+
echo "live_available=$live_available" >> "$GITHUB_OUTPUT"
140156
141157
- name: Install 1C platform bundle
142-
if: steps.trust.outputs.trusted == 'true'
158+
if: steps.live.outputs.live_available == 'true'
143159
run: |
144160
bash scripts/test/ci-platform-install.sh
145161
146162
- name: Materialize dedicated Designer config
147-
if: steps.trust.outputs.trusted == 'true'
163+
if: steps.live.outputs.live_available == 'true'
148164
run: |
149165
bash scripts/test/ci-designer-config.sh
150166
151167
- name: Bootstrap file infobase through ibsrv
152-
if: steps.trust.outputs.trusted == 'true'
168+
if: steps.live.outputs.live_available == 'true'
153169
run: |
154170
bash scripts/test/ci-ibsrv.sh start
155171
@@ -158,12 +174,12 @@ jobs:
158174
V8_RUNNER_CI_SCOPE=happy-path bash scripts/test/ci-rust.sh
159175
160176
- name: Stop ibsrv sidecar
161-
if: always() && steps.trust.outputs.trusted == 'true'
177+
if: always() && steps.live.outputs.live_available == 'true'
162178
run: |
163179
bash scripts/test/ci-ibsrv.sh stop
164180
165181
- name: Upload deploy-ready artifacts
166-
if: success() && steps.trust.outputs.trusted == 'true'
182+
if: success() && steps.live.outputs.live_available == 'true'
167183
uses: actions/upload-artifact@v7
168184
with:
169185
name: deploy-ready-${{ runner.os }}

scripts/test/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ live-mcp-http.py
141141
| `V8TR_INFOBASE_PATH` | `ci-designer-config.sh`, `ci-ibsrv.sh` | Явный file infobase path, синхронизированный между config и `ibsrv --db-path` |
142142
| `V8TR_IBSRV_PATH` | `ci-platform-install.sh`, `ci-ibsrv.sh` | Путь до standalone `ibsrv`, извлечённый из platform bundle |
143143
| `V8TR_DESIGNER_TEST_MODE` | `live-cli-fixture.sh` | Opt-in запуск реального 1С test-stage: `none`, `va`, `yaxunit-all`, `module` |
144-
| `V8TR_DESIGNER_ALLOW_MISSING_CONFIG` | `live-cli-fixture.sh`, `.github/workflows/ci.yml` | Trusted/fork gating hook для soft-skip mandatory live contour на untrusted контексте |
144+
| `V8TR_DESIGNER_ALLOW_MISSING_CONFIG` | `live-cli-fixture.sh`, `.github/workflows/ci.yml` | Gating hook для soft-skip mandatory live contour на fork/untrusted контексте и на trusted CI без OS-specific platform bundle secrets |
145145
| `V8TR_REAL_CONFIG` | `live-mcp-http.py` | Реальный config для MCP HTTP smoke |
146146

147147
## Типовые сценарии запуска
@@ -160,6 +160,8 @@ V8_RUNNER_CI_SCOPE=happy-path bash scripts/test/ci-rust.sh
160160

161161
### Trusted CI wiring helpers
162162

163+
`.github/workflows/ci.yml` запускает install/config/ibsrv/upload helpers only when `live_available=true`, то есть когда для текущей matrix OS настроены `V8TR_PLATFORM_BUNDLE_URL_*` и `V8TR_PLATFORM_BUNDLE_SHA256_*`. Без этой пары secrets happy-path остаётся blocking для Rust/non-live checks и soft-skips real 1C smoke.
164+
163165
```bash
164166
bash scripts/test/ci-platform-install.sh
165167
bash scripts/test/ci-designer-config.sh

spec/acceptance/real-environment-validation.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
Начиная с `2026-04-22`, source of truth для real-env happy-path является GitHub Actions workflow [`ci.yml`](../.github/workflows/ci.yml) с matrix на `ubuntu-latest` и `windows-latest`, а локальные скрипты в `scripts/test/*` остаются helper/entrypoint-слоем для этого workflow.
66

7-
Обязательный smoke-контур для обеих ОС один и тот же:
7+
Обязательный smoke-контур для обеих ОС один и тот же, когда для matrix OS настроены platform bundle secrets:
88

99
1. `build`
1010
2. `syntax/check`
1111
3. `test` Rust/CLI/MCP-контракта
1212
4. `package`
1313
5. `deploy-ready artifacts`
1414

15+
Если OS-specific bundle secrets отсутствуют, workflow оставляет blocking Rust/non-live checks и явно soft-skips real 1C package/deploy-ready smoke через `live_available=false`.
16+
1517
Под `deploy-ready artifacts` в этом репозитории понимается только публикация и проверка наличия/непустоты следующих файлов:
1618

1719
- `.cf`
@@ -45,11 +47,11 @@ bash scripts/test/ci-rust.sh
4547

4648
- `V8_RUNNER_CI_SCOPE=contract` или `full` запускает `cargo test --locked`
4749
- `V8_RUNNER_CI_SCOPE=runtime-locks` запускает только lock-focused regression subset
48-
- `V8_RUNNER_CI_SCOPE=happy-path` запускает обязательную цепочку `build -> syntax/check -> test -> package -> deploy-ready artifacts`
50+
- `V8_RUNNER_CI_SCOPE=happy-path` запускает Rust/non-live цепочку `build -> cargo check -> cargo test`, затем `live-cli-fixture`; real 1C `package -> deploy-ready artifacts` выполняются только когда workflow подготовил `V8TR_DESIGNER_REAL_CONFIG`
4951

5052
### 2. Mandatory Linux/Windows happy-path
5153

52-
Назначение: одинаково обязательный smoke для `Linux` и `Windows` на trusted контексте.
54+
Назначение: одинаково обязательный smoke для `Linux` и `Windows` на trusted контексте при настроенных OS-specific bundle secrets. Без них workflow явно сообщает degraded coverage и оставляет blocking только Rust/non-live части.
5355

5456
Canonical entrypoint:
5557

@@ -64,7 +66,7 @@ V8_RUNNER_CI_SCOPE=happy-path bash scripts/test/ci-rust.sh
6466
3. `cargo test --locked`
6567
4. `bash scripts/test/live-cli-fixture.sh`
6668

67-
`scripts/test/live-cli-fixture.sh` в mandatory профиле обязан выполнить одинаковые стадии для обеих ОС:
69+
`scripts/test/live-cli-fixture.sh` в mandatory профиле обязан выполнить одинаковые стадии для обеих ОС, когда `V8TR_DESIGNER_REAL_CONFIG` материализован:
6870

6971
1. `init/setup infobase`
7072
2. `build --full-rebuild`
@@ -95,18 +97,20 @@ Partial smoke contract:
9597

9698
## Gating contract
9799

98-
Mandatory happy-path должен быть blocking только для:
100+
Mandatory happy-path должен быть blocking live-smoke только для:
99101

100102
- `master`
101103
- trusted branches
102104
- same-repo PR
105+
- OS-specific platform bundle secrets configured for the matrix OS
103106

104107
Для fork PR live jobs не должны становиться blocking. В этом репозитории это выражено workflow-файлом `.github/workflows/ci.yml` и тем же env hook-контрактом:
105108

106109
- mandatory designer smoke требует `V8TR_DESIGNER_REAL_CONFIG`
107110
- workflow может разрешить soft-skip только через `V8TR_DESIGNER_ALLOW_MISSING_CONFIG=1`
108111
- без этого hook `scripts/test/live-cli-fixture.sh` падает, если `V8TR_DESIGNER_REAL_CONFIG` не задан
109-
- trusted path устанавливает 1С из OS-specific bundle secret, материализует dedicated `format: DESIGNER` + `builder: DESIGNER` config, запускает `ibsrv` sidecar на том же file-infobase path и только потом вызывает canonical entrypoint `V8_RUNNER_CI_SCOPE=happy-path bash scripts/test/ci-rust.sh`
112+
- trusted path with configured OS-specific bundle secrets устанавливает 1С, материализует dedicated `format: DESIGNER` + `builder: DESIGNER` config, запускает `ibsrv` sidecar на том же file-infobase path и только потом вызывает canonical entrypoint `V8_RUNNER_CI_SCOPE=happy-path bash scripts/test/ci-rust.sh`
113+
- trusted path without those secrets emits a GitHub Actions notice with `live_available=false`, sets `V8TR_DESIGNER_ALLOW_MISSING_CONFIG=1`, and keeps Rust/non-live happy-path checks blocking while the live smoke is skipped
110114
- fork PR и Dependabot не получают install/bootstrap/upload path: workflow передает только `V8TR_DESIGNER_ALLOW_MISSING_CONFIG=1`, а upload deploy-ready артефактов остаётся trusted-only
111115

112116
## Контракт `live-cli-fixture`
@@ -204,15 +208,15 @@ Windows runner contract for this helper layer is explicit:
204208
| Контур | Linux | Windows | Blocking | Build | Syntax/check | Test | Package | Deploy-ready artifacts |
205209
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
206210
| `ci-rust contract` | yes | yes | yes | Rust | Rust | Rust | no | no |
207-
| `ci-rust happy-path` | yes | yes | yes on trusted | Rust + real 1C | real | Rust by default; real 1C opt-in | real | real |
211+
| `ci-rust happy-path` | yes | yes | yes for Rust/non-live checks; live smoke is blocking when OS bundle secrets exist | Rust + real 1C when available | real when available | Rust by default; real 1C opt-in | real when available | real when available |
208212
| `live-mcp-http` | optional | optional | no | real via MCP | real via MCP | real via MCP | n/a | n/a |
209213
| `live-cli-ibcmd` | optional | optional | no | real (`IBCMD`) | n/a | n/a | diagnostic dump/export only | n/a |
210214
| `live-cli-designer` | optional | optional | no | real (`DESIGNER`) | real | real opt-in | real | real |
211215

212216
## Ограничения и TODO hooks
213217

214-
- Workflow `.github/workflows/ci.yml` уже зафиксировал contract/gating/upload wiring, но сам не умеет скачивать vendor installer публично: trusted path ожидает готовый platform bundle по секретному URL и обязательному SHA256.
218+
- Workflow `.github/workflows/ci.yml` уже зафиксировал contract/gating/upload wiring, но сам не умеет скачивать vendor installer публично: trusted live path ожидает готовый platform bundle по секретному URL и обязательному SHA256. Если OS-specific URL/SHA256 secrets отсутствуют, workflow явно сообщает degraded coverage через notice и soft-skips live smoke; восстановление blocking live coverage требует добавить соответствующую пару secrets.
215219
- `ibsrv` в workflow запускается как sidecar на том же `--db-path`, который зашит в dedicated file-based Designer config; сам CLI harness по текущему контракту остаётся file-connection oriented и не переключается на server connection.
216220
- `live-cli-fixture` по умолчанию не запускает 1С test-stage; `va`, `yaxunit-all` и `module` остаются opt-in режимами для стендов, где установлен и проверен соответствующий headless runner.
217221
- `live-mcp-http` и `live-cli-ibcmd` остаются отдельными non-blocking контурами.
218-
- Mandatory designer smoke requires `V8TR_DESIGNER_REAL_CONFIG`; `V8TR_DESIGNER_ALLOW_MISSING_CONFIG=1` is reserved for fork/non-blocking soft-skip contexts.
222+
- Mandatory designer smoke requires `V8TR_DESIGNER_REAL_CONFIG`; `V8TR_DESIGNER_ALLOW_MISSING_CONFIG=1` is reserved for fork/non-blocking soft-skip contexts and for trusted CI matrix entries where the OS-specific platform bundle secrets are not configured.

0 commit comments

Comments
 (0)