Skip to content

Gitlab refactor#327

Merged
frjcomp merged 3 commits into
mainfrom
gitlab-refactor
Nov 6, 2025
Merged

Gitlab refactor#327
frjcomp merged 3 commits into
mainfrom
gitlab-refactor

Conversation

@frjcomp

@frjcomp frjcomp commented Nov 6, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

- Add shared IterateProjects() and IterateGroupProjects() helpers in util package
- Refactor 6 files to use callback-based iteration pattern:
  * cmd/gitlab/variables.go
  * cmd/gitlab/schedule/schedule.go
  * cmd/gitlab/secureFiles/secure_files.go
  * cmd/gitlab/scan/pipeline.go
  * cmd/gitlab/runners/list.go
  * cmd/gitlab/renovate/enum.go
- Eliminate ~200+ lines of duplicated pagination code
- Maintain 100% backward compatibility
- All tests passing (unit + e2e)
- Linter clean (0 issues)
Move single-file commands into their own subdirectories for better organization:
- enum.go -> enum/enum.go
- register.go -> register/register.go
- shodan.go -> shodan/shodan.go
- variables.go -> variables/variables.go
- vuln.go -> vuln/vuln.go

This aligns with the existing structure used by scan/, runners/, renovate/, etc.
All commands now follow a consistent subdirectory pattern.

Updated imports and package references in:
- gitlab.go (command registration)
- gitlab_unauth.go (unauthenticated commands)
- gitlab_test.go (test function calls)

All unit tests, e2e tests, and golangci-lint checks pass.

projectOpts.Page = resp.NextPage
log.Info().Int("currentPage", projectOpts.Page).Msg("Fetched projects page")
// Process projects sequentially (original used parallel per page, but sequential is simpler)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thast okay remove the comment though

@frjcomp

frjcomp commented Nov 6, 2025

Copy link
Copy Markdown
Collaborator Author

@copilot fix the review comments

Copilot AI commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

@frjcomp I've opened a new pull request, #328, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* fix: remove comment in enum.go as per review feedback

Co-authored-by: frjcomp <107982661+frjcomp@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: frjcomp <107982661+frjcomp@users.noreply.github.com>
@frjcomp frjcomp merged commit 6e8844e into main Nov 6, 2025
6 checks passed
@frjcomp frjcomp deleted the gitlab-refactor branch November 6, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants