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

#738: Prevent missing pull request data from causing API errors #847

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

mc1arke
Copy link
Owner

@mc1arke mc1arke commented Jan 1, 2024

The scanner currently skips validation of a target branch if a Pull Request is used to create a new project, so the resulting project fails to load in front-end due to the Pull Request API treating the data on that pull request as invalid. This is being overcome by validating that a target branch exists for all Pull Request submissions and rejecting the scan submission if the target branch is not found in Sonarqube.

Additionally, there's a delay between a Pull Request being recorded in the database by the server component as a result of the call from the scanner, and the Compute Engine recording the Pull Request details (source, target, title etc.) against the branch. During this time the Pull Request treats that Pull Request as invalid and throws an error, meaning the project cannot be loaded through the UI, or the Pull Requests listed through the API. As the Pull Request response fields filled from the Pull Request data are not mandatory, those fields are now only being completed if the Pull Request data is set on the branch DTO rather than throwing an exception if the data isn't set.

The scanner currently skips validation of a target branch if a Pull
Request is used to create a new project, so the resulting project fails
to load in front-end due to the Pull Request API treating the data on
that pull request as invalid. This is being overcome by validating that
a target branch exists for all Pull Request submissions and rejecting
the scan submission if the target branch is not found in Sonarqube.

Additionally, there's a delay between a Pull Request being recorded in
the database by the server component as a result of the call from the
scanner, and the Compute Engine recording the Pull Request details
(source, target, title etc.) against the branch. During this time the
Pull Request treats that Pull Request as invalid and throws an error,
meaning the project cannot be loaded through the UI, or the Pull
Requests listed through the API. As the Pull Request response fields
filled from the Pull Request data are not mandatory, those fields are
now only being completed if the Pull Request data is set on the branch
DTO rather than throwing an exception if the data isn't set.
Copy link

sonarcloud bot commented Jan 1, 2024

@bstick12
Copy link
Contributor

@mc1arke will this fixed be merged back to the the plugin version 1.14.x supporting the 9.9 LTS release

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.

None yet

2 participants