Skip to content

Activity log showing undefined URLs for PR assignments, labels, and other actions #127

@jamesgeorge007

Description

@jamesgeorge007

There are certain scenarios where undefined links pop up in the README activity feed. For instance, here are some examples from my own profile:

In these commits, you can see entries like:

  • ❌ Assigned PR [#5485](undefined)
  • ❌ Labeled PR [#5425](undefined)
  • ❌ Closed PR [#5451](undefined)

The Problem:

The serializers for PullRequestEvent and IssuesEvent only handle a small subset of GitHub's event actions:

  • PullRequestEvent: Only checks for opened and merged state.

    PullRequestEvent: (item) => {
    const emoji = item.payload.action === "opened" ? "💪" : "❌";
    const line = item.payload.pull_request.merged
    ? "🎉 Merged"
    : `${emoji} ${capitalize(item.payload.action)}`;
    return `${line} PR ${toUrlFormat(item)} in ${toUrlFormat(item.repo.name)}`;
    },

  • IssuesEvent: Only handles opened, reopened, and closed

    IssuesEvent: (item) => {
    let emoji = "";
    switch (item.payload.action) {
    case "opened":
    emoji = "❗";
    break;
    case "reopened":
    emoji = "🔓";
    break;
    case "closed":
    emoji = "🔒";
    break;
    }
    return `${emoji} ${capitalize(item.payload.action)} issue ${toUrlFormat(
    item,
    )} in ${toUrlFormat(item.repo.name)}`;
    },

When other actions happen (like assigning, labelling, requesting reviews), the events still get processed, but end up with undefined URLs because we're not handling those action types properly.

What needs to be done:

This is a good opportunity for anyone looking to contribute! Here's the plan:

  1. Extend PullRequestEvent serializer to handle:

    • assigned / unassigned
    • labelled / unlabeled
    • review_requested / review_request_removed
    • closed (as distinct from merged)
    • edited
  2. Extend IssuesEvent serializer for:

    • assigned / unassigned
    • labelled / unlabeled
    • Maybe also pinned, locked, transferred, etc.
  3. Add graceful fallback - Either filter out unrecognised actions or show them with a generic format instead of producing broken output

Technical details:

Acceptance criteria:

  • No more undefined URLs in activity output
  • Common PR actions display with appropriate emojis and formatting
  • Common issue actions display with appropriate emojis and formatting
  • Unhandled actions either filtered out or shown with fallback format
  • Consistent with existing message style

Most of the work will be in the serializers object starting around index.js:133. Pick emojis that make sense and keep the messages concise!

If you want to take this on, drop a comment, and I'm happy to help out as you work through it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions