-
Notifications
You must be signed in to change notification settings - Fork 578
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
Evented architecture for moderation system #1617
Merged
Merged
Changes from all commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
5ea9064
:construction: WIP with proposed lexicons for event based mod archite…
foysalit 5445a6b
:construction: Remove unnecessary moderation action lexicon
foysalit 2b5801c
Merge branch 'main' of github.com:bluesky-social/atproto into moderat…
foysalit b62a397
:construction: Working on event based actions
foysalit 8781c87
:rightwards_twisted_arrows: Merge with upstream
foysalit 39a81fd
:sparkles: Add escalated subject status
foysalit 1637548
Merge branch 'main' of github.com:bluesky-social/atproto into moderat…
foysalit e1e09b3
:bug: Alright, fixed the error in lexicon
foysalit 619eed5
:construction: Working through reversal
foysalit c8c1a55
:sparkles: Cleanup build errors
foysalit dfc4fec
:sparkles: Add subject status endpoint
foysalit 75625a7
:sparkles: Add handler
foysalit a82d3d6
:sparkles: get reports from mod actions table
foysalit f734703
:rightwards_twisted_arrows: Merge with upstream
foysalit 2cc6f1d
:rightwards_twisted_arrows: Merge with upstream
foysalit f8b3b78
:construction: Builds but test network doesnt start
foysalit 84d79a8
:sparkles: Tests passing on event based status change
foysalit 6b652ef
:sparkles: Rename index
foysalit cc87dcb
:recycle: Rename takeModerationAction->emitModerationEvent
foysalit 10ee0e5
:sparkles: Implement label reversal
foysalit dacbb3f
:white_check_mark: Auto-revert test working
foysalit 5a9bdd9
:recycle: :white_check_mark: Refactored to event types and tests are …
foysalit ddce910
:sparkles: Add takedown event sequence validation
foysalit 164f391
:sparkles: Adds support for blobCid status
foysalit 82870ec
:broom: Cleanup unnecessary method:
foysalit 87364a8
:sparkles: Hydrate handles with status and events
foysalit 79f4c97
:sparkles: Re-implement auto reversal
foysalit a07f64f
:sparkles: Add takendown and mute filters
foysalit d71b910
:sparkles: Allow filtering events by type
foysalit aea0b55
:sparkles: Allow filtering events by creator did
foysalit afb9a8b
:sparkles: Add subjectStatus to record and repoview
foysalit cc756ad
:sparkles: Add persistent note feature
foysalit f5204b0
:sparkles: Log send email event
foysalit 23cea8e
:bug: Fix logging send email event
foysalit 85e8322
:sparkles: Better type
foysalit 3b0e41c
:sparkles: Adjust migration to create separate moderation_event table
foysalit 3b3a1a9
:broom: Cleanup types
foysalit 1ca8427
:white_check_mark: Adjust tests with mod event emitter
foysalit c442738
:rightwards_twisted_arrows: Merge with upstream
foysalit 9973b8e
:sparkles: Fix more tests around takedowns
foysalit 62ea6df
:white_check_mark: Get test suite to pass
foysalit efc4eaa
:white_check_mark: Get test suite to pass for pds
foysalit eb766bd
:white_check_mark: Get test suite to pass for pds
foysalit bda203d
:white_check_mark: Update snapshot for feedgen
foysalit aa9ac28
:white_check_mark: Why are more snapshots updating?
foysalit 226b87e
:recycle: Rename getModerationEvents -> queryModerationEvents
foysalit 8c1f026
:recycle: Rename getModerationStatuses -> queryModerationStatuses
foysalit 1ca527b
:recycle: Rename persistNote->sticky
foysalit be425b9
:bug: Rename subject
foysalit 677e2e8
:recycle: Cleanup expiresAt for scheduled actions
foysalit 902e6b4
:sparkles: Add more tests, allow fetching mod history for all content…
foysalit 96395e6
:white_check_mark: Fix repo and record tests
foysalit 49f381f
:sparkles: Migrate reports and actions to events
foysalit 39cf166
:bug: Fix escalated status overwrite
foysalit 1bf5acc
:sparkles: Implement direct sql query to create events from actions a…
foysalit 143e569
:construction: Adding keyset pagination for subject statuses
foysalit d220257
:sparkles: Add migration for lastReportedAt
foysalit 6e76210
:sparkles: Migrate blob cids
foysalit dc57dc8
:twisted_rightwards_arrows: Merge with upstream
foysalit 006e0dc
:sparkles: Fix pagination on mod subject list endpoint
foysalit 2792f9b
:bug: Fix blob actions
foysalit d44b683
:white_check_mark: All tests passing on bsky package
foysalit 6c034bd
:white_check_mark: Bring back snapshots
foysalit 741aef4
:white_check_mark: Skipping timeline test temporarily
foysalit f8a9bbe
:white_check_mark: Skipping some more tests to isolate failing ones
foysalit 554af17
Merge branch 'main' of github.com:bluesky-social/atproto into moderat…
foysalit 56f3a61
:white_check_mark: Bring back list-feed test
foysalit 90c8241
:white_check_mark: Bring back timeline test
foysalit e4bd6d6
:white_check_mark: Fix label action in seeding
foysalit 9f11c6c
:white_check_mark: Enable timeline proxied test
foysalit 2617b4d
:white_check_mark: Enable search actor proxied test
foysalit c25168f
:white_check_mark: Enable feedgen tests
foysalit bcb475e
:white_check_mark: Fix test for admin/get-record
foysalit 79b0473
:sparkles: Move note to comment for subject status
foysalit 954b523
:sparkles: Accept comments in mute event
foysalit e6e8416
:sparkles: Remap flag event to ack event
foysalit a608eb6
:bug: Add legacyRef in report union selection
foysalit 82fb94f
Merge remote-tracking branch 'origin/main' into moderation-api-v2
devinivy 31d1bb2
Merge branch 'moderation-api-v2' of github.com:bluesky-social/atproto…
devinivy a286b84
@atproto/api 0.6.24-next.0
devinivy a93a162
@atproto/api 0.6.24-next.1
devinivy 22bd5f0
:sparkles: Adjust migration export and add index for blobCids column
foysalit c3d0093
Merge branch 'moderation-api-v2' of github.com:bluesky-social/atproto…
foysalit 0d1eb3f
:sparkles: Maintin action ids when migrating
foysalit 404a42f
:sparkles: Paginate events using createdAt timestamp
foysalit 2d1f542
:white_check_mark: Update snapshot for pds test with events cursor up…
foysalit 91d32d4
:white_check_mark: Use only events for snapshot testing
foysalit 006372f
:white_check_mark: Use only events for snapshot in the remaining test
foysalit a2e6ea6
relative paths to lexicons for build
devinivy d21b3d9
fix bsky periodic event reversal in service entrypoint
devinivy 0697ffc
:sparkles: Allow comments in takedown and label
foysalit 99aef0a
:sparkles: Only import reports on consecutive run of the migration sc…
foysalit 655fe09
:sparkles: Adjust moderation property of blob entries
foysalit d69bb10
determine latest reports to migrate
devinivy 48253a8
:sparkles: Process new reports for subject status
foysalit a8b95bf
:sparkles: Process unresolved reports on first migration run
foysalit c75131f
fix transaction error, process just unresolved reports, make reported…
devinivy 9eebb90
tidy
devinivy 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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,60 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "com.atproto.admin.queryModerationEvents", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "List moderation events related to a subject.", | ||
"parameters": { | ||
"type": "params", | ||
"properties": { | ||
"types": { | ||
"type": "array", | ||
"items": { "type": "string" }, | ||
"description": "The types of events (fully qualified string in the format of com.atproto.admin#modEvent<name>) to filter by. If not specified, all events are returned." | ||
}, | ||
"createdBy": { | ||
"type": "string", | ||
"format": "did" | ||
}, | ||
"sortDirection": { | ||
"type": "string", | ||
"default": "desc", | ||
"enum": ["asc", "desc"], | ||
"description": "Sort direction for the events. Defaults to descending order of created at timestamp." | ||
}, | ||
"subject": { "type": "string", "format": "uri" }, | ||
"includeAllUserRecords": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "If true, events on all record types (posts, lists, profile etc.) owned by the did are returned" | ||
}, | ||
"limit": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 100, | ||
"default": 50 | ||
}, | ||
"cursor": { "type": "string" } | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["events"], | ||
"properties": { | ||
"cursor": { "type": "string" }, | ||
"events": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "com.atproto.admin.defs#modEventView" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains 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,95 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "com.atproto.admin.queryModerationStatuses", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "View moderation statuses of subjects (record or repo).", | ||
"parameters": { | ||
"type": "params", | ||
"properties": { | ||
"subject": { "type": "string", "format": "uri" }, | ||
"comment": { | ||
"type": "string", | ||
"description": "Search subjects by keyword from comments" | ||
}, | ||
"reportedAfter": { | ||
"type": "string", | ||
"format": "datetime", | ||
"description": "Search subjects reported after a given timestamp" | ||
}, | ||
"reportedBefore": { | ||
"type": "string", | ||
"format": "datetime", | ||
"description": "Search subjects reported before a given timestamp" | ||
}, | ||
"reviewedAfter": { | ||
"type": "string", | ||
"format": "datetime", | ||
"description": "Search subjects reviewed after a given timestamp" | ||
}, | ||
"reviewedBefore": { | ||
"type": "string", | ||
"format": "datetime", | ||
"description": "Search subjects reviewed before a given timestamp" | ||
}, | ||
"includeMuted": { | ||
"type": "boolean", | ||
"description": "By default, we don't include muted subjects in the results. Set this to true to include them." | ||
}, | ||
"reviewState": { | ||
"type": "string", | ||
"description": "Specify when fetching subjects in a certain state" | ||
}, | ||
"ignoreSubjects": { | ||
"type": "array", | ||
"items": { "type": "string", "format": "uri" } | ||
}, | ||
"lastReviewedBy": { | ||
"type": "string", | ||
"format": "did", | ||
"description": "Get all subject statuses that were reviewed by a specific moderator" | ||
}, | ||
"sortField": { | ||
"type": "string", | ||
"default": "lastReportedAt", | ||
"enum": ["lastReviewedAt", "lastReportedAt"] | ||
}, | ||
"sortDirection": { | ||
"type": "string", | ||
"default": "desc", | ||
"enum": ["asc", "desc"] | ||
}, | ||
"takendown": { | ||
"type": "boolean", | ||
"description": "Get subjects that were taken down" | ||
}, | ||
"limit": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 100, | ||
"default": 50 | ||
}, | ||
"cursor": { "type": "string" } | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["subjectStatuses"], | ||
"properties": { | ||
"cursor": { "type": "string" }, | ||
"subjectStatuses": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "com.atproto.admin.defs#subjectStatusView" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed here that blobs (
subjectBlobCids
) are handled separately fromsubject
. One idea that came-up which I quite liked is to make it more uniform, i.e. making a blob within a user's repository another kind of subject. CC @dholms since it's dovetails with the work he did with e.g.com.atproto.admin.updateSubjectStatus
where the subjects look like this: