Skip to content

Commit

Permalink
Move automations into their own directory; update README (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
zackkrida authored Mar 30, 2022
1 parent a44c229 commit 5130502
Show file tree
Hide file tree
Showing 37 changed files with 45 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/label_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:
python-version: "3.10"

- name: Install dependencies
working-directory: ./python
working-directory: ./automations/python
run: |
python -m pip install --user --upgrade pip
python -m pip install --user pipenv
pipenv install --deploy
- name: Label PR
working-directory: ./python
working-directory: ./automations/python
run: |
pipenv run python label_pr.py \
--pr-url $PR_URL
4 changes: 2 additions & 2 deletions .github/workflows/label_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
python-version: "3.10"

- name: Install dependencies
working-directory: ./python
working-directory: ./automations/python
run: |
python -m pip install --user --upgrade pip
python -m pip install --user pipenv
pipenv install --deploy
- name: Sync standard labels
working-directory: ./python
working-directory: ./automations/python
run: |
pipenv run python sync_labels.py
6 changes: 3 additions & 3 deletions .github/workflows/pr_project_automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ jobs:
python-version: "3.10"

- name: Install dependencies
working-directory: ./python
working-directory: ./automations/python
run: |
python -m pip install --user --upgrade pip
python -m pip install --user pipenv
pipenv install --deploy
- name: Clear PRs in "Merged!"
working-directory: ./python
working-directory: ./automations/python
run: |
pipenv run python archive_column.py \
--project-number 8 \
--column 'Merged!'
- name: Clear PRs in "Closed"
working-directory: ./python
working-directory: ./automations/python
run: |
pipenv run python archive_column.py \
--project-number 8 \
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/project_automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ jobs:
python-version: "3.10"

- name: Install dependencies
working-directory: ./python
working-directory: ./automations/python
run: |
python -m pip install --user --upgrade pip
python -m pip install --user pipenv
pipenv install --deploy
- name: Move issues from "To do"
working-directory: ./python
working-directory: ./automations/python
run: |
pipenv run python issues_with_prs.py \
--project-number 3 \
--source-column "To do" \
--target-column "In progress"
- name: Move issues from "Backlog"
working-directory: ./python
working-directory: ./automations/python
run: |
pipenv run python issues_with_prs.py \
--project-number 3 \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/weekly_updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
node-version: 14

- name: Install dependencies
working-directory: ./js
working-directory: ./automations/js
run: npm ci

- name: Create draft post
working-directory: ./js
working-directory: ./automations/js
run: node src/last_week_tonight.js
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ repos:
rev: 3.9.2
hooks:
- id: flake8
args:
- --config=automations/.flake8

- repo: https://github.com/ambv/black
rev: 21.6b0
rev: 22.3.0
hooks:
- id: black
args:
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ to the project with our

## Repository structure

- **`python/`:** This directory contains scripts written in Python.
- Use this as the working directory when executing Python scripts.
- Requires [Pipenv](https://pipenv.pypa.io) as the package manager.

- **`js/`:** This directory contains scripts written in JavaScript.
- Use this as the working directory when executing JavaScript scripts.
- Requires [npm](https://www.npmjs.com) as the package manager.

- **`automations/`:** This directory contains scripts related to project management or one-off tasks.
- **`python/`:** This directory contains scripts written in Python.
- Use this as the working directory when executing Python scripts.
- Requires [Pipenv](https://pipenv.pypa.io) as the package manager.
- **`js/`:** This directory contains scripts written in JavaScript.
- Use this as the working directory when executing JavaScript scripts.
- Requires [npm](https://www.npmjs.com) as the package manager.
- **`brand/`:** This directory contains brand assets for the project.
- **`rfcs/`:** This directory contains proposals for changes to Openverse.
File renamed without changes.
14 changes: 14 additions & 0 deletions automations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Automations

This directory contains automations for managing the Openverse repositories and Developer Experience.

## Requirements

- Node v14
- This should be kept in sync between the GitHub Actions `node-version` and the `volta.node` key in the `package.json` file.
- Python 3.10
- [Just](https://github.com/casey/just) command runner

## Installing Dependencies

Run `just install` to set up Python and JavaScript dependencies.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions js/package.json → automations/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"@octokit/rest": "^18.9.0",
"js-yaml": "^4.1.0",
"node-fetch": "^2.6.7"
},
"volta": {
"node": "14.19.1"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ default:
# Dev #
#######

# Install Python dependencies in Pipenv environments
# Install Python dependencies in Pipenv environments and JS dependencies
@install:
just _py-install
just _js-install

# Setup pre-commit as a Git hook
precommit:
cd python && pipenv run pre-commit install
cd automations/python && pipenv run pre-commit install

# Run pre-commit to lint and reformat all files
lint:
cd python && pipenv run pre-commit run --all-files
cd automations/python && pipenv run pre-commit run --all-files

##########
# Python #
##########

# Install dependencies for Python
_py-install:
cd python && pipenv install --dev
cd automations/python && pipenv install --dev

##############
# JavaScript #
##############

# Install dependencies for JavaScript
_js-install:
cd js && npm install
cd automations/js && npm install

0 comments on commit 5130502

Please sign in to comment.