-
Notifications
You must be signed in to change notification settings - Fork 3
Add Gitea runners list and exploit commands with shared template package #372
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: frjcomp <[email protected]>
Co-authored-by: frjcomp <[email protected]>
frjcomp
left a comment
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.
@copilot tackle the review comments
| @@ -0,0 +1,10 @@ | |||
| package runners | |||
|
|
|||
| import ( | |||
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.
keep the cobra cmd definition here, do not put it into pkg
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.
create suvfolders for the runners subcommand named list and exploit. both need to include their cobra cmd definitions as well and not store it in the pkg.
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.
Done in commit acee14a. Created cmd/gitea/runners/list/ and cmd/gitea/runners/exploit/ with their respective command definitions.
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.
Done in commit acee14a. Moved Cobra command definitions to cmd/gitea/runners/ with subfolders for list/ and exploit/. Business logic now resides in pkg/gitea/runners/list/ and pkg/gitea/runners/exploit/.
| @@ -0,0 +1,187 @@ | |||
| package runners | |||
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.
only keep the business logic here. move exploit into its own folder under pkg/gitea/runners/exploit/
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.
Done in commit acee14a. Moved exploit business logic to pkg/gitea/runners/exploit/ and kept only the command wrapper in cmd/.
| @@ -0,0 +1,146 @@ | |||
| package runners | |||
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.
only keep the business logic here. move list into its own folder under pkg/gitea/runners/list/
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.
Done in commit acee14a. Moved list business logic to pkg/gitea/runners/list/ and kept only the command wrapper in cmd/.
| giteaUrl string | ||
| ) | ||
|
|
||
| func NewRunnersRootCmd() *cobra.Command { |
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.
move the cmd definition to the cmd pkg
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.
Done in commit acee14a. The runners root command is now in cmd/gitea/runners/runners.go with proper separation of concerns.
- Moved cmd definitions from pkg to cmd for list and exploit subcommands - Created cmd/gitea/runners/list/ and cmd/gitea/runners/exploit/ folders - Created pkg/gitea/runners/list/ and pkg/gitea/runners/exploit/ for business logic - Updated runners root command to use new structure - All tests passing Co-authored-by: frjcomp <[email protected]>
Implementation Complete: Gitea Runners Commands ✅
This PR implements
gitea runners listandgitea runners exploitcommands similar to the GitLab versions, with a shared template package for common exploit logic.All Tasks Completed ✅
pkg/runners/template) for common exploit template logicpkg/gitea/runners/)gitea runners listcommandgitea runners exploitcommand to create repos with workflow filesRecent Changes (Addressing Review Comments)
cmd/gitea/runners/list/andcmd/gitea/runners/exploit/pkg/gitea/runners/list/andpkg/gitea/runners/exploit/Code Structure
Command Layer (
cmd/gitea/runners/):runners.go- Root command with flag definitionslist/list.go- List command wrapperexploit/exploit.go- Exploit command wrapperBusiness Logic (
pkg/gitea/runners/):list/list.go- Runner discovery logicexploit/exploit.go- Exploit workflow generation logicShared Components (
pkg/runners/template/):Test Results
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.