-
Notifications
You must be signed in to change notification settings - Fork 88
Frogbot Configuration Refactor #993
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: v3_er
Are you sure you want to change the base?
Conversation
orto17
commented
Dec 10, 2025
- All tests passed. If this feature is not already covered by the tests, I added new tests.
- This pull request is on the dev branch.
- I used gofmt for formatting the code before submitting the pull request.
- Update documentation about new features / new supported technologies
| } | ||
| scanDetails = utils.NewScanDetails(client, &repoConfig.Server, &repoConfig.Params.Git). | ||
| return utils.NewScanDetails(client, &repoConfig.Server, &repoConfig.Params.Git). | ||
| SetJfrogVersions(repoConfig.Params.XrayVersion, repoConfig.Params.XscVersion). |
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.
what if we also killed xsc version and told cli to kill it s well?
| func GetCompatiblePackageHandler(vulnDetails *utils.VulnerabilityDetails, details *utils.ScanDetails) (handler PackageHandler) { | ||
| switch vulnDetails.Technology { | ||
| case techutils.Go: | ||
| handler = &GoPackageHandler{} | ||
| case techutils.Poetry: | ||
| handler = &PythonPackageHandler{} | ||
| case techutils.Pipenv: | ||
| handler = &PythonPackageHandler{} | ||
| case techutils.Npm: | ||
| handler = &NpmPackageHandler{} | ||
| case techutils.Yarn: | ||
| handler = &YarnPackageHandler{} | ||
| case techutils.Pip: | ||
| handler = &PythonPackageHandler{pipRequirementsFile: details.PipRequirementsFile} | ||
| handler = &PythonPackageHandler{pipRequirementsFile: defaultRequirementFile} | ||
| case techutils.Maven: | ||
| handler = NewMavenPackageHandler(details) | ||
| case techutils.Nuget: | ||
| handler = &NugetPackageHandler{} | ||
| case techutils.Gradle: | ||
| handler = &GradlePackageHandler{} | ||
| case techutils.Pnpm: | ||
| handler = &PnpmPackageHandler{} | ||
| case techutils.Conan: | ||
| handler = &ConanPackageHandler{} | ||
| default: | ||
| handler = &UnsupportedPackageHandler{} |
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.
if you in the mood of refactoring make it a mapping object instead of this insane switch case
this isnt logic switching this is a pure factory
| return | ||
| } | ||
| return | ||
|
|
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.
drop the line
| type ScanPullRequestCmd struct{} | ||
|
|
||
| func (cmd *ScanPullRequestCmd) Run(repository utils.Repository, client vcsclient.VcsClient, frogbotRepoConnection *utils.UrlAccessChecker) (err error) { | ||
| func (cp *ScanPullRequestCmd) Run(repository utils.Repository, client vcsclient.VcsClient, frogbotRepoConnection *utils.UrlAccessChecker) (err error) { |
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.
what is cp?
| client vcsclient.VcsClient | ||
| fixableOnly bool | ||
| skipAutoInstall bool | ||
| minSeverityFilter severityutils.Severity |
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.
delete you said its dead
| SetUseWrapper(*sc.UseWrapper). | ||
| SetMaxTreeDepth(sc.MaxPnpmTreeDepth). | ||
| SetDepsRepo(sc.DepsRepo). | ||
| SetIgnoreConfigFile(true). |
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.
i checked with assaf we dont even need to pass it it's some weird legacy no one uses
| GitProvider = "JF_GIT_PROVIDER" | ||
| GitRepoOwnerEnv = "JF_GIT_OWNER" | ||
| GitRepoEnv = "JF_GIT_REPO" | ||
| GitProjectEnv = "JF_GIT_PROJECT" |
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.
@eranturgeman suggested to call it something like JF_AZURE_GIT_PROJECT
as its specific to azure and i agree
|
|
||
| // The 'GITHUB_ACTIONS' environment variable exists when the CI is GitHub Actions | ||
| GitHubActionsEnv = "GITHUB_ACTIONS" | ||
| GitHubActionsEnv = "GITHUB_ACTIONS" // TODO WHAT IS THIS? |
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.
@eranturgeman you know what this is for?
| scanDetails *utils.ScanDetails | ||
| // The base working directory | ||
| baseWd string | ||
| baseWd string //TODO |
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.
what does the todo mean? to do what?
| ApiEndpoint string | ||
| PullRequestID string | ||
| CustomBranchName string | ||
| UseLocalRepo bool |
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.
dont you need to delete this as well?