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

[RFC]: add .rwignore support or new group in redwood.toml for excluding folders from rw scanning #7761

Closed
1 task
bnn1 opened this issue Mar 5, 2023 · 4 comments

Comments

@bnn1
Copy link
Contributor

bnn1 commented Mar 5, 2023

Summary

Follow up from #7690
Add a file .rwignore (or whatever) that will "tell" RW scanner to skip certain folders.

Other option would be to add a new group in redwood.toml, say named "cli" with one variable "scanIgnoreDirs" which accepts an array of strings - paths user want to exclude from scanning

[cli]
  scanIgnoreDirs = ["db"]

Motivation

When in the RW project directory there is a folder with restricted permission, RW fails to generate anything because it can't scan folders with restricted permission

Such a folder can be created by running docker containers with their volume mapped to somewhere in the RW project directory.

We need a way to tell RW to not scan certain folders to avoid crashing.

Detailed proposal

To address the issue of the RW tool failing when encountering a folder it cannot read, we propose adding a new group in the redwood.toml configuration file called "cli" or add support for .rwignore file. Within this group, we can add a variable called scanIgnoreDirs, which accepts an array of strings representing the paths that the user wants to exclude from scanning. This will allow users to specify which directories the RW tool should ignore while scanning.

Here is an example of how the scanIgnoreDirs variable can be used:

[cli]
scanIgnoreDirs = ["db", "node_modules"]

In this example, the db and node_modules directories will be excluded from scanning. Users can add as many directories as they want to this array.

By implementing this feature, we can provide more control to the user in terms of which directories should be ignored while scanning. This will make the RW tool more robust and less prone to failing due to permission issues.

Adding the scanIgnoreDirs variable to the redwood.toml file will allow users to exclude specific directories from being scanned by the RW tool. This will make the tool more robust and less prone to failing due to permission issues. The implementation of this feature should be straightforward and can be completed in a timely manner.

Are you interested in working on this?

  • I'm interested in working on this
@bnn1 bnn1 changed the title [RFC]: add .rwignore support for excluding folders from rw scanning [RFC]: add .rwignore support or new group in redwood.toml for excluding folders from rw scanning Mar 5, 2023
@Tobbe
Copy link
Member

Tobbe commented Jun 28, 2023

More support for this feature has been raised in
#8752
and
#5403 (comment)

@Tobbe
Copy link
Member

Tobbe commented Jun 28, 2023

We don't have the bandwidth to start working on this feature right now, but we do like the idea.

@hacknaked or @bnn1 if either of you (or anyone else) is interested in working on this that'd be awesome. Feel free to get started whenever you like 🙂 We'll have someone from the team to help guide you if you need, and to help with reviewing the code etc

We do prefer the toml-based approach. So if you do start working on something, please go for that solution

@bnn1
Copy link
Contributor Author

bnn1 commented Jun 28, 2023

@Tobbe I found the culprit, fixing it now.

@bnn1
Copy link
Contributor Author

bnn1 commented Aug 28, 2023

The issue has been fixed in #9079

@bnn1 bnn1 closed this as completed Aug 28, 2023
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

No branches or pull requests

2 participants