Skip to content

Commit 4e5d80e

Browse files
Rename input / output Files (#40)
* Rename config files and outputs * Remove pd901 * Use constant for default input name * Daily extraction file
1 parent a857122 commit 4e5d80e

13 files changed

Lines changed: 20 additions & 19 deletions

.github/workflows/daily_collection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
uv run gitmetrics collect -q \
2727
--add-metrics \
28-
--config-file daily.yaml \
28+
--config-file daily_extraction_config.yaml \
2929
--token ${{ secrets.GITHUB_TOKEN }} \
3030
--output-folder ${{ secrets.OUTPUT_FOLDER }}
3131
env:

.github/workflows/daily_summarize.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
cd sdv-dev.github.io
4141
git config --local user.name "github-actions[bot]"
4242
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
43-
git add --force assets/GitHub_Summary.xlsx
43+
git add --force assets/gitmetrics_growth_summary.xlsx
4444
git commit -m "Upload GitHub Summary - $(date '+%Y-%m-%d %H:%M:%S')"
4545
git remote set-url origin https://sdv-team:${{ secrets.GH_TOKEN }}@github.com/sdv-dev/sdv-dev.github.io
4646
git push origin gatsby-home

.github/workflows/traffic_collection.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Collect GitHub Traffic Data
2424
run: |
2525
uv run gitmetrics traffic \
26-
--config-file traffic_config.yaml \
26+
--config-file traffic_project_definitions.yaml \
2727
--token ${{ secrets.GH_TOKEN }} \
2828
--output-folder ${{ secrets.OUTPUT_FOLDER }}
2929
env:

.github/workflows/weekly_collection.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ jobs:
2424
run: |
2525
uv run gitmetrics collect -q \
2626
--add-metrics \
27-
--config-file weekly.yaml \
27+
--config-file weekly_extraction_config.yaml \
2828
--token ${{ secrets.GITHUB_TOKEN }} \
2929
--output-folder ${{ secrets.OUTPUT_FOLDER }}
3030
env:
3131
PYDRIVE_CREDENTIALS: ${{ secrets.PYDRIVE_CREDENTIALS }}
3232
- name: Consolidate GitHub Data
3333
run: |
3434
uv run gitmetrics consolidate \
35-
--config-file weekly.yaml \
35+
--config-file weekly_extraction_config.yaml \
3636
--output-folder ${{ secrets.OUTPUT_FOLDER }}
3737
env:
3838
PYDRIVE_CREDENTIALS: ${{ secrets.PYDRIVE_CREDENTIALS }}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Collect metrics from GitHub by running `gitmetrics` on your computer. You need t
6565

6666
1. A GitHub Token. Documentation about how to create a Personal Access Token can be found
6767
[here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
68-
2. A list of GitHub Repositories for which to collect the metrics, defined in a YAML file. The repositories need to be given as `{org-name}/{repo-name}`, (e.g. `sdv-dev/SDV`). See [daily.yaml](./daily.yaml) for an example.
68+
2. A list of GitHub Repositories for which to collect the metrics, defined in a YAML file. The repositories need to be given as `{org-name}/{repo-name}`, (e.g. `sdv-dev/SDV`). See [daily_summarization_config.yaml](./daily_summarization_config.yaml) for an example.
6969
3. (__Optional__) A filename where the output will be stored. If a name containing the `.xlsx`
7070
extension is given (like `path/to/my-filename.xlsx`), it will be used as provided.
7171
Otherwise, a filename will be created as `github-metrics-{name}-{today}.xlsx` within
@@ -77,7 +77,7 @@ Collect metrics from GitHub by running `gitmetrics` on your computer. You need t
7777
You can run gitmetrics with the following CLI command:
7878

7979
```shell
80-
gitmetrics collect --token {GITHUB_TOKEN} --add-metrics --config-file daily.yaml
80+
gitmetrics collect --token {GITHUB_TOKEN} --add-metrics --config-file daily_summarization_config.yaml
8181
```
8282

8383
## Google Drive Integration
@@ -94,6 +94,6 @@ GitMetrics is capable of reading and writing results in Google Spreadsheets. The
9494
- See [instructions from PyDrive](https://pythonhosted.org/PyDrive/quickstart.html).
9595

9696
## Workflows
97-
1. **Weekly Collection**: On a weekly basis, this workflow collects GitHub metrics for the repositories defined in [weekly.yaml](./weekly.yaml).
98-
2. **Daily Collection**: On a daily basis, this workflow collects GitHub metrics for the repositories defined in [daily.yaml](./daily.yaml).
99-
3. **Daily Summarize**: On a daily basis, this workflow summarizes the GitHub metrics (from the daily collection). The summarized data is published to a GitHub repo: [GitHub_Summary.xlsx](https://github.com/sdv-dev/sdv-dev.github.io/blob/gatsby-home/assets/GitHub_Summary.xlsx)
97+
1. **Weekly Collection**: On a weekly basis, this workflow collects GitHub metrics for the repositories defined in [weekly_extraction_config.yaml](./weekly_extraction_config.yaml).
98+
2. **Daily Collection**: On a daily basis, this workflow collects GitHub metrics for the repositories defined in [daily_summarization_config.yaml](./daily_summarization_config.yaml).
99+
3. **Daily Summarize**: On a daily basis, this workflow summarizes the GitHub metrics (from the daily collection). The summarized data is published to a GitHub repo: [gitmetrics_growth_summary.xlsx](https://github.com/sdv-dev/sdv-dev.github.io/blob/gatsby-home/assets/gitmetrics_growth_summary.xlsx)

daily.yaml renamed to daily_extraction_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import_config: config.yaml
1+
import_config: project_definitions.yaml
22
projects:
33
sdv-dev:
44
gretel:

gitmetrics/__main__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
LOGGER = logging.getLogger(__name__)
1717

18+
DEFAULT_PROJECT_DEFINITIONS = 'project_definitions.yaml'
19+
1820

1921
def _env_setup(logfile, verbosity):
2022
warnings.simplefilter('ignore')
@@ -195,7 +197,7 @@ def _get_parser():
195197
'-c',
196198
'--config-file',
197199
type=str,
198-
default='config.yaml',
200+
default=DEFAULT_PROJECT_DEFINITIONS,
199201
help='Path to the configuration file.',
200202
)
201203
collect.add_argument(
@@ -221,7 +223,7 @@ def _get_parser():
221223
'-c',
222224
'--config-file',
223225
type=str,
224-
default='config.yaml',
226+
default=DEFAULT_PROJECT_DEFINITIONS,
225227
help='Path to the configuration file.',
226228
)
227229
consolidate.add_argument(
@@ -249,7 +251,7 @@ def _get_parser():
249251
'-c',
250252
'--config-file',
251253
type=str,
252-
default='traffic_config.yaml',
254+
default='traffic_project_definitions.yaml',
253255
help='Path to the configuration file.',
254256
)
255257
traffic.add_argument(
@@ -273,7 +275,7 @@ def _get_parser():
273275
'-c',
274276
'--config-file',
275277
type=str,
276-
default='summarize_config.yaml',
278+
default='summarize_project_definitions.yaml',
277279
help='Path to the configuration file.',
278280
)
279281
summarize.add_argument(

gitmetrics/consolidate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
)
1515
from gitmetrics.output import create_spreadsheet, load_spreadsheet
1616

17-
OUTPUT_FILENAME = 'Consolidated_Overview'
17+
OUTPUT_FILENAME = 'gitmetrics_consolidated_summary_to_date'
1818
SHEET_NAME = 'Overview'
1919

2020
LOGGER = logging.getLogger(__name__)

gitmetrics/summarize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def summarize_metrics(
5555
The folder containing the location of the collected GitHub metrics.
5656
The folder must only contain spreadsheet (xlsx) files.
5757
The name of each file must match the `github_org` (lowercase) in
58-
summarize_config.yaml.
58+
summarize_project_definitions.yaml.
5959
The GitHub metrics are computed from the xlsx files in this folder.
6060
6161
dry_run (bool):

0 commit comments

Comments
 (0)