Skip to content

Conversation

@pendingintent
Copy link
Owner

epochs creaet/update/delete/reorder moved to separate template

Copilot AI review requested due to automatic review settings January 14, 2026 17:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors epoch management by moving create, update, delete, and reorder operations from the main application file to a dedicated epochs.py router module. It introduces a new standalone epochs.html template for epoch management and updates the epoch reorder audit to track epoch names instead of IDs.

Changes:

  • Moved epoch CRUD operations from app.py to routers/epochs.py with both API and UI endpoints
  • Created new epochs.html template with inline forms for epoch creation, updating, and deletion
  • Updated epoch reorder audit to record epoch names rather than IDs in before/after snapshots
  • Removed epochs section from edit.html template and added navigation link in base.html

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_epoch_type_audit.py Entire test file removed
tests/test_epoch_reorder_audit_api.py Updated test to match new API structure and audit format recording epoch names
src/soa_builder/web/templates/epochs.html New template for epoch management UI
src/soa_builder/web/templates/edit.html Removed epochs management section
src/soa_builder/web/templates/base.html Added navigation link to epochs page
src/soa_builder/web/schemas.py Added type field to EpochCreate and EpochUpdate schemas
src/soa_builder/web/routers/visits.py Moved _load_code_value_map function earlier in file
src/soa_builder/web/routers/epochs.py Comprehensive refactor with new API/UI endpoints for epoch operations
src/soa_builder/web/audit.py Fixed logger name
src/soa_builder/web/app.py Commented out/removed epoch-related code moved to router

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

spelling

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 14, 2026 17:53
pendingintent and others added 2 commits January 14, 2026 12:53
grammar

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
spelling

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

tests/test_epoch_reorder_audit_api.py:1

  • Missing null check after cur.fetchone(). If no epoch is found with the given epoch_id, this will cause an error when trying to access row[0]. Add a check: if not row: raise HTTPException(404, "Epoch not found") before line 442.
import os

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pendingintent pendingintent requested a review from Copilot January 14, 2026 18:11
@pendingintent pendingintent self-assigned this Jan 14, 2026
@pendingintent pendingintent added the enhancement New feature or request label Jan 14, 2026
@pendingintent pendingintent added this to the v1.2-beta milestone Jan 14, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pendingintent pendingintent merged commit 307fcc3 into master Jan 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants