-
Notifications
You must be signed in to change notification settings - Fork 1.5k
infoblox customizations #1317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
infoblox customizations #1317
Conversation
There was a problem hiding this 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 implements Infoblox-specific customizations to the golang-migrate project, adding dirty state handling capabilities and configuration management enhancements.
Key changes:
- Added dirty state handling functionality to manage database migration failures and recovery
- Implemented configuration management using Viper with YAML config support
- Integrated Infoblox-specific database drivers and hot-loading capabilities
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| migrate_dirty_test.go | Test suite for new dirty state handling functionality |
| migrate.go | Core migration logic with dirty state handling, file management, and new configuration methods |
| internal/cli/main.go | CLI enhancements with Viper configuration management and dirty state options |
| internal/cli/log.go | Updated logging to use logrus instead of standard log package |
| docker-deploy.sh | Added --pull flag to docker build command |
| cmd/migrate/main.go | Main entry point with Infoblox-specific driver registration and configuration initialization |
| cmd/migrate/config/defaults.yaml | Default configuration file for application settings |
| cmd/migrate/config.go | Flag definitions and configuration constants |
| cmd/migrate/.gitignore | Added migrate binary to gitignore |
| Makefile | Updated versioning scheme and added docker/image management targets |
| Jenkinsfile | Jenkins CI/CD pipeline configuration |
| Dockerfile | Updated base image and build paths for Infoblox deployment |
| .golangci.yml | Disabled revive linter rules |
| .github/workflows/ci.yaml | Disabled linting workflow for infobloxopen/migrate |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
|
|
||
| // readUp reads up migrations from `from` limited by `limit`. | ||
| // readUp reads up migrations from `from` limitted by `limit`. |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: 'limitted' should be 'limited'
| // readUp reads up migrations from `from` limitted by `limit`. | |
| // readUp reads up migrations from `from` limited by `limit`. |
Copilot uses AI. Check for mistakes.
| } | ||
|
|
||
| // readDown reads down migrations from `from` limited by `limit`. | ||
| // readDown reads down migrations from `from` limitted by `limit`. |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: 'limitted' should be 'limited'
| // readDown reads down migrations from `from` limitted by `limit`. | |
| // readDown reads down migrations from `from` limited by `limit`. |
Copilot uses AI. Check for mistakes.
| } | ||
| scheme := "file" | ||
| if uri.Scheme != "file" && uri.Scheme != "" { | ||
| return "", "", fmt.Errorf("unsupported scheme: %s", scheme) |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message uses variable 'scheme' but should use 'uri.Scheme' since 'scheme' is always set to 'file' at this point
| return "", "", fmt.Errorf("unsupported scheme: %s", scheme) | |
| return "", "", fmt.Errorf("unsupported scheme: %s", uri.Scheme) |
Copilot uses AI. Check for mistakes.
| m, _ := setupMigrateInstance(tempDir) | ||
|
|
||
| tests := []struct { | ||
| lastSuccessFulVersion int |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in field name: 'lastSuccessFulVersion' should be 'lastSuccessfulVersion'
Copilot uses AI. Check for mistakes.
| {lastSuccessFulVersion: 3}, | ||
| {lastSuccessFulVersion: 4}, | ||
| {lastSuccessFulVersion: 5}, |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in field name: 'lastSuccessFulVersion' should be 'lastSuccessfulVersion'
Copilot uses AI. Check for mistakes.
|
|
||
| for _, test := range tests { | ||
| t.Run("", func(t *testing.T) { | ||
| if err := m.handleMigrationFailure(test.lastSuccessFulVersion); err != nil { |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in field name: 'lastSuccessFulVersion' should be 'lastSuccessfulVersion'
Copilot uses AI. Check for mistakes.
| if string(content) != strconv.Itoa(test.lastSuccessFulVersion) { | ||
| t.Fatalf("expected %d, got %s", test.lastSuccessFulVersion, string(content)) |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in field name: 'lastSuccessFulVersion' should be 'lastSuccessfulVersion'
Copilot uses AI. Check for mistakes.
| if !tt.wantErr && m.dirtyStateConf == tt.wantConf { | ||
| t.Errorf("dirtyStateConf = %v, want %v", m.dirtyStateConf, tt.wantConf) |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comparison logic is incorrect. This should use deep equal comparison, not pointer equality. The condition should be !reflect.DeepEqual(m.dirtyStateConf, tt.wantConf) and the error message should be inverted.
Copilot uses AI. Check for mistakes.
| --version Print version | ||
| --help Print usage | ||
| // Infoblox specific |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Comment format inconsistency: should use proper comment formatting '// Infoblox specific options:' or similar
| // Infoblox specific | |
| // Infoblox specific options: |
Copilot uses AI. Check for mistakes.
|
|
||
| // show cli version | ||
| if *versionPtr { | ||
| if version == "" { |
Copilot
AI
Sep 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic error: this condition checks if version is empty string, but the intent appears to be checking if help should be shown for version. This should likely be checking a version flag boolean or the condition should be inverted.
| if version == "" { | |
| if versionFlag { |
Copilot uses AI. Check for mistakes.
No description provided.