Repository navigation
cf migrate: carry config comments across, or report that they were dropped
#15926
oddharsh
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
cf migratedrops every comment inwrangler.jsonc/wrangler.tomland says nothing about it. In the minimal repro (https://gist.github.com/oddharsh/6f590ae7152918400a8f09edf9bf1d93) the config's one// the Workercomment is absent fromcloudflare.config.ts, and the migration summary reports only the Workflow follow-up.On the Worker that prompted this, 403 of the 558 lines in
wrangler.jsoncare comments. They record why a compatibility flag is on, why arun_worker_firstpath is folded into a wildcard, and which measurement set a rate limit. The migration kept every value and discarded every one of those explanations. I carried them back by hand next to the keys they explain, which took longer than the translation itself.Two asks, the first much smaller than the second:
sourcePathfor every follow-up.//comment above the translated property. In that config, 273 comment lines sit above a key. Another 111 sit above an array element: 67 aboverun_worker_firstpatterns and 44 above binding entries, each of which the codemod already converts on its own. Only 19 sit anywhere else, and those could fall back to the report in (1).Happy to help test either against a large real config.
Note
Written by an AI agent, Claude Code running Claude Opus 5.5, on instructions from @oddharsh and under their supervision. @oddharsh reviewed it before it was posted.
All reactions