Skip to content
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

Fix issue with get repo info #130 #132

Merged
merged 6 commits into from
Oct 31, 2023
Merged

Fix issue with get repo info #130 #132

merged 6 commits into from
Oct 31, 2023

Conversation

codekuu
Copy link
Contributor

@codekuu codekuu commented Oct 26, 2023

Description

Issue when the sub group has the same name as the repository.
The getRepoInfo function does not parse it out correctly.

This fixes this issue.

Example url: https://my-gitlab-instance.com/top-group/sub-group/repo-name/repo-name
getRepoInfo returned before:

host: my-gitlab-instance.com
namespace: top-group/sub-group
repo: repo-name
err: %!s(<nil>)

it now returns:

host: my-gitlab-instance.com
namespace: top-group/sub-group/repo-name
repo: repo-name
err: %!s(<nil>)

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • [N/A] I've updated the readme with the relevant information (if needed).
  • [N/A] I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

morwn
morwn previously approved these changes Oct 29, 2023
@morwn morwn self-requested a review October 29, 2023 07:52
@morwn morwn dismissed their stale review October 29, 2023 07:55

tests failed

Changed BaseURL in test from gitlab to github.
Copy link
Contributor Author

@codekuu codekuu left a comment

Choose a reason for hiding this comment

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

Updated the test, was the wrong BaseURL set for "github project under sub org with same name as repo"

Copy link
Collaborator

@morwn morwn left a comment

Choose a reason for hiding this comment

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

Tests seem good, but target Github, and subgroups do not apply there. I added code suggestions to replace it to Gitlab, let me know if this is what you meant

internal/scm-clients/clients/clients_test.go Outdated Show resolved Hide resolved
internal/scm-clients/clients/clients_test.go Outdated Show resolved Hide resolved
internal/scm-clients/clients/clients_test.go Outdated Show resolved Hide resolved
@codekuu
Copy link
Contributor Author

codekuu commented Oct 30, 2023

LGTM, accepted the changes, added for github as well since It was the same problem their if a org had the same name as repo.

@morwn
Copy link
Collaborator

morwn commented Oct 31, 2023

LGTM, accepted the changes, added for github as well since It was the same problem their if a org had the same name as repo.

Hi, I don't see the tested you added for github

@codekuu
Copy link
Contributor Author

codekuu commented Oct 31, 2023

LGTM, accepted the changes, added for github as well since It was the same problem their if a org had the same name as repo.

Hi, I don't see the tested you added for github

You are right, your changes did override them. Do you want me to add them again or should we ignore them?

@morwn morwn merged commit bf93ebd into aquasecurity:main Oct 31, 2023
2 checks passed
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.

Issue when the sub group has the same name as the repository output error while running the chain-bench scan
2 participants