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

Server: Ignore directories containing a .bcfg2-ignore file #277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexanderS
Copy link
Member

The DirectoryBacked helper now does not recurse into directories that
contains a .bcfg2-ignore file. This makes it possible to ignore some
directories for most plugins (Bundler, Defaults, Pkgmgr, Properties,
PuppetENC, TemplateHelper, Trigger). You can store for example a python
module used by a TemplateHelper in the same directory, without getting
strange error messages while TemplateHelper is trying to import each
single file of this module.

The DirectoryBacked helper now does not recurse into directories that
contains a .bcfg2-ignore file. This makes it possible to ignore some
directories for most plugins (Bundler, Defaults, Pkgmgr, Properties,
PuppetENC, TemplateHelper, Trigger). You can store for example a python
module used by a TemplateHelper in the same directory, without getting
strange error messages while TemplateHelper is trying to import each
single file of this module.
@stpierre
Copy link
Member

I like this, and it's simple enough. I wonder, though, if it wouldn't be better to do something like .gitignore, where the file contains a list of globs to ignore. Ideally, subdirectories would inherit parent directories' ignore list, although that could be difficult.

That way we could also ignore files, not just directories. Basically, it'd be a better, more granular version of the server.ignore_files configuration directive.

Thoughts?

@mattikus
Copy link
Contributor

@stpierre Your suggestion sounds wonderful to me. 👍

@AlexanderS
Copy link
Member Author

For a .bcfg2-ignore file like a .gitignore file, it would be better to do the processing inside the FileMonitor plugin (like server.ignore_files). But the FileMonitor plugin may not have the full path for an event. At least the Inotify plugin already caches the path for the handler. Should I pull the path caching into the FileMonitor base class and the add dynamic ignores there?

@stpierre
Copy link
Member

Yes, I think so -- at least, if it's possible.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants