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

SONARPY-2321 Fix quality gate issues #2145

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

thomas-serre-sonarsource
Copy link
Contributor

@thomas-serre-sonarsource thomas-serre-sonarsource commented Nov 8, 2024

No description provided.

@hashicorp-vault-sonar-prod hashicorp-vault-sonar-prod bot changed the title Fix quality gate issues SONARPY-2318 Fix quality gate issues Nov 8, 2024
@thomas-serre-sonarsource thomas-serre-sonarsource changed the title SONARPY-2318 Fix quality gate issues NO-JIRA Fix quality gate issues Nov 8, 2024
Copy link

sonarqube-next bot commented Nov 8, 2024

@thomas-serre-sonarsource thomas-serre-sonarsource changed the title NO-JIRA Fix quality gate issues SONARPY-2321 Fix quality gate issues Nov 12, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks for handling this!

About fullyQualifiedName, I think we should ensure it's no longer Nullable, but I'd recommend doing it in a separate ticket. Wdyt?

@@ -43,12 +43,12 @@ public class FunctionDescriptor implements Descriptor {
private final TypeAnnotationDescriptor typeAnnotationDescriptor;


public FunctionDescriptor(String name, String fullyQualifiedName, List<Parameter> parameters, boolean isAsynchronous,
public FunctionDescriptor(String name, @Nullable String fullyQualifiedName, List<Parameter> parameters, boolean isAsynchronous,

Choose a reason for hiding this comment

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

After second look, I think fully qualified names for FunctionDescriptor should never be null again.

In DescriptorsToProtobuf, we're making null checks during deserialization from the cache because it used to be nullable (thus serialized with an empty value).
Due to our cacheVersion checks, we'd disregard any cached value that is null, so we should be safe to remove this check.
Note that if we actually do that:

  • It breaks ClassDescriptorTest which are based on a V1->Descriptor converison.
  • It is no longer consistent with the descriptors.proto model that says that FunctionDescriptor#fullyQualifiedName is an optional field.

Fixing this would significantly expand the scope of this PR, so I'd suggest creating a hardening ticket to ensure FunctionDescriptor#fullyQualifiedName is not longer nullable and adapt the related tests there, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed live, we leave the current PR as is and create two tickets:

  • One to remove the nullability of fullyqualifiedname (SONARPY-2335)
  • One to remove the conversion logic from V1 symbol to descriptor (SONARPY-2336)

@guillaume-dequenne-sonarsource guillaume-dequenne-sonarsource merged commit 9cabcdf into master Nov 14, 2024
14 checks passed
@guillaume-dequenne-sonarsource guillaume-dequenne-sonarsource deleted the ts/fix-quality-gate-issues branch November 14, 2024 10:47
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.

2 participants