docs: establish community contribution process#340
Conversation
8bc25cb to
805da62
Compare
|
/gemini review |
X-Test Failure Report |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive community contribution guide and adds new discovery-related methods to the Java SDK. The documentation changes in CONTRIBUTING.md are well-structured and clear. The new SDK methods are a valuable addition for developers. My review focuses on improving the new SDK functionality. I've provided suggestions to make the listAttributes API less ambiguous, improve the robustness of error handling in attributeExists and attributeValueExists by avoiding brittle string matching on error messages, and to correct a minor inaccuracy in a Javadoc.
I am having trouble creating individual review comments. Click here to see my feedback.
sdk/src/main/java/io/opentdf/platform/sdk/SDK.java (334-340)
Relying on string matching (msg.contains("not_found")) for error handling is brittle and can easily break if server error messages change. It's much more robust to check for a specific error code.
The connect-java library throws a com.connectrpc.ConnectException which contains a structured error code. You should catch this specific exception and check for com.connectrpc.Code.NOT_FOUND.
} catch (com.connectrpc.ConnectException e) {
if (e.getCode() == com.connectrpc.Code.NOT_FOUND) {
return false;
}
throw new SDKException("checking attribute existence: " + e.getMessage(), e);
} catch (Exception e) {
throw new SDKException("checking attribute existence: " + e.getMessage(), e);
}sdk/src/main/java/io/opentdf/platform/sdk/SDK.java (217-221)
The method signature with varargs String... namespace is misleading because only the first element is ever used. Any additional arguments are silently ignored. This could lead to developer confusion and bugs. To make the API explicit about accepting at most one namespace, consider changing the signature to not use varargs. Callers can pass null for an unfiltered list. An overload for listAttributes() could be added for convenience.
public List<Attribute> listAttributes(String namespace) {
ListAttributesRequest.Builder reqBuilder = ListAttributesRequest.newBuilder();
if (namespace != null) {
reqBuilder.setNamespace(namespace);
}
sdk/src/main/java/io/opentdf/platform/sdk/SDK.java (367-369)
Catching Exception is too broad. It can hide programming errors like NullPointerException or other unexpected runtime exceptions. It's better to catch the specific exception(s) you expect to be thrown from the service call, such as com.connectrpc.ConnectException for network or server errors.
} catch (com.connectrpc.ConnectException e) {
throw new SDKException("checking attribute value existence: " + e.getMessage(), e);
}sdk/src/main/java/io/opentdf/platform/sdk/SDK.java (480-483)
The Javadoc for AttributeNotFoundException is inaccurate. It references validateAttributeExists(String) and validateAttributeValue(String, String), which are not defined in this class. The methods that were added in this PR, attributeExists and attributeValueExists, return booleans and do not throw this exception. Please update the documentation to accurately reflect which methods can throw this exception.
* {@link AttributeNotFoundException} is thrown by {@link #validateAttributes(List)}
* when one or more attributes or values are not found on the platform.There was a problem hiding this comment.
Code Review
The pull request significantly enhances the CONTRIBUTING.md file by replacing a bare DCO-only document with a comprehensive community contribution guide. This includes sections on the Code of Conduct, community feedback channels, contribution workflow, branch naming conventions, commit message format (Conventional Commits), and PR guidelines. The DCO section has been retained and integrated into the new structure. The changes are well-structured and provide clear guidance for contributors.
X-Test Results |
Replaces bare DCO-only CONTRIBUTING.md with a full guide covering code of conduct, community feedback channels, contribution workflow, branch naming, commit message format, PR guidelines, and DCO. Closes DSPX-2421 Signed-off-by: Mary Dickson <mary.dickson@virtru.com>
805da62 to
fff3530
Compare
|
X-Test Results |



Summary
CONTRIBUTING.mdwith a full community contribution guideopentdf/platform)Test plan
Closes DSPX-2421