Skip to content

Commit e02c2ce

Browse files
committed
Refactored data pushes to CCOS to use a single script.
1 parent 3e29e2a commit e02c2ce

File tree

19 files changed

+207
-596
lines changed

19 files changed

+207
-596
lines changed

.github/workflows/community_teams_list_page.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/generate_projects_page.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/search_roadmap_export.yml renamed to .github/workflows/push_data_to_ccos.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Generate Community Team Members Page
1+
name: Push data to CC Open Source
22
on:
33
schedule:
44
- cron: '0 0 * * *'
55
push:
66
branches:
77
- master
8+
- refactor_ccos_updates
89
jobs:
910
build:
1011
runs-on: ubuntu-latest
@@ -18,12 +19,12 @@ jobs:
1819
run: |
1920
python -m pip install --upgrade pip
2021
python -m pip install pipenv
21-
cd search_roadmap_export
22+
cd push_data_to_ccos
2223
pipenv install
2324
- name: Export token to env and run script
2425
run: |
25-
cd search_roadmap_export
26-
pipenv run python search_roadmap_export.py
26+
cd push_data_to_ccos
27+
pipenv run python sync.py
2728
env:
2829
ADMIN_GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
2930
ADMIN_ASANA_TOKEN: ${{ secrets.ADMIN_ASANA_TOKEN }}

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,25 @@ information about that script.
1212
| Directory Name | Script Purpose |
1313
| --------------------------------- | ------------------------------------------------------------------------------- |
1414
| [`normalize_repos`][norm] | Ensures that all CC repos have standard labels and branch protections |
15-
| [`generate_projects_page`][proj] | Generates the ["Projects" page on CC Open Source][osproj] |
16-
| [`community_teams_list_page`][ct] | Generates the ["Community Teams Members" page on CC Open Source][ctlistpage] |
17-
| [`search_roadmap_export`][search] | Exports the `CC Search Roadmap` Asana project to opensource.creativecommons.org |
15+
| [`push_data_to_ccos`][push_to_ccos] | Generates various pages with dynamic data on [CC Open Source][ccos] |
1816

1917

2018
## Workflows
2119
| YML File Name | Workflow Purpose |
2220
| -------------------------------- | --------------------------------------------------------------------- |
2321
| [`add_community_pr.yml`][community_pr_yml] | Runs hourly at 5 minutes past every hour UTC and add community PRs to [Active Sprint – CC Search](https://github.com/orgs/creativecommons/projects/7) |
24-
| [`community_teams_list_page.yml`][community_teams_yml] | Runs daily at 00:00 UTC and whenever someone pushes to master branch and uses [`community_teams_list_page`][ct] |
25-
| [`generate_projects_page.yml`][gen_proj_yml] | Runs daily at 00:00 UTC and whenever someone pushes to master branch and uses [`generate_projects_page`][proj] |
2622
| [`normalize_repos.yml`][norm_pr_yml] | Runs daily at 00:00 UTC and whenever someone pushes to master branch and uses [`normalize_repos`][norm] |
27-
| [`search_roadmap_export.yml`][search_roadmap_yml] | Runs daily at 00:00 UTC and whenever someone pushes to master branch and uses [`search_roadmap_export`][search] |
23+
| [`push_data_to_ccos.yml`][push_ccos_yml] | Runs daily at 00:00 UTC and whenever someone pushes to master branch and uses [`push_data_to_ccos`][push_to_ccos] |
2824

2925

3026
[community_pr_yml]:.github/workflows/add_community_pr.yml
31-
[community_teams_yml]:.github/workflows/community_teams_list_page.yml
32-
[gen_proj_yml]:.github/workflows/generate_projects_page.yml
3327
[norm_pr_yml]:.github/workflows/normalize_repos.yml
34-
[search_roadmap_yml]:.github/workflows/search_roadmap_export.yml
28+
[push_ccos_yml]:.github/workflows/push_data_to_ccos.yml
3529

36-
[ct]: community_teams_list_page/
3730
[norm]:normalize_repos/
38-
[proj]:generate_projects_page/
39-
[search]:search_roadmap_export/
40-
41-
[ctlistpage]: httpe://opensource.creativecommons.org/community/community-teams/members
42-
[osproj]:https://opensource.creativecommons.org/contributing-code/projects/
31+
[push_to_ccos]:push_data_to_ccos/
4332

33+
[ccos]: httpe://opensource.creativecommons.org/
4434

4535

4636
## License

community_teams_list_page/Pipfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

community_teams_list_page/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

generate_projects_page/Pipfile

Lines changed: 0 additions & 35 deletions
This file was deleted.

generate_projects_page/README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

search_roadmap_export/Pipfile renamed to push_data_to_ccos/Pipfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ verify_ssl = true
66
[dev-packages]
77

88
[packages]
9-
pygithub = "*"
109
asana = "*"
10+
pygithub = "*"
1111
gitpython = "*"
12+
emoji = "*"
13+
pyyaml = "*"
1214

1315
[requires]
1416
python_version = "3.7"

community_teams_list_page/Pipfile.lock renamed to push_data_to_ccos/Pipfile.lock

Lines changed: 25 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

push_data_to_ccos/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Push Data to CCOS
2+
3+
This folder contains a script that pushes the latest version of dynamically generated data to CC Open Source. This data updates the following pages:
4+
* [CC Search page on CC Open Source][ccsearch] (roadmap portion)
5+
* [Community Team Members page on CC Open Source][ctlistpage]
6+
* [Projects page on CC Open Source][osproj].
7+
8+
[ccsearch]: https://opensource.creativecommons.org/cc-search/
9+
[ctlistpage]: httpe://opensource.creativecommons.org/community/community-teams/members/
10+
[osproj]:https://opensource.creativecommons.org/contributing-code/projects/
11+
12+
This script is run via GitHub Actions automatically.
13+
14+
## Running the Script
15+
16+
1. Install [Pipenv](https://pipenv.readthedocs.io/en/latest/)
17+
2. Navigate to the `push_data_to_ccos` folder and run `pipenv install`
18+
3. Set the `ADMIN_GITHUB_TOKEN` environment variable with your GitHub token. You will need a GitHub token with admin permissions to the `creativecommons` GitHub organization.
19+
4. Set the ADMIN_ASANA_TOKEN environment variable with your Asana token. You will need an Asana token with access to the Creative Commons Asana organization.
20+
5. Run the script: `python3 sync_data.py`
21+
22+
## About the Code
23+
24+
### Repository data
25+
26+
Repository data is generated in `get_repo_data.py` and pulls data on CC repositories using the GitHub API.
27+
28+
### CC Search Roadmap Data
29+
30+
Repository data is generated in `get_search_roadmap_data.py`. This pulls tasks from the `CC Search Roadmap` Asana project in CC's Asana organization,
31+
does some basic cleaning and filtering, and adds the tasks to a template.
32+
33+
### Community Team Data
34+
35+
Community Team member data is generated from the `Community Teams Tracking` Asana project in CC's Asana organization.
36+
37+
### Pushing to GitHub
38+
39+
Data is pushed to the `[creativecommons.github.io-source](https://github.com/creativecommons/creativecommons.github.io-source)` repository in the `push_data_via_git.py` file.
40+
41+
42+
## Repository README
43+
44+
See repository README for licensing information, etc:
45+
- [`../README.md`](../README.md)

0 commit comments

Comments
 (0)