minder
minder copied to clipboard
Remove database use from handleRelevantRepositoryEvent
Summary
- Add Property.Equal - Comparing properties will be useful to check if a matching property is a subset of the retrieved properties.
- Add WithMatchProps to the HandleEntityAndDoMessage - We'll match the received entity on these properties
-
Don't forward entity if it doesn't match message.MatchProps - After receiving an entity, check if the
message.MatchPropsmap is set. If yes, make sure that it is a subset of the properties of the entity just received. If it is not, drop the message. This will allow us to restrict forwarding the message by properties set by the caller. - Use the handler forwarding to evaluate repository/meta messages - Instead of fetching the repo directly in the handler and forwarding to a handler, create a NewEntityRefreshAndDoMessage message and offload the entity processing to minder-core. This removes the last piece of the github webhook that was directly touching the database with the exception of looking up the github app installation.
Fixes: #4703
Change Type
- [ ] Bug fix (resolves an issue without affecting existing features)
- [ ] Feature (adds new functionality without breaking changes)
- [ ] Breaking change (may impact existing functionalities or require documentation updates)
- [ ] Documentation (updates or additions to documentation)
- [x] Refactoring or test improvements (no bug fixes or new functionality)
Testing
mostly unit tests + adding and removing repos
Review Checklist:
- [x] Reviewed my own code for quality and clarity.
- [ ] Added comments to complex or tricky code sections.
- [ ] Updated any affected documentation.
- [x] Included tests that validate the fix or feature.
- [ ] Checked that related changes are merged.
@JAORMX I think that rebasing #4704 onto this PR will make your tests work.