Conversation
Add a deploy workflow that SSHes into PythonAnywhere and runs the deploy script after tests pass on main. Clean up the test workflow (add workflow_call trigger, bump checkout to v4, remove stale commented-out deploy code). Fix refresh_env.sh: remove makemigrations from prod, add --noinput flags, fix quoting.
The vague python:3 tag pulls latest 3.x, causing inconsistency with CI and the production target (3.10).
Migrations were gitignored and regenerated on every deploy, making the schema fragile and impossible to evolve safely. Now: - Remove migration exclusion from .gitignore - Commit the initial migration as a proper baseline - Clean up refresh_db.sh to use committed migrations instead of deleting and regenerating them - Add tools/backup_db.sh for automated MySQL backups on PythonAnywhere (mysqldump + gzip, 30-day retention)
search_fields referenced non-existent field ('email' instead of
'contact_email'), a boolean field ('is_public'), a display method
('_created_by'), and a date field ('published_at') — none of which
are searchable. Any search query caused a 500 error.
Fix search_fields to use correct text fields and add list_filter
for the fields that work better as filters. Add 11 admin tests.
Replace full-page-reload search with instant client-side filtering. On page load, fetches all public profiles via a new /api/profiles/ endpoint, then filters in the browser as the user types (debounced). Supports text search, under-represented country filter, and senior position filter. Server-side search remains as no-JS fallback. Adds ProfileSearchSerializer, ProfileSearchViewSet, and 5 API tests.
Smoke tests (19) verify all major pages render without errors: home, repo list, search filters, profile detail, signup, login, account, profile edit, recommend, FAQ, about, publications, and all API endpoints. Form tests (7) verify URL normalization in UserProfileForm.clean() for ORCID, Twitter, GitHub, LinkedIn. Total test count: 17 → 59.
If the email backend fails (bad SMTP config, expired SendGrid key), the signup crashed with a 500 even though the user was already saved. Now catches the exception, logs it, and shows a user-facing error message instead of crashing. Adds 2 tests. Closes #47
Replace hard-coded margin-left:170px with Bootstrap d-block mx-auto classes so the button centers properly on all viewport sizes.
…oses #24) ProfilesSitemap was querying all profiles including soft-deleted and private ones, and Profile lacked get_absolute_url() which Django's sitemap framework requires. Now only public profiles appear in the sitemap.
Direct links like /faq/#heading-resources now auto-expand the target accordion section and scroll to it. Uses Bootstrap's Collapse API on DOMContentLoaded.
Use coverage run --source=profiles with --fail-under=50 threshold. Remove makemigrations from CI — migrations are now committed to the repo and should not be generated during test runs.
…kend Remove duplicate email block that silently overrode values with empty strings. Add section comments and use console email backend for local development so emails are printed to stdout instead of failing silently.
README now includes venv setup, test instructions, Docker option, and pre-created test accounts. CONTRIBUTING.md was empty — now covers workflow, PR guidelines, and coding style.
Production repo on PythonAnywhere is at ~/winrepo-prod, not ~/winrepo.
Phase 0 bonus - Bug fixes & developer experience Ready for merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR delivers all items from the phase 0 estimate, plus some more fixes discovered along the way.
What's included
CD Pipeline — Automated deployment on push to
main. A new GitHub Actions workflow runs tests, then SSHes into PythonAnywhere to pull code, run migrations, and reload the webapp. The existingtools/refresh_env.shwas cleaned up (removedmakemigrationsfrom production, added--noinputflags).Python 3.10 — Pinned the Dockerfile from the vague
python:3topython:3.10, matching CI and the production target. The codebase was already 3.10-compatible.Database hygiene — Migrations were gitignored and regenerated on every deploy. Now they're committed and version-controlled. Added
tools/backup_db.shfor automated MySQL backups on PythonAnywhere (mysqldump + gzip, 30-day retention).Admin interface fix — Admin search was broken:
search_fieldsreferenced a non-existent field (emailinstead ofcontact_email), a boolean (is_public), a display method (_created_by), and a date field (published_at). Fixed all four and addedlist_filterfor better filtering.Live client-side search — The profile search now filters instantly in the browser as you type, instead of doing a full page reload. A new
/api/profiles/endpoint serves all public profiles as JSON; vanilla JS handles the filtering (debounced, supports text + checkboxes). Server-side search remains as a no-JS fallback.Signup 500 fix (closes #47) — Signup crashed with a 500 if the email backend failed, even though the user was already saved to the DB. Wrapped the email send in a try/except with logging and a user-facing error message.
Tests
Test count went from 17 → 61 (+44 new tests):
Manual actions needed after merge
PYTHONANYWHERE_SSH_KEY,PYTHONANYWHERE_USERNAMEpython manage.py migrate --fake-initialon first deploytools/backup_db.shas a daily task on PythonAnywhere