Skip to content

Commit

Permalink
Track libs-team ACP age and activity
Browse files Browse the repository at this point in the history
also adds the ability to track issues instead of just prs
  • Loading branch information
pitaj committed Jan 30, 2023
1 parent 8ad6c89 commit 5889f81
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions data/rust-lang/libs-team/issue-acp-activity.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
is:open label:api-change-proposal updated:{{param|relative_date}},>1|today,3..1|last 3 days,7..4|last week,14..8|last 2 weeks,30..15|last month,90..31|last 3 months,180..91|last 6 months,<180|more than 6 months
2023-01-30,3,1,4,3,3,19,30,11
2 changes: 2 additions & 0 deletions data/rust-lang/libs-team/issue-acp-age.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
is:open label:api-change-proposal created:{{param|relative_date}},>1|today,3..1|last 3 days,7..4|last week,14..8|last 2 weeks,30..15|last month,90..31|last 3 months,180..91|last 6 months,<180|more than 6 months
2023-01-30,1,0,2,2,3,16,34,20
8 changes: 8 additions & 0 deletions libs-team.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: libs team
repo: rust-lang/libs-team
graphs:
issue-acp-activity: Last activity on ACPs
issue-acp-age: ACP creation dates
layout: graphs
---
5 changes: 4 additions & 1 deletion updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from pathlib import Path
import csv
import datetime
import json
Expand Down Expand Up @@ -67,7 +68,7 @@ def get_issues_count(http_session, repo, jinja_env, query, param):
param = param.split("|")[0]

query_tmpl = jinja_env.from_string(query)
query = "is:pr repo:{repo} {query}".format(
query = "repo:{repo} {query}".format(
repo=repo,
query=query_tmpl.render(param=param),
)
Expand Down Expand Up @@ -110,7 +111,9 @@ def update_csv_file(http_session, repo, path):
jinja_env = jinja2.Environment()
jinja_env.filters["relative_date"] = filter_relative_date

issue_type = Path(path).name.split("-", 1)[0]
query = content[0][0]
query = f"is:{issue_type} {query}"
for param in content[0][1:]:
content[1].append(str(get_issues_count(http_session, repo, jinja_env, query, param)))

Expand Down

0 comments on commit 5889f81

Please sign in to comment.