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

feat: Expose globbing code from Semaphore to Python #288

Merged
merged 12 commits into from
Oct 30, 2019
Merged

Conversation

mitsuhiko
Copy link
Member

@mitsuhiko mitsuhiko commented Oct 30, 2019

This exposes the globbing code we have in Semaphore through the Python library to Python.

This fulfills two purposes: they are now compatible with each other behavior wise and they both use a non backtracking regex engine which we need for untrusted inputs that we have from rules.

@mitsuhiko mitsuhiko changed the title feat: work on glob feat: Expose globbing code from Semaphore to Python Oct 30, 2019
test_glob!("foo/hello.PY", "**/*.py", false, {double_star: true});
test_glob!("foo/hello.PY", "**/*.py", true, {double_star: true, case_insensitive: true});
test_glob!("foo\\hello\\bar.PY", "foo/**/*.py", false, {double_star: true, case_insensitive: true});
test_glob!("foo\\hello\\bar.PY", "foo/**/*.py", true, {double_star: true, case_insensitive: true, path_normalize: true});
Copy link
Member Author

Choose a reason for hiding this comment

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

There is a difference in behavior to python here: **/*.py actually matches on foo\\bar.py even without path normalization. The reason being that a trailing ** is optional.

I think this is a reasonable change and will not cause any problems. This is already the behavior we have in relay and this makes this consistent now.

Copy link
Member

@jan-auer jan-auer left a comment

Choose a reason for hiding this comment

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

Neat! Only nitpicks

cabi/src/processing.rs Outdated Show resolved Hide resolved
common/src/glob.rs Outdated Show resolved Hide resolved
common/src/glob.rs Show resolved Hide resolved
common/src/glob.rs Outdated Show resolved Hide resolved
mitsuhiko and others added 3 commits October 30, 2019 20:18
Co-Authored-By: Jan Michael Auer <jan.auer@sentry.io>
Co-Authored-By: Jan Michael Auer <jan.auer@sentry.io>
@mitsuhiko mitsuhiko requested a review from jan-auer October 30, 2019 19:22
cabi/include/semaphore.h Outdated Show resolved Hide resolved
@mitsuhiko mitsuhiko merged commit ba0844f into master Oct 30, 2019
@mitsuhiko mitsuhiko deleted the feature/glob branch October 30, 2019 19:55
jan-auer added a commit that referenced this pull request Nov 4, 2019
* master: (26 commits)
  doc: Add documentation about the path of an event through relay (#289)
  release: 0.4.59
  meta: Changelog for 0.4.59
  ref: Set _relay_processed to true (#293)
  feat(protocol): Add valid platforms as constant (#294)
  fix(protocol): Add missing legacy alias for stacktrace (#292)
  release: 0.4.58
  meta: Add changelog for 0.4.58
  feat: Expose globbing code from Semaphore to Python (#288)
  fix: Add code comment
  fix: Normalize before datascrubbing (#290)
  feat(projects): Evict project caches after some time (#287)
  feat: Add mkdocs like in symbolicator
  ref: Add event size metrics (#286)
  test: add panic test
  ref: Selectively log internal errors to stderr (#285)
  fix(cabi): Do not ignore process_value result in scrub_event (#284)
  feat(config): Add a config value for thread counts (#283)
  fix: Refactor outcomes for parity with Sentry (#282)
  feat: Add an error boundary to parsing project states (#281)
  ...
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.

2 participants