[PR #2076] [MERGED] fix route table migration wiping routes 0.22 -> 0.23 #2480

Closed
opened 2025-12-29 03:21:28 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2076
Author: @kradalby
Created: 8/23/2024
Status: Merged
Merged: 8/27/2024
Merged by: @kradalby

Base: mainHead: kradalby/missing-route-migration


📝 Commits (1)

  • 7e9f321 fix route table migration wiping routes 0.22 -> 0.23

📊 Changes

9 files changed (+204 additions, -19 deletions)

View changed files

📝 .github/workflows/test.yml (+1 -1)
📝 hscontrol/db/db.go (+17 -5)
hscontrol/db/db_test.go (+168 -0)
📝 hscontrol/db/node.go (+3 -4)
📝 hscontrol/db/node_test.go (+8 -6)
hscontrol/db/testdata/0-22-3-to-0-23-0-routes-are-dropped-2063.sqlite (+0 -0)
hscontrol/db/testdata/0-22-3-to-0-23-0-routes-fail-foreign-key-2076.sqlite (+0 -0)
📝 hscontrol/util/test.go (+5 -1)
📝 integration/route_test.go (+2 -2)

📄 Description

Fixes #2074

Summary by CodeRabbit

  • Bug Fixes
    • Improved database migration logic to prevent potential data loss during upgrades.
    • Added conditional checks to ensure safe execution of migration for the Route table.
  • New Features
    • Introduced new comparison functions for ipproto.Proto slices, enhancing comparison capabilities.
    • Enhanced the comparison logic in tests to allow for multiple comparison functions, increasing flexibility in evaluations.
  • Tests
    • Added comprehensive unit tests for database migrations, ensuring correct retrieval and validation of routes.
    • Updated test workflow to provide more structured output for test results.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2076 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 8/23/2024 **Status:** ✅ Merged **Merged:** 8/27/2024 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `kradalby/missing-route-migration` --- ### 📝 Commits (1) - [`7e9f321`](https://github.com/juanfont/headscale/commit/7e9f3216498f38901fe2a677208dfcd4ecc736b8) fix route table migration wiping routes 0.22 -> 0.23 ### 📊 Changes **9 files changed** (+204 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/test.yml` (+1 -1) 📝 `hscontrol/db/db.go` (+17 -5) ➕ `hscontrol/db/db_test.go` (+168 -0) 📝 `hscontrol/db/node.go` (+3 -4) 📝 `hscontrol/db/node_test.go` (+8 -6) ➕ `hscontrol/db/testdata/0-22-3-to-0-23-0-routes-are-dropped-2063.sqlite` (+0 -0) ➕ `hscontrol/db/testdata/0-22-3-to-0-23-0-routes-fail-foreign-key-2076.sqlite` (+0 -0) 📝 `hscontrol/util/test.go` (+5 -1) 📝 `integration/route_test.go` (+2 -2) </details> ### 📄 Description Fixes #2074 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved database migration logic to prevent potential data loss during upgrades. - Added conditional checks to ensure safe execution of migration for the Route table. - **New Features** - Introduced new comparison functions for `ipproto.Proto` slices, enhancing comparison capabilities. - Enhanced the comparison logic in tests to allow for multiple comparison functions, increasing flexibility in evaluations. - **Tests** - Added comprehensive unit tests for database migrations, ensuring correct retrieval and validation of routes. - Updated test workflow to provide more structured output for test results. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 03:21:28 +01:00
adam closed this issue 2025-12-29 03:21:28 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2480