Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
1aadeede
Unverified
Commit
1aadeede
authored
Jun 09, 2023
by
digger yu
Committed by
GitHub
Jun 09, 2023
Browse files
fix typo .github/workflows/scripts/ (#3946)
parent
e61ffc77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
.github/workflows/scripts/generate_leaderboard_and_send_to_lark.py
...orkflows/scripts/generate_leaderboard_and_send_to_lark.py
+7
-7
No files found.
.github/workflows/scripts/generate_leaderboard_and_send_to_lark.py
View file @
1aadeede
...
@@ -38,7 +38,7 @@ def plot_bar_chart(x: List[Any], y: List[Any], xlabel: str, ylabel: str, title:
...
@@ -38,7 +38,7 @@ def plot_bar_chart(x: List[Any], y: List[Any], xlabel: str, ylabel: str, title:
def
get_issue_pull_request_comments
(
github_token
:
str
,
since
:
str
)
->
Dict
[
str
,
int
]:
def
get_issue_pull_request_comments
(
github_token
:
str
,
since
:
str
)
->
Dict
[
str
,
int
]:
"""
"""
Retrive the issue/PR comments made by our members in the last 7 days.
Retri
e
ve the issue/PR comments made by our members in the last 7 days.
Args:
Args:
github_token (str): GitHub access token for API calls
github_token (str): GitHub access token for API calls
...
@@ -89,7 +89,7 @@ def get_issue_pull_request_comments(github_token: str, since: str) -> Dict[str,
...
@@ -89,7 +89,7 @@ def get_issue_pull_request_comments(github_token: str, since: str) -> Dict[str,
def
get_discussion_comments
(
github_token
,
since
)
->
Dict
[
str
,
int
]:
def
get_discussion_comments
(
github_token
,
since
)
->
Dict
[
str
,
int
]:
"""
"""
Retrive the discussion comments made by our members in the last 7 days.
Retri
e
ve the discussion comments made by our members in the last 7 days.
This is only available via the GitHub GraphQL API.
This is only available via the GitHub GraphQL API.
Args:
Args:
...
@@ -194,7 +194,7 @@ def get_discussion_comments(github_token, since) -> Dict[str, int]:
...
@@ -194,7 +194,7 @@ def get_discussion_comments(github_token, since) -> Dict[str, int]:
discussion_updated_at
=
datetime
.
strptime
(
discussion
[
'updatedAt'
],
"%Y-%m-%dT%H:%M:%SZ"
)
discussion_updated_at
=
datetime
.
strptime
(
discussion
[
'updatedAt'
],
"%Y-%m-%dT%H:%M:%SZ"
)
# check if the updatedAt is within the last 7 days
# check if the updatedAt is within the last 7 days
# if yes, add it to dicussion_numbers
# if yes, add it to di
s
cussion_numbers
if
discussion_updated_at
>
since
:
if
discussion_updated_at
>
since
:
if
discussion
[
'authorAssociation'
]
!=
'MEMBER'
:
if
discussion
[
'authorAssociation'
]
!=
'MEMBER'
:
discussion_numbers
.
append
(
discussion
[
'number'
])
discussion_numbers
.
append
(
discussion
[
'number'
])
...
@@ -207,14 +207,14 @@ def get_discussion_comments(github_token, since) -> Dict[str, int]:
...
@@ -207,14 +207,14 @@ def get_discussion_comments(github_token, since) -> Dict[str, int]:
# update cursor
# update cursor
cursor
=
edges
[
-
1
][
'cursor'
]
cursor
=
edges
[
-
1
][
'cursor'
]
# get the dicussion comments and replies made by our member
# get the di
s
cussion comments and replies made by our member
user_engagement_count
=
{}
user_engagement_count
=
{}
for
dicussion_number
in
discussion_numbers
:
for
di
s
cussion_number
in
discussion_numbers
:
cursor
=
None
cursor
=
None
num_per_request
=
10
num_per_request
=
10
while
True
:
while
True
:
query
=
_generate_comment_reply_count_for_discussion
(
dicussion_number
,
num_per_request
,
cursor
)
query
=
_generate_comment_reply_count_for_discussion
(
di
s
cussion_number
,
num_per_request
,
cursor
)
data
=
_call_graphql_api
(
query
)
data
=
_call_graphql_api
(
query
)
# get the comments
# get the comments
...
@@ -249,7 +249,7 @@ def get_discussion_comments(github_token, since) -> Dict[str, int]:
...
@@ -249,7 +249,7 @@ def get_discussion_comments(github_token, since) -> Dict[str, int]:
reply
=
reply_edge
[
'node'
]
reply
=
reply_edge
[
'node'
]
if
reply
[
'authorAssociation'
]
==
'MEMBER'
:
if
reply
[
'authorAssociation'
]
==
'MEMBER'
:
# check if the updatedAt is within the last 7 days
# check if the updatedAt is within the last 7 days
# if yes, add it to dicussion_numbers
# if yes, add it to di
s
cussion_numbers
reply_updated_at
=
datetime
.
strptime
(
reply
[
'updatedAt'
],
"%Y-%m-%dT%H:%M:%SZ"
)
reply_updated_at
=
datetime
.
strptime
(
reply
[
'updatedAt'
],
"%Y-%m-%dT%H:%M:%SZ"
)
if
reply_updated_at
>
since
:
if
reply_updated_at
>
since
:
member_name
=
reply
[
'author'
][
'login'
]
member_name
=
reply
[
'author'
][
'login'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment