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 getting repo security and analysis #884

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

bjoernricks
Copy link
Contributor

@bjoernricks bjoernricks commented Sep 27, 2023

What

Don't crash when getting repositories when using a token.

Why

When using a token the security and analysis information is included in the response. Despite the JSON schema is not mentioning optional settings the advanced_security object is not returned in our responses. To be able to still receive repository data the security and analysis settings are now marked as optional in the response models.

References

Fixes https://jira.greenbone.net/browse/DEVOPS-822

Checklist

  • Tests

Despite the JSON schema doesn't mention the properties are optional it
seems they are actually optional. The property `advanced_security` is
missing in several of our responses and therefore we got a model error.
The status is missing in our model. Maybe it was added later on.
@github-actions
Copy link

Conventional Commits Report

Type Number
Changed 1
Added 1
Bug Fixes 1

🚀 Conventional commits found.

Make the error message more precise in what's wrong here actually.
@bjoernricks bjoernricks force-pushed the fix-getting-repo-security-and-analysis branch from d850af1 to c681169 Compare September 27, 2023 06:29
@bjoernricks bjoernricks marked this pull request as ready for review September 27, 2023 06:29
@bjoernricks bjoernricks requested a review from a team as a code owner September 27, 2023 06:29
@bjoernricks bjoernricks enabled auto-merge (rebase) September 27, 2023 06:29
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #884 (c681169) into main (531ade7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #884   +/-   ##
=======================================
  Coverage   89.45%   89.45%           
=======================================
  Files          84       84           
  Lines        5603     5604    +1     
  Branches      783      783           
=======================================
+ Hits         5012     5013    +1     
  Misses        421      421           
  Partials      170      170           
Files Coverage Δ
pontos/github/models/organization.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bjoernricks bjoernricks added the make release To trigger GitHub release action. label Sep 27, 2023
@bjoernricks bjoernricks merged commit c3d18b8 into main Sep 27, 2023
18 checks passed
@bjoernricks bjoernricks deleted the fix-getting-repo-security-and-analysis branch September 27, 2023 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
make release To trigger GitHub release action.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants