You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this issue, you'll add a new model class Label and a new member label to the GitHubEvent class.
Step 1
Create new model class
For this step, you'll add a new model class Label in the folder bot/models/github/
First you'll create a new file in the folder, and name it label.py
Inside that file, you'll create a class called Label. This class will have two members: name and action. Both variables will be of the type str. You can refer to the Repository model for guidance.
Step 2
Update GitHubEvent model
For this step, you'll add a member to the GitHubEvent model present in the file bot/models/github/event.py
First you'll add a line below the line reviewers: Optional[list[User]] that declares a variable label with type Optional[Label].
Next you'll add an if statement below the line self.reviewers = kwargs["reviewers"] that confirms if there is a key "label" in the dictionary kwargs. If that is true, then you should assign kwargs["label"] to self.label.
This issue is a part of a bigger issue (#6).
Leave a comment if you have any doubts.
The text was updated successfully, but these errors were encountered:
In this issue, you'll add a new model class
Label
and a new memberlabel
to theGitHubEvent
class.Step 1
Create new model class
For this step, you'll add a new model class
Label
in the folderbot/models/github/
First you'll create a new file in the folder, and name it
label.py
Inside that file, you'll create a
class
calledLabel
. This class will have two members:name
andaction
. Both variables will be of the typestr
. You can refer to theRepository
model for guidance.Step 2
Update
GitHubEvent
modelFor this step, you'll add a member to the
GitHubEvent
model present in the filebot/models/github/event.py
First you'll add a line below the line
reviewers: Optional[list[User]]
that declares a variablelabel
with typeOptional[Label]
.Next you'll add an
if
statement below the lineself.reviewers = kwargs["reviewers"]
that confirms if there is a key"label"
in the dictionarykwargs
. If that is true, then you should assignkwargs["label"]
toself.label
.This issue is a part of a bigger issue (#6).
Leave a comment if you have any doubts.
The text was updated successfully, but these errors were encountered: