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

Add new GitHub parser called LabelUpdateEventParser. #9

Open
Tracked by #6
BURG3R5 opened this issue Oct 6, 2022 · 0 comments
Open
Tracked by #6

Add new GitHub parser called LabelUpdateEventParser. #9

BURG3R5 opened this issue Oct 6, 2022 · 0 comments
Labels
MEDIUM open-source-odyssey Issues for Open Source Odyssey participants

Comments

@BURG3R5
Copy link
Member

BURG3R5 commented Oct 6, 2022

This issue depends upon the issues #7 and #8 and thus can be only attempted after those issues are closed.

In this issue, you'll add a new GitHub parser class called LabelUpdateEventParser in the file bot/github/github_parsers.py. The data sent to us by GitHub for this event can be found here.

Step 1

Create LabelUpdateEventParser class.

For this step, you'll do the following:

  1. Create a class called LabelUpdateEventParser that inherits from EventParser and implements the static methods verify_payload and cast_payload_to_event just like the other parsers in the file.
  2. In the verify_payload method of this class, the condition should just check that event_type == "label". Nothing else is required.
  3. In the cast_payload_to_event method, event_type, repo and user should be assigned properly according to the other parsers. Then, label should be assigned to a Label object with the name and action being set to json["label"]["name"] and json["action"], respectively.

Step 2

Update list in parse method

For this step, all you need to do is go to the list event_parsers inside the parse method inside the GitHubPayloadParser class, and then add LabelUpdateEventParser at the end of the list.

This issue is a part of a bigger issue (#6).
Leave a comment if you have any doubts.

@BURG3R5 BURG3R5 mentioned this issue Oct 6, 2022
4 tasks
@BURG3R5 BURG3R5 added MEDIUM open-source-odyssey Issues for Open Source Odyssey participants labels Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MEDIUM open-source-odyssey Issues for Open Source Odyssey participants
Projects
None yet
Development

No branches or pull requests

1 participant