Split internal/handlers/source_management.go along its three CRUD seams #274
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
internal/handlers/source_management.gois roughly 1,970 lines and holds the source, entrypoint and target CRUD for the whole application.Filing this because the cost stopped being theoretical. During the 1.0.0 push, #221, #211 and #262 were three independent, non-overlapping units that all had to be serialised against each other purely because they touched this one file. That serialisation was a real schedule cost paid three times, and it will be paid again by anything that follows.
It also concentrates risk: the defect in #262 sat about twenty lines below
commitWebhook, which handles the identical GORM transaction idiom correctly. In a smaller file the inconsistency would have been obvious.Definition of done:
source_*.go,entrypoint_*.goandtarget_*.goalong the existing CRUD seams.sharedfile — do not scatter them.make checkgreen.Not milestoned: no behaviour change, so it does not block the tag. Worth doing early after it, while the seams are still clean.