Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sonar/hotspots.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def search(endpoint: pf.Platform, filters: types.ApiParams = None) -> dict[str,
for inline_filters in filters_iterations:
p = 1
inline_filters["ps"] = ps
log.info("Searching hotspots with sanitized filters %s", str(inline_filters))
log.debug("Searching hotspots with sanitized filters %s", str(inline_filters))
while True:
inline_filters["p"] = p
try:
Expand Down
8 changes: 3 additions & 5 deletions sonar/issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,11 +823,9 @@ def get_newest_issue(endpoint: pf.Platform, params: ApiParams = None) -> Union[d
def count(endpoint: pf.Platform, **kwargs) -> int:
"""Returns number of issues of a search"""
params = {} if not kwargs else kwargs.copy()
params["ps"] = 1
try:
nbr_issues = len(search(endpoint=endpoint, params=params))
except TooManyIssuesError as e:
nbr_issues = e.nbr_issues
filters = pre_search_filters(endpoint=endpoint, params=params)
filters["ps"] = 1
nbr_issues = json.loads(endpoint.get(Issue.SEARCH_API, params=filters).text)["paging"]["total"]
log.debug("Count issues with filters %s returned %d issues", str(kwargs), nbr_issues)
return nbr_issues

Expand Down
1 change: 1 addition & 0 deletions sonar/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ def export(self, export_settings: types.ConfigSettings, settings_list: dict[str,
else:
log.critical("HTTP error %s while exporting %s, export of this project skipped", str(e), str(self))
json_data = {}
log.info("Exporting %s done", str(self))
return util.remove_nones(json_data)

def new_code(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion test/test_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_migration() -> None:
assert p["branches"]["master"]["hotspots"]["acknowledged"] == 0

p = json_config["projects"]["checkstyle-issues"]
assert len(p["branches"]["issues"]["thirdParty"]) > 0
assert len(p["branches"]["main"]["issues"]["thirdParty"]) > 0

assert json_config["projects"]["demo:gitlab-ci-maven"]["detectedCi"] == "GitLab CI"
assert json_config["projects"]["demo:gitlab-actions-cli"]["detectedCi"] == "Github Actions"
Expand Down