Skip to content
Open
27 changes: 27 additions & 0 deletions .github/workflows/pr_warn_on_db_changes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Warn on changes to DB files
on:
pull_request:
paths:
- 'arxiv/db/**'

jobs:
post-comment:
runs-on: ubuntu-latest
steps:
- name: Warning comment on pr
uses: actions/github-script@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: ${{ github.event.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: ':warning: :warning: :warning:\n'+
'### Do not manually change the db files!\n\n'+
'Changes to the db files must be done using code generation tools.\n\n'+
'Only accept this PR if the changes to the file under arxiv/db were done with the code gen tools or are unrelated to the db schema. '+
'See [How to generate](https://github.com/arxiv/arxiv-base/arxiv/development/README.md#How-to-generate).\n\n'+
':warning: :warning: :warning:\n'})


2 changes: 2 additions & 0 deletions arxiv/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

"""

# fake change to test github action

from typing import Optional, Literal, Any, Tuple, List
import re
import hashlib
Expand Down
19 changes: 19 additions & 0 deletions development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

**DO NOT EDIT db/models.py.**

## How to generate

TODO Tai, please put in specific steps to generated all auto generated files from the production db.
It it should not use make.

cd arxiv-base
python -v
# 3.11
python -m venv .venv
. .venv/bin/activate
pip install poetry
poetry install

python development/db_codegen.

## Overiew

TODO

## Ingredients

* MySQL database access in order to get the database schema from
Expand Down