Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5935cf2
ci: support Netlify via Makefile & .gitignore
wesleyboar Dec 9, 2025
6195348
ci: netlify workflows (UNTESTED)
wesleyboar Dec 9, 2025
4b5a6f3
ci: validation workflow (UNTESTED)
wesleyboar Dec 9, 2025
83a742a
ci: update reqs workflow (UNTESTED)
wesleyboar Dec 9, 2025
6654451
ci: delete netlify workflows (NEW APPROACH COMING)
wesleyboar Dec 9, 2025
571bcc8
ci: update reqs workflow (ALLOW TEST)
wesleyboar Dec 9, 2025
896422c
ci: fix workflow name
wesleyboar Dec 9, 2025
3c62815
fix: workflow typos
wesleyboar Dec 9, 2025
c2f6cdf
chore: auto-update requirements.txt [bot]
github-actions[bot] Dec 9, 2025
b924816
refactor: workflows
wesleyboar Dec 9, 2025
6d5a873
Merge branch 'fix/GH-61-netlify-auto-deploy' of github.com:DesignSafe…
wesleyboar Dec 9, 2025
d5cfe6b
Merge branch 'epic/v3' into fix/GH-61-netlify-auto-deploy
wesleyboar Dec 9, 2025
dd5856a
build: this branch
wesleyboar Dec 9, 2025
c662bd0
test: attempt change reqs, expect validation error
wesleyboar Dec 9, 2025
6ab8e02
fix: unepxcted syntax in workflows
wesleyboar Dec 9, 2025
54bc97e
Revert "test: attempt change reqs, expect validation error"
wesleyboar Dec 9, 2025
7bef77c
docs: reword [skip ci]
wesleyboar Dec 9, 2025
a650f7c
increase Python version support
wesleyboar Dec 9, 2025
e84c576
ci: get python version from pyproject.toml
wesleyboar Dec 9, 2025
4bd0b65
Revert "increase Python version support"
wesleyboar Dec 9, 2025
a9f5d46
test: new PR triggering Netlify preview server (#242)
wesleyboar Dec 9, 2025
c07c3e0
docs: explain workflows
wesleyboar Dec 9, 2025
1bce266
chore: delete unnecessary Make command
wesleyboar Dec 9, 2025
67a209c
docs: TESTING
wesleyboar Dec 9, 2025
2b5e528
fix: TESTING.md ToC
wesleyboar Dec 9, 2025
33edca1
ci: validate this branch
wesleyboar Dec 9, 2025
2e9d1f9
test: change reqs
wesleyboar Dec 9, 2025
d565817
ci: skip update-reqs if nothing updated
wesleyboar Dec 9, 2025
be416b3
ci: prettier output for validate-reqs
wesleyboar Dec 9, 2025
744fb03
refactor: requiremnts workflows
wesleyboar Dec 9, 2025
789a9b4
fix; workflow bugs
wesleyboar Dec 9, 2025
310a40b
refactor: simpplify reqs-validate
wesleyboar Dec 9, 2025
8b4f182
fix: reqs change reverted manually
wesleyboar Dec 9, 2025
7440a3b
Merge branch 'epic/v3' into fix/GH-61-netlify-auto-deploy
wesleyboar Dec 9, 2025
ce0ef75
fix: do not run workflows twice
wesleyboar Dec 9, 2025
3c9ecbf
fix: limit excess workflow runs
wesleyboar Dec 9, 2025
6529e31
refactor: rename workflows and jobs
wesleyboar Dec 9, 2025
fbf1e28
test: change requirements
wesleyboar Dec 9, 2025
824e99a
Revert "test: change requirements"
wesleyboar Dec 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build-pprd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- pprd
- epic/v3
- any/branch-you-want
- fix/docs_dir-not-set

jobs:
docker:
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/build-preview.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/requirements-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Humans should not manage requirements.txt (bots do)
name: Validate requirements.txt not changed by human

on:
pull_request:
paths: ['requirements.txt']
types: [opened, synchronize, reopened]

jobs:
reject-requirements-drift:
runs-on: ubuntu-latest

# Skip if the last commit was from the bot (prevent unnecessary check)
if: github.event.head_commit.author.name != 'github-actions[bot]'

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history

- name: Check if requirements.txt was modified unexpectedly
run: |
# For PRs, check against base branch
# For pushes, check last commit
if [ "${{ github.event_name }}" = "pull_request" ]; then
BASE_REF="${{ github.event.pull_request.base.sha }}"
COMPARE_RANGE="$BASE_REF...HEAD"
else
COMPARE_RANGE="HEAD~1..HEAD"
fi

# If requirements.txt modified in that range
if git diff --name-only $COMPARE_RANGE | grep -q "^requirements.txt$"; then
echo "::error::You may NOT edit 'requirements.txt'"
echo "::warning::Undo your changes to requirements.txt, so robot can maintain it."
echo "::notice::To pin dependencies, use 'poetry add <package-name>'."
exit 1
fi

echo "'requirements.txt' unchanged (or only changed by bot)"
85 changes: 85 additions & 0 deletions .github/workflows/requirments-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Netlify requires requirements.txt (humans do not)
name: Sync requirements.txt with pyproject.toml

on:
pull_request:
paths: ['pyproject.toml']
types: [opened, synchronize, reopened]

permissions:
contents: write

jobs:
detect-requirements-delta:
runs-on: ubuntu-latest
outputs:
has_change: ${{ steps.detect.outputs.has_change }}

# Skip if the last commit was from the bot (prevent infinite loops)
if: github.event.head_commit.author.name != 'github-actions[bot]'

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml'

- name: Install Poetry
run: pip install poetry

- name: Detect whether requirements.txt has change
id: detect
run: |
output=$(make requirements.txt 2>&1)
echo "$output"

# Check whether Make output suggests file is up to date
if echo "$output" | grep -qi "up to date\|up-to-date\|already up to date"; then
echo "has_change=false" >> $GITHUB_OUTPUT
echo "::notice::requirements.txt seems up to date"
else
echo "has_change=true" >> $GITHUB_OUTPUT
fi

commit-requirements-delta:
runs-on: ubuntu-latest
needs: detect-requirements-delta
if: needs.detect-requirements-delta.outputs.has_change == 'true'

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml'

- name: Install Poetry
run: pip install poetry

- name: Generate requirements.txt
run: make requirements.txt

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Commit requirements.txt if changed
run: |
git add -f requirements.txt
if git diff --staged --quiet; then
echo "No changes to requirements.txt"
else
git commit -m "chore: auto-update requirements.txt [bot]"
git push
fi
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# WARNING: Using `docker-compose` is deprecated
DOCKER_COMPOSE_CMD := $(shell if command -v docker-compose > /dev/null; then echo "docker-compose"; else echo "docker compose"; fi)


requirements.txt: poetry.lock
pip install --user poetry-plugin-export \
&& poetry export -f requirements.txt --output requirements.txt \
&& pip uninstall --yes poetry-plugin-export


.PHONY: build
build:
$(DOCKER_COMPOSE_CMD) -f ./docker-compose.yml build
Expand Down
29 changes: 18 additions & 11 deletions TESTING.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
# How to Test

## Local Server
- [On Free Machine](#on-free-machine)
- [On Your Machine](#on-your-machine)
- [On Our Machine](#on-our-machine)

> [!WARNING]
> Testing is manual and requires using a command prompt.
## On Free Machine

> [!TIP]
> Create a pull request; automatically get a remote preview server.

You can [test with **PIP** or **Poetry** or **Docker** or **Make**](https://tacc.github.io/mkdocs-tacc/test/#test-locally) as a client.
## On Your Machine

## Remote Server
> [!NOTE]
> Run a server manually or programatically on your machine.

> [!WARNING]
> Your test may be overridden by others working on the same test server.
You can [test with **PIP** or **Poetry** or **Docker** or **Make**](https://tacc.github.io/mkdocs-tacc/test/#test-locally).

Deploy to our test server:
## On Our Machine

> [!WARNING]
> Only authorized contributors may deploy to our test server.

0. Have a branch with changes ready to deploy.
1. On your branch, edit the [pre-prod workflow config](./.github/workflows/build-pprd.yml) `branches:` list.
1. On your branch, edit the [pre-prod workflow config](./.github/workflows/build-pprd.yml) `branches:` list to include your branch.
2. Commit the change to trigger the workflow.
3. Wait for [GitHub action](https://github.com/DesignSafe-CI/ds-user-guide/actions) to complete.
4. Load https://pprd.designsafe-ci.org/user-guide/.

> [!TIP]
> In the future, we will offer a dedicated test server. Task is pending [issue #61](https://github.com/DesignSafe-CI/DS-User-Guide/issues/61).
> [!CAUTION]
> Others can override your test by deploying to this server.