Carry secret-backed env vars from old CI into pyproject (lossless migration)#49
Merged
Merged
Conversation
…t (lossless)
Migration now extracts `${{ secrets.X }}` references from the existing
workflow's env: blocks and injects any not-yet-declared ones into
[tool.wads.ci.env].extra_envvars (recording secret_aliases when the env-var
name differs from the secret name). So ci-to-uv / ci-to-stub / fleet-stub no
longer silently drop secrets that were wired only in the old workflow YAML.
- migration.py: extract_ci_env_vars() + carry_ci_env_into_pyproject(); wired
into the ci-to-stub and ci-to-uv CLI handlers (prints what it carried).
- fleet_migrate.py: _migrate_one carries env per repo and stages pyproject.toml
alongside ci.yml in the commit (so the batch push includes it); noop only when
neither the workflow nor the env changed.
- Only env: blocks are scanned (not reusable-workflow secrets: pass-through, and
not with: action inputs), so PYPI_PASSWORD/GITHUB_TOKEN and transport-only
names are never mis-carried — no over-assignment.
- wads-migrate skill: document the automatic, lossless carry.
- Tests: test_ci_env_extraction.py (extraction precision, alias, idempotence).
Refs #45.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Answers a gap you flagged before the fleet migration: migration should read the current CI and carry its secret wiring into
pyproject.toml, rather than relying on the agent (skill) to do it by hand.What it does
ci-to-uv,ci-to-stub, and the batchfleet-stubnow extract${{ secrets.X }}references from the existing workflow'senv:blocks and inject any not-yet-declared ones into[tool.wads.ci.env].extra_envvars— recording asecret_aliasesentry when the env-var name differs from the secret name (e.g.HF_TOKEN ← HF_WRITE_TOKEN). Migration is now lossless: secrets wired only in the old YAML are preserved instead of silently dropped.This is in the migration code, not just the skill — so it's deterministic and works identically whether driven by you, an agent, or the batch loop over your 10–20 repos.
Precision (avoids re-introducing over-assignment)
Only
env:blocks are scanned — not the reusable-workflowsecrets:pass-through (transport ≠ usage) and notwith:action inputs. Infra secrets (PYPI_PASSWORD,GITHUB_TOKEN,TEST_PYPI_PASSWORD) are excluded. Carried vars go toextra_envvars(available-if-set, never fails a build); you promote torequired/testif a test truly depends on one. The command prints exactly what it carried.Batch behavior
fleet-stubstagespyproject.tomlalongsideci.ymland notes the carry in the per-repo commit message; a repo isnooponly when neither the workflow nor the env changed.End-to-end check
For an inline-uv
ci.ymlwithOPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}andHF_TOKEN: ${{ secrets.HF_WRITE_TOKEN }}(not yet in pyproject),ci-to-stubproduced:and a stub passing
PYPI_PASSWORD,OPENAI_API_KEY,HF_WRITE_TOKEN.Skill (
wads-migrate) updated to document the auto-carry. Tests added. Full suite: 292 passed.