Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyaven committed Sep 11, 2023
1 parent 8065b38 commit 5301fdd
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 5 deletions.
42 changes: 38 additions & 4 deletions notebooks/github/sprint_reporting/github_sprint_reporting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"source": [
"\n",
"# show header\n",
"\n",
"owner = owner.value\n",
"repo = repo.value\n",
"header_text = f\"# Sprint {sprint_number.value}\\n\"\n",
"header_text += f\"#### {start_date.value} to {end_date.value}\\n\"\n",
"display(Markdown(header_text))"
Expand All @@ -29,15 +32,46 @@
"metadata": {},
"outputs": [],
"source": [
"\n",
"# get summary stats"
"%%stackql\n",
"SELECT \n",
"SUBSTRING(sha, 1, 7) as sha, \n",
"JSON_EXTRACT(commit, '$$.author.name') as author, \n",
"JSON_EXTRACT(commit, '$$.author.date') as date\n",
"FROM github.repos.commits\n",
"WHERE owner = '$owner' AND repo = '$repo'"
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%%stackql --no-display\n",
"SELECT login, contributions FROM github.repos.contributors WHERE owner = '$owner' AND repo = '$repo'"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"show_contributions(stackql_df)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Sprint Summary"
"%%stackql\n",
"SELECT \n",
"published_at,\n",
"target_commitish,\n",
"tag_name\n",
"FROM github.repos.releases WHERE owner = '$owner' AND repo = '$repo'"
]
}
],
Expand Down
35 changes: 34 additions & 1 deletion notebooks/github/sprint_reporting/includes/includes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"source": [
"import ipywidgets as widgets\n",
"from IPython.display import display, Markdown\n",
"import plotly.express as px\n",
"import sys\n",
"sys.path.append('/jupyter/ext')\n",
"import stackql\n",
Expand All @@ -20,6 +21,16 @@
"metadata": {},
"outputs": [],
"source": [
"owner = widgets.Text(\n",
" description='GitHub Owner',\n",
" disabled=False\n",
")\n",
"\n",
"repo = widgets.Text(\n",
" description='GitHub Repo',\n",
" disabled=False\n",
")\n",
"\n",
"sprint_number = widgets.IntSlider(\n",
" value=1,\n",
" min=1,\n",
Expand All @@ -45,7 +56,29 @@
"\n",
"display(sprint_number)\n",
"display(start_date)\n",
"display(end_date)"
"display(end_date)\n",
"display(owner)\n",
"display(repo)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n",
"def show_contributions(df):\n",
" fig = px.bar(df,\n",
" x='login',\n",
" y='contributions',\n",
" title='Contributions by User',\n",
" labels={'login': 'User Login', 'contributions': 'Number of Contributions'},\n",
" text='contributions')\n",
"\n",
" fig.update_layout(xaxis_tickangle=-45)\n",
"\n",
" fig.show()"
]
}
],
Expand Down

0 comments on commit 5301fdd

Please sign in to comment.