-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
news: Add scripts for generating weekly news (#288)
- Loading branch information
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# LXD Weekly News | ||
|
||
Scripts to generate a list of contributions for LXD weekly news within a specified time frame. | ||
|
||
## Usage | ||
|
||
To generate a weekly news template, replace `<from_date>` and `<to_date>` with dates in the `YYYY-MM-DD` format, then run the command: | ||
```sh | ||
weekly-changes.sh <from_date> <to_date> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/python3 | ||
|
||
import json | ||
import sys | ||
from urllib.parse import quote | ||
from urllib.request import urlopen | ||
|
||
# Convenience functions | ||
def get_json(url): | ||
return json.loads(urlopen(url).read().decode()) | ||
|
||
# Basic arg parsing | ||
if len(sys.argv) != 4: | ||
print("Usage: %s <repo> <date_start> <date_end>", sys.argv[0]) | ||
sys.exit(1) | ||
|
||
repo = sys.argv[1] | ||
start = sys.argv[2] | ||
end = sys.argv[3] | ||
|
||
# Get data | ||
|
||
url = "https://api.github.com/search/issues?q=repo:%s+is:merged+is:pr+merged:%s..%s&per_page=100&sort=created&order=asc" % (repo, start, end) | ||
|
||
prs = get_json(url) | ||
|
||
if len(prs["items"]) <= 0: | ||
print("* Nothing to report this week") | ||
|
||
for pr in prs["items"]: | ||
print(" - [%s](%s)" % (pr["title"], pr["html_url"])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Always from Monday to Sunday. | ||
DATESTART=$1 # YYYY-MM-DD | ||
DATEEND=$2 # YYYY-MM-DD | ||
|
||
if [ "${DATESTART}" = "" ] || [ "${DATEEND}" = "" ]; then | ||
echo "Usage: $0 <date_start> <date_end>" | ||
exit 1 | ||
fi | ||
|
||
# | ||
# Template that needs to be populated. | ||
# | ||
echo '**Weekly status for the week of <DD>th <MM> to <DD>th <MM>.**' | ||
|
||
echo -e "\n# Introduction" | ||
echo -e "\nA few sentences summarizing this week." | ||
|
||
echo -e "\n## Feature 1" | ||
echo -e "What it is? How to use it? Link to the docs" | ||
echo -e "Documentation: LINK" | ||
|
||
echo -e "\n## Feature 2" | ||
echo -e "What it is? How to use it? Link to the docs" | ||
echo -e "Documentation: LINK" | ||
|
||
echo -e "\n## Bugfixes" | ||
echo "- Fixed ..." | ||
echo "- Fixed ..." | ||
|
||
# | ||
# Generated, leave as is. | ||
# | ||
echo -e "\n## All changes" | ||
echo -e "\nThe items listed below is all of the work which happened over the past week and which will be included in the next release." | ||
|
||
echo -e "\n## LXD" | ||
./github-issues.py canonical/lxd "${1}" "${2}" | ||
sleep 1 | ||
|
||
echo -e "\n## LXD UI" | ||
./github-issues.py canonical/lxd-ui "${1}" "${2}" | ||
sleep 1 | ||
|
||
echo -e "\n## LXD Charm" | ||
./github-issues.py canonical/charm-lxd "${1}" "${2}" | ||
|
||
echo -e "\n# Distribution work" | ||
echo -e "\nThis section is used to track the work done in downstream Linux distributions to ship the latest LXD as well as work to get various software to work properly inside containers." | ||
|
||
echo -e "\n## Ubuntu" | ||
echo -e "* Nothing to report this week." | ||
|
||
echo -e "\n## LXD snap" | ||
./github-issues.py canonical/lxd-pkg-snap "${1}" "${2}" |