Skip to content

Commit

Permalink
feat: Add the ability redirect to moved files.
Browse files Browse the repository at this point in the history
* Add the conf to generate redirects based on changes between a branch
  and master.

* Add a CI check so we don't miss files that got moved around.
  • Loading branch information
Feanil Patel committed Mar 6, 2023
1 parent e75ee50 commit cb16cb7
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches:
- '**'

jobs:
check_for_moved_files:
name:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
python-version: ['3.8']

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install pip
run: pip install -r requirements/pip.txt

- name: Install Dependencies
run: pip install -r requirements/base.txt

- name: Run Rediraffe Check
run: make check_redirects
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,11 @@ requirements:

dev-requirements:
pip install -r requirements/dev.txt

update_redirects:
# If files got moved there should be a redirect in redirects.txt
sphinx-build -b rediraffewritediff oeps $(BUILDDIR)

check_redirects:
# Check to make sure that any files that got moved have a redirect in redirects.txt
sphinx-build -b rediraffecheckdiff oeps $(BUILDDIR)
1 change: 1 addition & 0 deletions oeps/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

graphviz_output_format = 'svg'

rediraffe_redirects = "redirects.txt"
rediraffe_branch = 'master'

# Add any paths that contain templates here, relative to this directory.
Expand Down
Empty file added oeps/redirects.txt
Empty file.

0 comments on commit cb16cb7

Please sign in to comment.