Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
Move automations into their own directory; update README (#201)
Zack Krida51305023a47d
diff --git a/.github/workflows/label_pr.yml b/.github/workflows/label_pr.ymlindex a1bb29c13..156e76a97 100644--- a/.github/workflows/label_pr.yml+++ b/.github/workflows/label_pr.yml@@ -23,14 +23,14 @@ jobs:python-version: "3.10"- name: Install dependencies- working-directory: ./python+ working-directory: ./automations/pythonrun: |python -m pip install --user --upgrade pippython -m pip install --user pipenvpipenv install --deploy- name: Label PR- working-directory: ./python+ working-directory: ./automations/pythonrun: |pipenv run python label_pr.py \--pr-url $PR_URLdiff --git a/.github/workflows/label_sync.yml b/.github/workflows/label_sync.ymlindex e1989a128..8b170d53b 100644--- a/.github/workflows/label_sync.yml+++ b/.github/workflows/label_sync.yml@@ -24,13 +24,13 @@ jobs:python-version: "3.10"- name: Install dependencies- working-directory: ./python+ working-directory: ./automations/pythonrun: |python -m pip install --user --upgrade pippython -m pip install --user pipenvpipenv install --deploy- name: Sync standard labels- working-directory: ./python+ working-directory: ./automations/pythonrun: |pipenv run python sync_labels.pydiff --git a/.github/workflows/pr_project_automation.yml b/.github/workflows/pr_project_automation.ymlindex 507353e97..3a5565259 100644--- a/.github/workflows/pr_project_automation.yml+++ b/.github/workflows/pr_project_automation.yml@@ -23,21 +23,21 @@ jobs:python-version: "3.10"- name: Install dependencies- working-directory: ./python+ working-directory: ./automations/pythonrun: |python -m pip install --user --upgrade pippython -m pip install --user pipenvpipenv install --deploy- name: Clear PRs in "Merged!"- working-directory: ./python+ working-directory: ./automations/pythonrun: |pipenv run python archive_column.py \--project-number 8 \--column 'Merged!'- name: Clear PRs in "Closed"- working-directory: ./python+ working-directory: ./automations/pythonrun: |pipenv run python archive_column.py \--project-number 8 \diff --git a/.github/workflows/project_automation.yml b/.github/workflows/project_automation.ymlindex 668727ba6..66ac6f860 100644--- a/.github/workflows/project_automation.yml+++ b/.github/workflows/project_automation.yml@@ -24,14 +24,14 @@ jobs:python-version: "3.10"- name: Install dependencies- working-directory: ./python+ working-directory: ./automations/pythonrun: |python -m pip install --user --upgrade pippython -m pip install --user pipenvpipenv install --deploy- name: Move issues from "To do"- working-directory: ./python+ working-directory: ./automations/pythonrun: |pipenv run python issues_with_prs.py \--project-number 3 \@@ -39,7 +39,7 @@ jobs:--target-column "In progress"- name: Move issues from "Backlog"- working-directory: ./python+ working-directory: ./automations/pythonrun: |pipenv run python issues_with_prs.py \--project-number 3 \diff --git a/.github/workflows/weekly_updates.yml b/.github/workflows/weekly_updates.ymlindex 871568795..ae0c42324 100644--- a/.github/workflows/weekly_updates.yml+++ b/.github/workflows/weekly_updates.yml@@ -25,9 +25,9 @@ jobs:node-version: 14- name: Install dependencies- working-directory: ./js+ working-directory: ./automations/jsrun: npm ci- name: Create draft post- working-directory: ./js+ working-directory: ./automations/jsrun: node src/last_week_tonight.jsdiff --git a/.pre-commit-config.yaml b/.pre-commit-config.yamlindex 7bf30da03..e3bb46cf6 100644--- a/.pre-commit-config.yaml+++ b/.pre-commit-config.yaml@@ -44,9 +44,11 @@ repos:rev: 3.9.2hooks:- id: flake8+ args:+ - --config=automations/.flake8- repo: https://github.com/ambv/black- rev: 21.6b0+ rev: 22.3.0hooks:- id: blackargs:diff --git a/README.md b/README.mdindex 5416cb5a2..b5038088b 100644--- a/README.md+++ b/README.md@@ -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.diff --git a/.flake8 b/automations/.flake8similarity index 100%rename from .flake8rename to automations/.flake8diff --git a/automations/README.md b/automations/README.mdnew file mode 100644index 000000000..687fc37ed--- /dev/null+++ b/automations/README.md@@ -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.diff --git a/data/github.yml b/automations/data/github.ymlsimilarity index 100%rename from data/github.ymlrename to automations/data/github.ymldiff --git a/data/labels.yml b/automations/data/labels.ymlsimilarity index 100%rename from data/labels.ymlrename to automations/data/labels.ymldiff --git a/js/.eslintrc.js b/automations/js/.eslintrc.jssimilarity index 100%rename from js/.eslintrc.jsrename to automations/js/.eslintrc.jsdiff --git a/js/.gitignore b/automations/js/.gitignoresimilarity index 100%rename from js/.gitignorerename to automations/js/.gitignorediff --git a/js/package-lock.json b/automations/js/package-lock.jsonsimilarity index 100%rename from js/package-lock.jsonrename to automations/js/package-lock.jsondiff --git a/js/package.json b/automations/js/package.jsonsimilarity index 73%rename from js/package.jsonrename to automations/js/package.jsonindex 4b294af56..b3bfb68d1 100644--- a/js/package.json+++ b/automations/js/package.json@@ -3,5 +3,8 @@"@octokit/rest": "^18.9.0","js-yaml": "^4.1.0","node-fetch": "^2.6.7"+ },+ "volta": {+ "node": "14.19.1"}}diff --git a/js/prettier.config.js b/automations/js/prettier.config.jssimilarity index 100%rename from js/prettier.config.jsrename to automations/js/prettier.config.jsdiff --git a/js/src/last_week_tonight.js b/automations/js/src/last_week_tonight.jssimilarity index 100%rename from js/src/last_week_tonight.jsrename to automations/js/src/last_week_tonight.jsdiff --git a/js/src/migrate_issues.js b/automations/js/src/migrate_issues.jssimilarity index 100%rename from js/src/migrate_issues.jsrename to automations/js/src/migrate_issues.jsdiff --git a/js/src/utils.js b/automations/js/src/utils.jssimilarity index 100%rename from js/src/utils.jsrename to automations/js/src/utils.jsdiff --git a/js/src/weekly_report.js b/automations/js/src/weekly_report.jssimilarity index 100%rename from js/src/weekly_report.jsrename to automations/js/src/weekly_report.jsdiff --git a/python/.gitignore b/automations/python/.gitignoresimilarity index 100%rename from python/.gitignorerename to automations/python/.gitignorediff --git a/python/Pipfile b/automations/python/Pipfilesimilarity index 100%rename from python/Pipfilerename to automations/python/Pipfilediff --git a/python/Pipfile.lock b/automations/python/Pipfile.locksimilarity index 100%rename from python/Pipfile.lockrename to automations/python/Pipfile.lockdiff --git a/python/README.md b/automations/python/README.mdsimilarity index 100%rename from python/README.mdrename to automations/python/README.mddiff --git a/python/archive_column.py b/automations/python/archive_column.pysimilarity index 100%rename from python/archive_column.pyrename to automations/python/archive_column.pydiff --git a/python/issues_with_prs.py b/automations/python/issues_with_prs.pysimilarity index 100%rename from python/issues_with_prs.pyrename to automations/python/issues_with_prs.pydiff --git a/python/label_pr.py b/automations/python/label_pr.pysimilarity index 100%rename from python/label_pr.pyrename to automations/python/label_pr.pydiff --git a/python/models/__init__.py b/automations/python/models/__init__.pysimilarity index 100%rename from python/models/__init__.pyrename to automations/python/models/__init__.pydiff --git a/python/models/label.py b/automations/python/models/label.pysimilarity index 100%rename from python/models/label.pyrename to automations/python/models/label.pydiff --git a/python/models/label_group.py b/automations/python/models/label_group.pysimilarity index 100%rename from python/models/label_group.pyrename to automations/python/models/label_group.pydiff --git a/python/shared/__init__.py b/automations/python/shared/__init__.pysimilarity index 100%rename from python/shared/__init__.pyrename to automations/python/shared/__init__.pydiff --git a/python/shared/data.py b/automations/python/shared/data.pysimilarity index 100%rename from python/shared/data.pyrename to automations/python/shared/data.pydiff --git a/python/shared/github.py b/automations/python/shared/github.pysimilarity index 100%rename from python/shared/github.pyrename to automations/python/shared/github.pydiff --git a/python/shared/log.py b/automations/python/shared/log.pysimilarity index 100%rename from python/shared/log.pyrename to automations/python/shared/log.pydiff --git a/python/shared/project.py b/automations/python/shared/project.pysimilarity index 100%rename from python/shared/project.pyrename to automations/python/shared/project.pydiff --git a/python/sync_labels.py b/automations/python/sync_labels.pysimilarity index 100%rename from python/sync_labels.pyrename to automations/python/sync_labels.pydiff --git a/justfile b/justfileindex 5f4e080a4..b90a73735 100644--- a/justfile+++ b/justfile@@ -8,18 +8,18 @@ default:# Dev ########-# Install Python dependencies in Pipenv environments+# Install Python dependencies in Pipenv environments and JS dependencies@install:just _py-installjust _js-install# Setup pre-commit as a Git hookprecommit:- cd python && pipenv run pre-commit install+ cd automations/python && pipenv run pre-commit install# Run pre-commit to lint and reformat all fileslint:- cd python && pipenv run pre-commit run --all-files+ cd automations/python && pipenv run pre-commit run --all-files########### Python #@@ -27,7 +27,7 @@ lint:# Install dependencies for Python_py-install:- cd python && pipenv install --dev+ cd automations/python && pipenv install --dev############### JavaScript #@@ -35,4 +35,4 @@ _py-install:# Install dependencies for JavaScript_js-install:- cd js && npm install+ cd automations/js && npm install