-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor #1
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
Refactor #1
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 refactors the codebase by reorganizing code into separate packages with better separation of concerns. The main changes extract image parsing utilities and controller logic from the main package into dedicated packages.
- Moved image name and digest extraction functions to a new
pkg/imagepackage - Relocated controller logic from
cmd/deployment-tracker/main.goto a newinternal/controllerpackage - Updated package references and function calls to use the new package structure
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/image/name.go | Adds image name/tag extraction function (moved from deploymentrecord package) |
| pkg/image/name_test.go | Updates package declaration and test function names to match new location |
| pkg/image/digest.go | Adds digest extraction function (extracted from main) |
| pkg/image/digest_test.go | Adds comprehensive test coverage for digest extraction |
| pkg/deploymentrecord/record.go | Removes ExtractImageName function and unused import |
| internal/controller/controller.go | Adds controller implementation (moved from main) |
| internal/controller/config.go | Adds configuration types and constants (moved from main) |
| cmd/deployment-tracker/main.go | Simplified to use new controller package, removes moved logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 refactors the deployment-tracker codebase by reorganizing code into more logical packages and improving separation of concerns. The main changes extract controller logic and image parsing utilities into dedicated packages.
Key changes:
- Moved controller logic from
cmd/deployment-tracker/main.goto newinternal/controllerpackage - Created new
pkg/imagepackage with utilities for parsing image names and digests - Moved
ExtractImageNamefunction fromdeploymentrecordpackage toimagepackage and renamed it toExtractName
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/image/name.go | New file containing ExtractName function moved from deploymentrecord package |
| pkg/image/name_test.go | Updated test file with corrected package name and function references |
| pkg/image/digest.go | New file containing ExtractDigest function extracted from main.go |
| pkg/image/digest_test.go | New test file for ExtractDigest function |
| pkg/deploymentrecord/record.go | Removed ExtractImageName function (moved to image package) |
| internal/controller/controller.go | New file containing controller logic extracted from main.go |
| internal/controller/config.go | New file containing Config type and template constants |
| cmd/deployment-tracker/main.go | Refactored to use new controller package, removed moved code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.