Skip to content
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

Process PublicEvent properly #14

Closed
mattxwang opened this issue Oct 11, 2021 · 1 comment · Fixed by #19
Closed

Process PublicEvent properly #14

mattxwang opened this issue Oct 11, 2021 · 1 comment · Fixed by #19
Labels

Comments

@mattxwang
Copy link
Member

mattxwang commented Oct 11, 2021

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?"
    }
  },
@ansh-saini
Copy link
Contributor

Hi, can I work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants