Repository navigation
fix: failed renames in library forms, and two review follow-ups - #32
Merged
Merged
Conversation
…d name A prefix set, AS set, community, RPKI server, BMP station or policy rename that failed validation re-rendered the form posting to the name the operator had typed. When that name belonged to a sibling (the usual reason a rename is refused), the corrected resubmit edited the sibling: it took the first object's contents and the new name, and the first object stayed as it was. The forms now post back to the name the object is stored under, as the peer and template forms already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Neither fix had a test that fails when it is reverted: the detach hint was only checked where it belongs, and nothing made the community in-use check fail. sabotageDB changes the test database behind the store's back (a trigger that aborts the delete, a renamed table) to reach both paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Import from BIRD listed such a session as importable, then skipped it on save with only its name in the "skipped" list. The page now runs the same template-name check as the save and shows the row as "can't import" with the reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Local CI replica on Independent review found no blockers or major issues. It confirmed:
Left as is (minor):
|
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.
Found by the final review of #30 before the release.
A failed rename in a library form could overwrite another object
A prefix set, AS set, community, RPKI server, BMP station or policy rename that failed validation re-rendered the form posting to the name the operator had typed. When that name belonged to a sibling (the usual reason a rename is refused), the corrected resubmit edited the sibling: it took the first object's contents and the new name, and the first object stayed as it was.
Example: rename prefix set
CUST_AtoCUST_C, which exists. The save is refused, but the form now posts to/library/prefix-sets/CUST_C/edit. Fix the name toCUST_Dand save:CUST_CbecomesCUST_Dwith A's prefixes, andCUST_Ais unchanged. C's prefixes are gone.The six forms now post back to the name the object is stored under (
StoredName), as the peer and template forms already do since #21/#30. This bug predates the templates work. It is in v0.5.0 too. The CHANGELOG entry for the peer-form rename fix now covers every form and the overwrite.Review follow-ups for #30
sabotageDBchanges the test database behind the store's back (an aborting trigger, a renamed table) to reach both paths.Not changed (noted in review, judged not worth it)
ebgp_in_Xis refused while peerXexists, but creating peerXwhile that template exists is not refused at save. The render-level duplicate check refuses it before any apply, with a message naming both, and such a template name is contrived.rpki4,rpki6,bfd1,static_v4,static_v6ordevice1, even when that object isn't rendered, so an existing community with one of those names can't be re-saved unchanged. These names are contrived.Test plan
TestFailedLibraryRenamePostsBackToTheStoredName: for each of the six forms, a refused rename onto a sibling's name, then the corrected resubmit to the form's own action. Before the fix, all six renamed the sibling. After it, the right object is renamed and the sibling is untouched.TestSeedPageFlagsASessionNamedLikeATemplatefails before the fix and passes after.TestAnUnlinkedTemplatesFailedDeleteDoesNotSayDetachandTestCommunityDeleteRefusesWhenTheUseCheckFailseach fail with its fix reverted.🤖 Generated with Claude Code