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

Add exclude file from scan feature #253

Merged
merged 5 commits into from Dec 17, 2019
Merged

Conversation

bnkai
Copy link
Collaborator

@bnkai bnkai commented Dec 7, 2019

Added a basic regexp pattern matching file exclusion.
You can add the patterns in the config file or directly from the UI

For the config file

exclude: 
- "sample\\.mp4$"
- "/\\.[[:word:]]+/"
- "c:\\\\stash\\\\videos\\\\exclude"
- "^/stash/videos/exclude/"
- "exclude/"

the first excludes all files ending in sample.mp4
the second hidden directories /.directory/
the third should work for windows based directories (the \ needs double escaping)
and so on

If added through the UI you don't need to escape the \ character

exl

@bnkai bnkai added the feature Pull requests that add a new feature label Dec 7, 2019
@bnkai bnkai changed the title [WIP] Added exclude file from scan feature [WIP] Add exclude file from scan feature Dec 7, 2019
* Abort exclusion instead of panicking when pattern isn't valid
@Leopere
Copy link
Collaborator

Leopere commented Dec 8, 2019

will the exclude file follow gitignore styling or some kind of YAML configuration in some way?

@bnkai
Copy link
Collaborator Author

bnkai commented Dec 8, 2019

It is in the config file as an extra option exclude so it's either json or yml depending on what your config file is currently.

@bnkai bnkai changed the title [WIP] Add exclude file from scan feature Add exclude file from scan feature Dec 13, 2019
Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

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

One suggested behaviour change and some minor cosmetic stuff.

pkg/manager/manager_tasks.go Outdated Show resolved Hide resolved
graphql/schema/types/config.graphql Outdated Show resolved Hide resolved
pkg/manager/manager_tasks_test.go Show resolved Hide resolved
  * changed behavior of exclude function to continue and ignore invalide regex patterns
  * added some more tests (windows networks and continue after regex error)
@Leopere
Copy link
Collaborator

Leopere commented Dec 15, 2019

One last QA check before we merge this.

Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

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

More cosmetic fixes.

pkg/manager/manager_tasks_test.go Show resolved Hide resolved
@WithoutPants
Copy link
Collaborator

From testing, I think the exclusions should also apply when performing a clean. Currently, it does not apply these.

@bnkai
Copy link
Collaborator Author

bnkai commented Dec 16, 2019

From testing, I think the exclusions should also apply when performing a clean. Currently, it does not apply these.

it's supposed to be only for the Scan, i'll create a separate PR with an option for the Clean

@bnkai
Copy link
Collaborator Author

bnkai commented Dec 16, 2019

I think i changed everything needed , not 100% sure on the tsx formatting i did it manually.

@Leopere Leopere merged commit 0714cbf into stashapp:develop Dec 17, 2019
@WithoutPants WithoutPants mentioned this pull request Feb 4, 2020
10 tasks
@bnkai bnkai deleted the exclude_file branch June 12, 2020 12:49
Tweeticoats pushed a commit to Tweeticoats/stash that referenced this pull request Feb 1, 2021
* Added exclude file from scan feature

* Abort exclusion instead of panicking when pattern isn't valid

* Added UI configuration for exclude patterns

*   * cosmetic fixes
  * changed behavior of exclude function to continue and ignore invalide regex patterns
  * added some more tests (windows networks and continue after regex error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Pull requests that add a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants