odo icon indicating copy to clipboard operation
odo copied to clipboard

[Feature request] 2-way sync of source code between developer machine and container

Open rm3l opened this issue 2 years ago • 3 comments

/kind feature

Which functionality do you think we should add?

Applications might update or generate files in the project, at build or run time. Some of those files (like yarn.lock) are usually under version control. Not sure if it is easily doable, but I was thinking it could be useful for files to be synced not only from the local machine to the container, but both ways. Or perhaps odo could provide a side command that allows syncing files back from the container in dev mode.

Why is this needed?

Applications might update or generate files at any time (at build time, run time, test time, ...). With commands being executed from within the dev container, there is currently no easy way to retrieve those updated/generated files. As a workaround, users can copy those files back using kubectl cp or oc cp, but they need to know the remote paths.

Example: After adding a devfile.yaml for the odo website (#6564), local changes are correctly pushed to the container, but I was wondering about a change in the package.json file while iterating locally. I can happily work with odo and my new changes are taken into account, but when I'm done with the Dev session, I'd need to manually install and run yarn locally to generate an updated yarn.lock and commit/push it to the repo.

rm3l avatar Feb 03 '23 11:02 rm3l

Cabal Discussion [7th Feb '23]: It makes sense and we can implement it. When we implement this; we can look into using annotations/attributes to determine the files that should be transferred back.

valaparthvi avatar Feb 07 '23 12:02 valaparthvi

A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.

github-actions[bot] avatar Jun 10 '23 00:06 github-actions[bot]

/lifecycle frozen

Low priority at the moment, but keeping it for the record as it might still be of interest.

rm3l avatar Jun 12 '23 13:06 rm3l