Skip to content

Conversation

@EndBug
Copy link

@EndBug EndBug commented Oct 29, 2025

This PR brings a couple of fixes to the event parsing in the activity plugin:

  • commits have been removed from the PushEvent payload, so this is currently causing the plugin to fail. I've updated the code to get the commit data from the API instead.
  • Event parsing is performed before filtering for the event types that the user actually subscribed to: I've changed the code to perform the filter beforehand, allowing users to quickly exclude failing event types if there are other similar breaking changes in the API in the future

Closes #1759

//Made repository public
case "PublicEvent": {
return {type: "public", actor, timestamp, repo}
return {type:customType, actor, timestamp, repo}

Choose a reason for hiding this comment

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

Can you explain the rationale behind these changes? Seem unrelated to the stated goal of this PR.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah sure!

The activity plugin is not working because of an error that happens when parsing events of type PushEvent. The issue will occur even if the user is not interested in disaplying push events, because the filtering happens after the parsing

To make the plugin a bit more robust, I've decided to filter the events beforehand, by mapping the type first, then filtering, then parsing the events: that means that in the eventuality that the plugin breaks again for a certain type of events, the user could temporarily disable those to get the stats back running with just a config change, instead of having to wait for a patch.

To avoid having a mismatch I've moved the custom types to a single map

Copy link
Author

Choose a reason for hiding this comment

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

Btw, I've just updated the issue description and title: I opened this in a rush and was admittedly pretty poor 😅

@EndBug EndBug changed the title Fix bug in activity plugin Fix event parsing in activity plugin Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants