Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider triggering replacement for CopyFile when local file changes #151

Closed
Tracked by #159
t0yv0 opened this issue Oct 27, 2022 · 5 comments
Closed
Tracked by #159

Consider triggering replacement for CopyFile when local file changes #151

t0yv0 opened this issue Oct 27, 2022 · 5 comments
Labels
kind/enhancement Improvements or new features resolution/duplicate This issue is a duplicate of another issue

Comments

@t0yv0
Copy link
Member

t0yv0 commented Oct 27, 2022

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

CopyFile does not sync the local file to the remote file when the local file changes. This can be implemented manually by using triggers with the hash of the local file forcing a replace. But perhaps should be the default behavior? If not, perhaps we can make this trigger example easy to find for new users.

Please see details worked out in the gist: https://gist.github.com/t0yv0/addb78402b3e91a910b2021bce7c8e1d

Also, tangentially, remote.Command that depends_on the CopyFile does not replace when CopyFile replaces. Is this expected? It can be made replace itself if given the same triggers as CopyFile in the current implementation.

Affected area/feature

@t0yv0 t0yv0 added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Oct 27, 2022
@iwahbe
Copy link
Member

iwahbe commented Oct 31, 2022

CopyFile takes a local path string right now. I would be hesitant to add magic replacement semantics there. We could and should add the ability to specify an asset instead of a path, which would solve this for us.

@iwahbe iwahbe removed the needs-triage Needs attention from the triage team label Oct 31, 2022
@t0yv0
Copy link
Member Author

t0yv0 commented Oct 31, 2022

That can be a good idea. I think the key here is the default documentation path that folks are looking at should enable the "keep the server file in sync with the local one sceanario" - that seems to me a better "default", even if it's not technically a default and needs some settings added.

@iwahbe
Copy link
Member

iwahbe commented Oct 31, 2022

I'm thinking something like

localPath: string
description: >
  The path to the file to be copied. This should be used only when you
  don't want CopyFile to trigger replacements because of underlying file
  changes.

  Mutually exclusive with `localFile`.

localFile: Asset
description: >
  The file to be copied.

  Mutually exclusive with `localPath`.

@t0yv0
Copy link
Member Author

t0yv0 commented Oct 31, 2022

Can mention the trigger recipe into localPath.

If you want the path to sync upon changes, add a trigger to the `triggers` property with with the hash of the file contents.

@lukehoban lukehoban added the resolution/duplicate This issue is a duplicate of another issue label Dec 29, 2022
@lukehoban
Copy link
Contributor

Closing as duplicate of #33 and #42.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features resolution/duplicate This issue is a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants