Make hash IDs opt-in via id_mode config (bd-5404)
- Add id_mode config (sequential|hash), defaults to sequential - Update CreateIssue/CreateIssues to check id_mode and generate appropriate IDs - Implement lazy counter initialization from existing issues - Update migrate --to-hash-ids to set id_mode=hash after migration - Fix hash ID tests to set id_mode=hash - Fix renumber test to use explicit IDs - All 183 test packages pass This makes hash IDs backward-compatible opt-in rather than forced default.
This commit is contained in:
@@ -44,6 +44,7 @@ func TestRenumberWithGaps(t *testing.T) {
|
||||
|
||||
for _, tc := range testIssues {
|
||||
issue := &types.Issue{
|
||||
ID: tc.id, // Set explicit ID to simulate gaps
|
||||
Title: tc.title,
|
||||
Description: "Test issue for renumbering",
|
||||
Priority: 1,
|
||||
@@ -53,10 +54,6 @@ func TestRenumberWithGaps(t *testing.T) {
|
||||
if err := testStore.CreateIssue(ctx, issue, "test"); err != nil {
|
||||
t.Fatalf("failed to create issue: %v", err)
|
||||
}
|
||||
// Manually update ID to simulate gaps
|
||||
if err := testStore.UpdateIssueID(ctx, issue.ID, tc.id, issue, "test"); err != nil {
|
||||
t.Fatalf("failed to set issue ID to %s: %v", tc.id, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Add a dependency to test that it gets updated
|
||||
|
||||
Reference in New Issue
Block a user