Skip to content

Commit a0c995b

Browse files
committed
fix
1 parent 8977fc0 commit a0c995b

4 files changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ The repository ships the sync workflow template used by generated package reposi
114114

115115
The generated `source-sync` workflow stays thin: it checks out this repository as the generator logic, reads the consumer repo's `.msra` source tree, generates the artifact into a staging tree, syncs the generated tree into `main`, validates the result, and pushes the commit so the target repo's `publish.yml` can run on `push` to `main`.
116116

117+
Before validation, the generated workflow installs the target project's `requirements-dev.txt` so the validation step runs with the generated dependencies available.
118+
117119
The source and target branches come from the repo-specific sync config, so the generated workflow itself stays thin.
118120

119121
In the recommended repo layout, `main` is the default branch of the consumer repo, because that is where the manual `source-sync` workflow lives.

docs/msra-repo-b-sync.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ jobs:
155155
- direct checkout генератора из `repo A`
156156
- чтение `source`-ветки `repo B`
157157
- запись результата в `main`
158+
- установка `target/requirements-dev.txt` перед `validate`, чтобы mypy и ruff видели generated зависимости
158159

159160
## Как проходит один ручной запуск
160161

msra_codegen/templates/github/workflows/source-sync.yml.tpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ jobs:
8484
shutil.copy2(item, destination)
8585
PY
8686

87+
- name: Install target project dependencies
88+
working-directory: target
89+
run: |
90+
python -m pip install --upgrade pip
91+
python -m pip install -r requirements-dev.txt
92+
8793
- name: Validate generated project
8894
working-directory: logic
8995
run: |

tests/codegen.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,8 @@ test("python codegen generates both bundled msra documents without failing", ()
790790
assert.match(normalizedSourceSyncWorkflowText, /path: target/);
791791
assert.match(normalizedSourceSyncWorkflowText, new RegExp(`source_msra_path="${path.basename(testCase.inputPath)}"`));
792792
assert.match(normalizedSourceSyncWorkflowText, /python -m msra_codegen generate "\.\.\/source\/\$source_msra_path" -o \.\.\/generated/);
793+
assert.match(normalizedSourceSyncWorkflowText, /working-directory: target/);
794+
assert.match(normalizedSourceSyncWorkflowText, /python -m pip install -r requirements-dev\.txt/);
793795
assert.match(normalizedSourceSyncWorkflowText, /token: \$\{\{ secrets\.SOURCE_SYNC_TOKEN \}\}/);
794796
assert.match(normalizedSourceSyncWorkflowText, /git push origin HEAD:main/);
795797
assert.match(testsWorkflowText, /name: tests/);

0 commit comments

Comments
 (0)