Skip to content

feat(agent/agentcontainers): add file watcher and dirty status #17573

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

Merged
merged 23 commits into from
Apr 29, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
s/file/path
  • Loading branch information
mafredri committed Apr 28, 2025
commit 7edee90bbd678258f1e8d46acb4bf95dfb37644a
12 changes: 6 additions & 6 deletions agent/agentcontainers/watcher/watcher.go
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this package could be moved outside of agentcontainers for later re-use, but that doesn't have to be done in this PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a valid suggestion, but I'd like to defer until the need arises to keep devcontainer related stuff contained (heh).

Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ func NewFSNotify() (Watcher, error) {
}, nil
}

func (f *fsnotifyWatcher) Add(file string) error {
if err := f.Watcher.Add(file); err != nil {
return xerrors.Errorf("add file to watcher: %w", err)
func (f *fsnotifyWatcher) Add(path string) error {
if err := f.Watcher.Add(path); err != nil {
return xerrors.Errorf("add path to watcher: %w", err)
}
return nil
}

func (f *fsnotifyWatcher) Remove(file string) error {
if err := f.Watcher.Remove(file); err != nil {
return xerrors.Errorf("remove file from watcher: %w", err)
func (f *fsnotifyWatcher) Remove(path string) error {
if err := f.Watcher.Remove(path); err != nil {
return xerrors.Errorf("remove path from watcher: %w", err)
}
return nil
}
Expand Down
Loading