-
Notifications
You must be signed in to change notification settings - Fork 1
Feat(grouper): manual event grouping #382
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
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7b9c301
Imp(javascript): babel source map parsing (#373)
e11sy b2c8132
chore(javascript): add logs
e11sy cd417c1
deps(hawk/types): update to new version
e11sy 4e55825
feat(grouper): event grouping by pattern
e11sy e8664d7
test(grouper): cover pattern grouping with tests
e11sy a8e5dac
fix(grouper): remove cache key on event saving
e11sy 7311787
fix(): tests mock fixed
e11sy 86340c0
chore(grouper): remove redundant logs
e11sy 1a2911b
chore(grouper): move patterns to project object
e11sy 31adcba
update from master
e11sy 7710fc8
imp(grouper): cache getOriginalEvent db query
e11sy 00016eb
chore(grouper): lint fix
e11sy 95fdca0
fix(tests): fix getPatterns method
e11sy c9f5f4a
fix(grouper): fix findMatchingPattern method
e11sy bd2fb5a
imp(grouper): new testcases added
e11sy 039ce1f
imp(grouper): move pattern grouping to findSimilarEvent method
e11sy 4955ea4
imp(grouper): cache getProjectPatterns response
e11sy 8f83926
chore(): lint fixes
e11sy 42ceac4
deps(): update @hawk.so/types package version
e11sy 533587c
fix(tests): fix limiter tests
e11sy 9f9015a
fix(archiver): build fix
e11sy 9f9af6c
feat(migrations): create index on event.payload.title
e11sy f4eb16b
Merge branch 'stage' into manual-event-grouping
e11sy a4bd447
remove duplicated code
e11sy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
migrations/20241111000000-add-payload-title-index-for-events.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /** | ||
| * This migration creates indexes for all collections on payload.title field | ||
| */ | ||
|
|
||
| /** | ||
| * Index name for payload.title field | ||
| */ | ||
| const payloadTitleIndexName = 'payloadTitle'; | ||
|
|
||
| module.exports = { | ||
| async up(db) { | ||
| const collections = await db.listCollections({}, { | ||
| authorizedCollections: true, | ||
| nameOnly: true, | ||
| }).toArray(); | ||
|
|
||
| const targetCollections = []; | ||
|
|
||
| collections.forEach((collection) => { | ||
| if (/events/.test(collection.name)) { | ||
| targetCollections.push(collection.name); | ||
| } | ||
| }); | ||
|
|
||
| for (const collectionName of targetCollections) { | ||
| const hasIndexAlready = await db.collection(collectionName).indexExists(payloadTitleIndexName); | ||
|
|
||
| if (!hasIndexAlready) { | ||
| await db.collection(collectionName).createIndex({ | ||
| 'payload.title': 1, | ||
| }, { | ||
| name: payloadTitleIndexName, | ||
| }); | ||
| } | ||
| } | ||
| }, | ||
| async down(db) { | ||
| const collections = await db.listCollections({}, { | ||
| authorizedCollections: true, | ||
| nameOnly: true, | ||
| }).toArray(); | ||
|
|
||
| const targetCollections = []; | ||
|
|
||
| collections.forEach((collection) => { | ||
| if (/events/.test(collection.name)) { | ||
| targetCollections.push(collection.name); | ||
| } | ||
| }); | ||
|
|
||
| for (const collectionName of targetCollections) { | ||
| await db.collection(collectionName).dropIndex(payloadTitleIndexName); | ||
| } | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.