-
Notifications
You must be signed in to change notification settings - Fork 43
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
read safety of external types #1945
base: develop
Are you sure you want to change the base?
Conversation
Generate changelog in
|
@@ -150,7 +191,7 @@ void testMapSafetyUnsafeValue() { | |||
.types(SAFE_ALIAS) | |||
.types(UNSAFE_ALIAS) | |||
.build(); | |||
ConjureDefinitionValidator.validateAll(conjureDef); | |||
ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method changed between the previous conjure version and the one I bumped to
SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); | ||
assertThat(evaluator.evaluate(Iterables.getOnlyElement(conjureDef.getTypes()))) | ||
.hasValue(LogSafety.SAFE); | ||
} | ||
|
||
private static Stream<Arguments> getTypes(Type externalReference) { | ||
TypeDefinition objectType = TypeDefinition.object(ObjectDefinition.builder() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it's sufficient to just test objects and the rest is overkill
e2f7b27
to
9751939
Compare
Could you update Separately (potentially as a separate PR from this one as it may become a little more involved): I think as written, this will update generated types which contain external imports to reflect the safety of those types, however we probably also want to annotate some of the getter and setter fields with safety annotations since the imported type itself isn't annotated (java.lang.Long doesn't have a safe or unsafe annotation). This way, if we alias a safe external long import, the alias factory method becomes |
That sounds like a plan - I'll open a separate PR for that change. |
This PR follows up palantir/conjure#1315 to support log safety annotations for external imports, declared at import time.