Skip to content

Process PublicEvent properly #14

Closed
@mattxwang

Description

@mattxwang

The PublicEvent occurs when someone makes a private repository public. This isn't too frequent, but it's also not uncommon. Thus, I'd like to display this properly on the live feed.

To resolve this, you'll need to:

  1. Inspect the structure of a PublicEvent; see the Activity API for GitHub's REST API, the Public Event, and the dump of the REST Endpoint that we hit
  2. Add a case statement for PublicEvent in GitHubEventAction.tsx
  3. Process the relevant parameters for the statement that we'd like to generate. I would like to see something like:
@mattxwang made uclaacm/website public

(which is hard, since the current component doesn't support this format, and thus would require a bit of refactoring. I'm open to this as well!)

or, more easily,

@mattxwang made a new repository public: uclaacm/website

Where the author and the repository are linked.

See #10 for a related issue and resolving PR!

Artifacts / Relevant Pointers

The relevant file is here:

function GitHubEventAction({type, payload}: GitHubEventActionProps): JSX.Element {

The current behaviour is here:

Screen Shot 2021-10-10 at 9 38 55 PM

And here is the JSON that renders those two events:

  {
    "id": "18372859076",
    "type": "PublicEvent",
    "actor": {
      "id": 8324381,
      "login": "uclaacm",
      "display_login": "uclaacm",
      "gravatar_id": "",
      "url": "https://api.github.com/users/uclaacm",
      "avatar_url": "https://avatars.githubusercontent.com/u/8324381?"
    },
    "repo": {
      "id": 389225887,
      "name": "uclaacm/studio-creative-tutorials-f21",
      "url": "https://api.github.com/repos/uclaacm/studio-creative-tutorials-f21"
    },
    "payload": {

    },
    "public": true,
    "created_at": "2021-10-11T03:26:36Z",
    "org": {
      "id": 8324381,
      "login": "uclaacm",
      "gravatar_id": "",
      "url": "https://api.github.com/orgs/uclaacm",
      "avatar_url": "https://avatars.githubusercontent.com/u/8324381?"
    }
  },
  {
    "id": "18372852273",
    "type": "PublicEvent",
    "actor": {
      "id": 8324381,
      "login": "uclaacm",
      "display_login": "uclaacm",
      "gravatar_id": "",
      "url": "https://api.github.com/users/uclaacm",
      "avatar_url": "https://avatars.githubusercontent.com/u/8324381?"
    },
    "repo": {
      "id": 387991465,
      "name": "uclaacm/studio-beginner-tutorials-f21",
      "url": "https://api.github.com/repos/uclaacm/studio-beginner-tutorials-f21"
    },
    "payload": {

    },
    "public": true,
    "created_at": "2021-10-11T03:25:37Z",
    "org": {
      "id": 8324381,
      "login": "uclaacm",
      "gravatar_id": "",
      "url": "https://api.github.com/orgs/uclaacm",
      "avatar_url": "https://avatars.githubusercontent.com/u/8324381?"
    }
  },

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions