Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/daily_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
uv run gitmetrics collect -q \
--add-metrics \
--config-file daily.yaml \
--config-file daily_extraction_config.yaml \
--token ${{ secrets.GITHUB_TOKEN }} \
--output-folder ${{ secrets.OUTPUT_FOLDER }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/daily_summarize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
cd sdv-dev.github.io
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --force assets/GitHub_Summary.xlsx
git add --force assets/gitmetrics_growth_summary.xlsx
git commit -m "Upload GitHub Summary - $(date '+%Y-%m-%d %H:%M:%S')"
git remote set-url origin https://sdv-team:${{ secrets.GH_TOKEN }}@github.com/sdv-dev/sdv-dev.github.io
git push origin gatsby-home
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/traffic_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Collect GitHub Traffic Data
run: |
uv run gitmetrics traffic \
--config-file traffic_config.yaml \
--config-file traffic_project_definitions.yaml \
--token ${{ secrets.GH_TOKEN }} \
--output-folder ${{ secrets.OUTPUT_FOLDER }}
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/weekly_collection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
run: |
uv run gitmetrics collect -q \
--add-metrics \
--config-file weekly.yaml \
--config-file weekly_extraction_config.yaml \
--token ${{ secrets.GITHUB_TOKEN }} \
--output-folder ${{ secrets.OUTPUT_FOLDER }}
env:
PYDRIVE_CREDENTIALS: ${{ secrets.PYDRIVE_CREDENTIALS }}
- name: Consolidate GitHub Data
run: |
uv run gitmetrics consolidate \
--config-file weekly.yaml \
--config-file weekly_extraction_config.yaml \
--output-folder ${{ secrets.OUTPUT_FOLDER }}
env:
PYDRIVE_CREDENTIALS: ${{ secrets.PYDRIVE_CREDENTIALS }}
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Collect metrics from GitHub by running `gitmetrics` on your computer. You need t

1. A GitHub Token. Documentation about how to create a Personal Access Token can be found
[here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
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.
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.
3. (__Optional__) A filename where the output will be stored. If a name containing the `.xlsx`
extension is given (like `path/to/my-filename.xlsx`), it will be used as provided.
Otherwise, a filename will be created as `github-metrics-{name}-{today}.xlsx` within
Expand All @@ -77,7 +77,7 @@ Collect metrics from GitHub by running `gitmetrics` on your computer. You need t
You can run gitmetrics with the following CLI command:

```shell
gitmetrics collect --token {GITHUB_TOKEN} --add-metrics --config-file daily.yaml
gitmetrics collect --token {GITHUB_TOKEN} --add-metrics --config-file daily_summarization_config.yaml
```

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

## Workflows
1. **Weekly Collection**: On a weekly basis, this workflow collects GitHub metrics for the repositories defined in [weekly.yaml](./weekly.yaml).
2. **Daily Collection**: On a daily basis, this workflow collects GitHub metrics for the repositories defined in [daily.yaml](./daily.yaml).
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)
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).
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).
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)
2 changes: 1 addition & 1 deletion daily.yaml → daily_extraction_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import_config: config.yaml
import_config: project_definitions.yaml
projects:
sdv-dev:
gretel:
Expand Down
File renamed without changes.
10 changes: 6 additions & 4 deletions gitmetrics/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

LOGGER = logging.getLogger(__name__)

DEFAULT_PROJECT_DEFINITIONS = 'project_definitions.yaml'


def _env_setup(logfile, verbosity):
warnings.simplefilter('ignore')
Expand Down Expand Up @@ -195,7 +197,7 @@ def _get_parser():
'-c',
'--config-file',
type=str,
default='config.yaml',
default=DEFAULT_PROJECT_DEFINITIONS,
help='Path to the configuration file.',
)
collect.add_argument(
Expand All @@ -221,7 +223,7 @@ def _get_parser():
'-c',
'--config-file',
type=str,
default='config.yaml',
default=DEFAULT_PROJECT_DEFINITIONS,
help='Path to the configuration file.',
)
consolidate.add_argument(
Expand Down Expand Up @@ -249,7 +251,7 @@ def _get_parser():
'-c',
'--config-file',
type=str,
default='traffic_config.yaml',
default='traffic_project_definitions.yaml',
help='Path to the configuration file.',
)
traffic.add_argument(
Expand All @@ -273,7 +275,7 @@ def _get_parser():
'-c',
'--config-file',
type=str,
default='summarize_config.yaml',
default='summarize_project_definitions.yaml',
help='Path to the configuration file.',
)
summarize.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion gitmetrics/consolidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
)
from gitmetrics.output import create_spreadsheet, load_spreadsheet

OUTPUT_FILENAME = 'Consolidated_Overview'
OUTPUT_FILENAME = 'gitmetrics_consolidated_summary_to_date'
SHEET_NAME = 'Overview'

LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion gitmetrics/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def summarize_metrics(
The folder containing the location of the collected GitHub metrics.
The folder must only contain spreadsheet (xlsx) files.
The name of each file must match the `github_org` (lowercase) in
summarize_config.yaml.
summarize_project_definitions.yaml.
The GitHub metrics are computed from the xlsx files in this folder.

dry_run (bool):
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ ignore = [
# pydocstyle
"D107", # Missing docstring in __init__
"D417", # Missing argument descriptions in the docstring, this is a bug from pydocstyle: https://github.com/PyCQA/pydocstyle/issues/449
"PD901",
"PD101",
]

Expand Down
2 changes: 1 addition & 1 deletion weekly.yaml → weekly_extraction_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import_config: config.yaml
import_config: project_definitions.yaml
projects:
PyTorchLightning:
airbyte:
Expand Down
Loading