Make protected-file policy configurable and consistent for migration branches
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia esaminando install.md e workflows/crane.md, quindi individua i test dell’installer e dei prompt del workflow menzionati nell’issue. Traccia come viene configurato il comportamento dei file protetti per create-pull-request e push-to-pull-request-branch. Il lavoro è completo quando la policy selezionata è documentata e applicata in modo coerente e l’output di fallback non viene trattato come un’iterazione riuscita senza un commit sul branch.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background
During the githubnext/apm Python-to-Go migration, Crane repeatedly needed to touch files that are commonly protected: go.mod, go.sum, workflow files, and other project configuration. With protected files set to fallback-to-issue, Crane could describe work in an issue but not push the actual migration commit. That caused false progress and stalled PR updates.
APM locally changed the Crane workflow so create-pull-request uses protected-files: allowed. The upstream lesson is broader: code migration frequently requires manifest, lockfile, or workflow changes, so protected-file behavior must be explicit, configurable, and consistent across both creating the PR and pushing later iteration commits.
Problem
The default upstream Crane workflow has create-pull-request protected files set to fallback-to-issue, while push-to-pull-request-branch also has its own protected-file behavior from safe outputs. This can create surprising behavior:
- First accepted iteration can fail to create a useful PR if protected files are touched.
- Later iterations can fail to push to the existing migration branch.
- Crane may write fallback issues that look like progress but do not update the PR branch.
- Migrations involving Go, Node, Python, Java, or Rust often need dependency manifest and lockfile edits.
For a migration tool, touching manifest and lock files is often not exceptional. It is part of the migration.
Proposed implementation
Make protected-file policy an explicit Crane installation or workflow configuration choice.
Possible design:
-
Add an installer prompt in
install.md:- Strict: protected files fall back to issue for maximum safety.
- Migration-friendly: protected files are allowed on Crane migration branches.
- Custom: user provides an allowlist or policy.
-
Apply the selected policy consistently to both:
create-pull-requestpush-to-pull-request-branch
-
Document when to use each mode:
- Use strict for repositories where agents must never touch manifests or workflow files without human intervention.
- Use migration-friendly when the migration target requires dependency, lockfile, build, or workflow updates.
-
If a protected-file fallback still happens, Crane should treat it as blocked or incomplete, not as an accepted migration iteration. It should tell the maintainer what policy or allowlist needs to change.
-
Consider per-migration override support in migration frontmatter, for example:
protected-files-policy: allowed
or
protected-files-policy: fallback-to-issue
Suggested test coverage
- Prompt or installer tests that verify the protected-file policy is described.
- Workflow prompt test that verifies the policy applies to both PR creation and PR branch pushes.
- If implemented in installer code, test that the selected policy is written into
workflows/crane.mdbeforegh aw compile.
Acceptance criteria
- A repository owner can choose strict or migration-friendly protected-file behavior during installation.
- The chosen behavior is applied consistently for initial PR creation and later PR updates.
- Crane does not mark protected-file fallback output as a successful accepted iteration unless a commit actually reached the migration branch.
- Documentation explains why migrations may need to touch manifest and lock files.
Provenance
This came from githubnext/apm, where the Python-to-Go migration needed dependency and workflow changes and protected-file fallback prevented Crane from generating new PR commits.
- Lingua principale
- Python
- Stelle
- 10
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di githubnext/crane
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
githubnext/crane#6 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
githubnext/crane#5 ·
-
documentation enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
githubnext/crane#8 ·
-
enhancement
githubnext/crane#4 · 1 reazione · 2 assegnatari ·
Tutte le issue di githubnext/crane
Issue simili
-
sponsored
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
Diaoul/subliminal#1382 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
triage/confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
agentscope-ai/agentscope#2775 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100