profile
viewpoint

palantir/conjure 248

Strongly typed HTTP/JSON APIs for browsers and microservices

palantir/gradle-consistent-versions 42

Compact, constraint-friendly lockfiles for your dependencies

palantir/conjure-typescript 10

Conjure generator for TypeScript clients

palantir/conjure-postman 8

Conjure generator for Postman

palantir/conjure-verification 8

A testing tool that ensures all Conjure clients and servers adhere to a common wire spec

palantir/conjure-java 7

Conjure generator for Java clients and servers

palantir/conjure-python 6

Conjure generator for Python clients

palantir/aip-processor-api 5

AI Inference Platform Processor APIs

palantir/conjure-go-runtime 4

Go implementation of the Conjure runtime

palantir/conjure-python-client 4

Python client and JSON encoders for use with generated Conjure clients

push eventpalantir/conjure

forozco

commit sha 31435cd0c8d1c0018f7e0a530100c6e869db4d97

CR

view details

forozco

commit sha d6f94ebe8fd3c62e1a759b650a0a0304216e13bb

Merge branch 'fo/add-endpoint-tags' of github.com:palantir/conjure into fo/add-endpoint-tags

view details

push time in 10 days

pull request commentpalantir/conjure

feature: add per endpoint tags

cc @bmoylan @sfackler @nmiyake as generator owners

ferozco

comment created time in 10 days

PR opened palantir/conjure

Reviewers
feature: add per endpoint tags

Closes #612

Before this PR

users were able to annotate endpoints with type markers which was used by Java generator to apply annotations to endpoints or to indicate to the generator to different endpoint signatures (ex. Java-undertow and Async type). This was problematic since the type based approach limited the usefulness of markers to Java projects as well as prevented users from adding metadata to their definitions that could be used non-generator consumers of the IR (i.e. Documentation services)

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== Add tags field to EndpointDefinition in the IR ==COMMIT_MSG==

Any values provided in this field must not impact the wire structure of the endpoint and should not be considered when evaluating backwards compatability.

Possible downsides?

Duplicated functionality with markers could be confusing and the untyped set of tags leaves a lot of room for potential misuse

+10 -3

0 comment

5 changed files

pr created time in 10 days

create barnchpalantir/conjure

branch : fo/add-endpoint-tags

created branch time in 10 days

pull request commentpalantir/gradle-conjure

Escape and wrap compileIr task argument for Windows

Thanks for the contribution @vcatalano! We don't have CI for windows environments so could you please confirm that the change you've made works as intended? You should be able to do so by publishing locally by running CIRCLE_TAG=dev ./gradlew pTML and then picking it up in your project by adding mavenLocal() as a buildscript repository and setting the version of gradle-conjure to dev

vcatalano

comment created time in 10 days

PullRequestEvent

PR closed palantir/gradle-conjure

Reviewers
Escape and wrap compileIr task argument for Windows

Before this PR

When running the compileIr task on Windows systems, we receive an error due to the extensions argument of the command not being properly wrapped and escaped for the Windows .bat command. The stack trace for this issue can be found here: https://github.com/palantir/gradle-conjure/issues/594

After this PR

Windows systems will be able to successfully compile Conjure products. Update compileIr task to handle escaping command line arguments for Windows

Possible downsides?

I'm not sure the compileConjure task has been working properly with Windows for a while. Cloning the most recent Conjure Java Example project (https://github.com/palantir/conjure-java-example) fails to build on Windows. I've tested this on numerous machines so it seems to be specific to the Conjure project.

+5 -1

2 comments

2 changed files

vcatalano

pr closed time in 10 days

PullRequestReviewEvent

pull request commentpalantir/conjure-java-runtime

Update conjure-scala-jaxrs-client to use Scala 2.12

This will break things at runtime for people who are not using scala 2.12 right? Can you confirm that internally people have upgraded?

dsw2127

comment created time in 18 days

push eventGrahamDennis/sls-packaging

Excavator Bot

commit sha f73ecb673b41dbac71620df2c6a333ae4b9b2b3a

Excavator: Upgrade buildscript dependencies (#991) Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>

view details

Felipe Orozco

commit sha 2670cce149ff4bc7bfc3dc0b1c8a586da689c073

Merge branch 'develop' into feature/go-java-launcher-upgrade

view details

push time in a month

pull request commentpalantir/sls-packaging

go-java-launcher 1.9.1 -> 1.10.0

@GrahamDennis thanks for opening this up. To avoid blocking on GCV can you downgrade to 1.25.0 on your fork?

GrahamDennis

comment created time in a month

push eventpalantir/conjure-java-runtime-api

forozco

commit sha c8ac1915214c88d1d6fd4e9d4736f480e00f4ea7

CR

view details

forozco

commit sha 95db41b9ef75c945265acf66e739d98e253d163b

Merge branch 'fo/remote-exception-message' of github.com:palantir/conjure-java-runtime-api into fo/remote-exception-message

view details

push time in a month

Pull request review commentpalantir/conjure-java-runtime-api

improvement: move errorInstanceId from exception message into exception args

 public int getStatus() {     public RemoteException(SerializableError error, int status) {         super(                 error.errorCode().equals(error.errorName())-                        ? String.format(-                                "RemoteException: %s with instance ID %s", error.errorCode(), error.errorInstanceId())-                        : String.format(-                                "RemoteException: %s (%s) with instance ID %s",-                                error.errorCode(), error.errorName(), error.errorInstanceId()));+                        ? String.format("RemoteException: %s", error.errorCode())+                        : String.format("RemoteException: %s (%s)", error.errorCode(), error.errorName()));

good catch! this should give us the best of both worlds

ferozco

comment created time in a month

PullRequestReviewEvent

PR opened palantir/conjure-java-runtime-api

improvement: move errorInstanceId from exception message into exception args

Before this PR

We were attempting to perform some internal analysis on unique stacktraces but were running into issues since we grouped stacktraces textually and the error instance id appeared as part of the message of each remote exception

After this PR

==COMMIT_MSG== move RemoteExceptions errorInstanceId from exception message into exception args ==COMMIT_MSG==

Possible downsides?

It will be harder to debug issue if logging is not set up (i.e. args are logged) correctly since the message will not contain the error id

+11 -14

0 comment

2 changed files

pr created time in a month

create barnchpalantir/conjure-java-runtime-api

branch : fo/remote-exception-message

created branch time in a month

delete branch palantir/go-java-launcher

delete branch : fo/move-changelogs

delete time in a month

push eventpalantir/go-java-launcher

Felipe Orozco

commit sha 1aa8f3731e957d69da65645019a1188650499a4d

move changelog (#137)

view details

push time in a month

PR merged palantir/go-java-launcher

Reviewers
move changelog merge when ready no changelog

Before this PR

Had to manual cut a release to go over the go-mod hump

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== Had to manual cut a release to go over the go-mod hump ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. -->

+0 -0

0 comment

2 changed files

ferozco

pr closed time in a month

PR opened palantir/go-java-launcher

move changelog

Before this PR

Had to manual cut a release to go over the go-mod hump

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== Had to manual cut a release to go over the go-mod hump ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. -->

+0 -0

0 comment

2 changed files

pr created time in a month

create barnchpalantir/go-java-launcher

branch : fo/move-changelogs

created branch time in a month

created tagpalantir/go-java-launcher

tagv1.10.0

A simple Go program for launching Java programs from a fixed configuration. This program replaces Gradle-generated Bash launch scripts which are susceptible to attacks via injection of environment variables of the form JAVA_OPTS='$(rm -rf /)'.

created time in a month

release palantir/go-java-launcher

v1.10.0

released time in a month

pull request commentpalantir/go-java-launcher

Migrate to go modules

👍 I'll take your word for it @bmoylan.

bmoylan

comment created time in a month

pull request commentpalantir/go-java-launcher

Upgrade godel and fix lints

👍 cool happy to move forward with this. Thanks again!

bmoylan

comment created time in a month

pull request commentpalantir/go-java-launcher

Upgrade godel and fix lints

Thanks @bmoylan! Looks like the circle-template assumes go-modules. Should we also do that migration here?

bmoylan

comment created time in a month

push eventpalantir/gradle-conjure

Felipe Orozco

commit sha e70a7978f429fdb3b0bbbfdd7037d19d469ddd71

demonstrate working behaviour of IR compilation (#564) demonstrate working behaviour of IR compilation

view details

forozco

commit sha f313c4d4d39dc65a3e031c2f9908ce70ab4d42c3

Merge remote-tracking branch 'origin/develop' into fo/conjure-outgoing-configuration

view details

push time in a month

create barnchpalantir/gradle-conjure

branch : fo/conjure-ir-tests

created branch time in a month

push eventpalantir/gradle-conjure

forozco

commit sha 78ac1fd6876bb9950c998e8c9175570bf834776f

bump

view details

push time in a month

pull request commentpalantir/conjure

fix publish

root project was inadvertently renamed in https://github.com/palantir/conjure/pull/486

ferozco

comment created time in a month

PR opened palantir/conjure

fix publish

Before this PR

<!-- What's wrong with the current state of the world and why change it now? -->

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== fix publish ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. -->

+9 -12

0 comment

2 changed files

pr created time in a month

create barnchpalantir/conjure

branch : fo/fix-publish

created branch time in a month

PR opened palantir/gradle-conjure

feature: produce consumable configuration with conjureIR

Before this PR

It was hard for other plugins to consume the Conjure IR across projects and doing so forced them to depend on implementation details of the plugin.

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== Expose consumable configuration with Usage conjure that contains the complete IR of the conjure project ==COMMIT_MSG==

Possible downsides?

N/A

+158 -3

0 comment

2 changed files

pr created time in a month

create barnchpalantir/gradle-conjure

branch : fo/conjure-outgoing-configuration

created branch time in a month

issue closedpalantir/gradle-conjure

Conjure seems to now fail silently if the IR definition is invalid

I don't know whether you'd like to class this as a gradle-conjure issue or a conjure-java issue.

If your conjure definition is invalid (in my case, I changed it from):

MyType:
  fields:
    existing: string

to

NewType:
  alias: int

MyType:
  fields:
    existing: string
    newField: optional<NewType>

This is invalid because it's integer, not int. But the IR compilation does not error and instead produces no output (the output IR folder is empty). This then causes conjureJava to no-op, since it now has no source (gradle skips the task). It also does not clear out previously generated files.

I think that in the past, Conjure-java used to fail if the file did not exist. Additionally conjure used to hard fail if it wasn't going to produce any output.

closed time in a month

j-baker

issue commentpalantir/gradle-conjure

Conjure seems to now fail silently if the IR definition is invalid

Ya sorry about that, the issue was accidentally introduced here because of a change to how we invoked picocli but it should be fixed now

j-baker

comment created time in a month

issue commentpalantir/conjure

Gradle compiler returns 0 exit code for some errors

This was an issue with conjure CLI which was fixed here: https://github.com/palantir/conjure/pull/675. An upgrade should sort you out

raiju

comment created time in a month

issue closedpalantir/conjure

Gradle compiler returns 0 exit code for some errors

What happened?

When trying to compile a conjure definition with gradle-conjure, no files were generated. Digging deeper, no new IR files were being generated. Executing the compile command directly resulted in the following output:

java.lang.RuntimeException: Encountered error trying to parse file '<FILE>'
	at com.palantir.conjure.defs.ConjureParserUtils.lambda$parseConjureDef$3(ConjureParserUtils.java:228)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
	at com.palantir.conjure.defs.ConjureParserUtils.parseConjureDef(ConjureParserUtils.java:199)
	at com.palantir.conjure.defs.Conjure.parse(Conjure.java:37)
	at com.palantir.conjure.cli.ConjureCli$CompileCommand.generate(ConjureCli.java:91)
	at com.palantir.conjure.cli.ConjureCli$CompileCommand.run(ConjureCli.java:85)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1919)
	at picocli.CommandLine.access$1100(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at com.palantir.conjure.cli.ConjureCli.main(ConjureCli.java:46)
Caused by: java.lang.NullPointerException: Import not found for namespace: Namespace{name=<NAMESPACE_NAME>}
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:987)
	at com.palantir.conjure.defs.ConjureTypeParserVisitor$ByParsedRepresentationTypeNameResolver.resolve(ConjureTypeParserVisitor.java:66)
	at com.palantir.conjure.defs.ConjureTypeParserVisitor.visitForeignReference(ConjureTypeParserVisitor.java:143)
	at com.palantir.conjure.defs.ConjureTypeParserVisitor.visitForeignReference(ConjureTypeParserVisitor.java:41)
	at com.palantir.conjure.parser.types.reference.ForeignReferenceType.visit(ForeignReferenceType.java:33)
	at com.palantir.conjure.defs.ConjureParserUtils.parseArgs(ConjureParserUtils.java:412)
	at com.palantir.conjure.defs.ConjureParserUtils.parseEndpoint(ConjureParserUtils.java:365)
	at com.palantir.conjure.defs.ConjureParserUtils.lambda$parseService$5(ConjureParserUtils.java:266)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:723)
	at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1521)
	at com.palantir.conjure.defs.ConjureParserUtils.parseService(ConjureParserUtils.java:266)
	at com.palantir.conjure.defs.ConjureParserUtils.lambda$parseConjureDef$2(ConjureParserUtils.java:217)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:723)
	at java.base/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1521)
	at com.palantir.conjure.defs.ConjureParserUtils.lambda$parseConjureDef$3(ConjureParserUtils.java:216)
	... 13 more

with a 0 return code. This meant that the next build steps were executed.

What did you want to happen?

A non-zero return code, which would then enable GradleExecUtils to print out the error.

<!-- Suggest better behaviour -->

closed time in a month

raiju

PR closed palantir/metric-schema

Reviewers
Don't implicitly run generateMetricsMarkdown when writing locks autorelease

Similar to https://github.com/palantir/gradle-baseline/pull/1389.

Before this PR

Running ./gradlew --write-locks triggers generateMetricsMarkdown which requires compiling all projects that are dependencies of the distribution project.

After this PR

Running ./gradlew --write-locks does not trigger generateMetricsMarkdown. To update the generated markdown users need to run ./gradlew generateMetricsMarkdown --write-locks explicitly.

+10 -17

6 comments

4 changed files

pkoenig10

pr closed time in a month

push eventpalantir/metric-schema

forozco

commit sha e7988736a87738c0f5abb5e6cc5071d0b4dbd1ce

more explicit

view details

push time in a month

push eventpalantir/metric-schema

Felipe Orozco

commit sha 2e23b77cfa235c8c5b785ebe876a0110232eadf2

Delete pr-325.v2.yml

view details

push time in a month

push eventpalantir/metric-schema

forozco

commit sha ab49427b52a7c9f46bfc6cdf4c9e1679c9311285

fix

view details

forozco

commit sha 53091f61a9f9644fb14f2b4ca3764a4822a861bf

Merge branch 'fo/fix-empty-schema' of github.com:palantir/metric-schema into fo/fix-empty-schema

view details

push time in a month

PullRequestReviewEvent

PR opened palantir/gradle-conjure

demonstrate working behaviour of IR compilation merge when ready no changelog

Before this PR

<!-- What's wrong with the current state of the world and why change it now? -->

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== demonstrate working behaviour of IR compilation ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. -->

+110 -24

0 comment

3 changed files

pr created time in a month

create barnchpalantir/gradle-conjure

branch : fo/conjure-ir-tests

created branch time in a month

PR opened palantir/conjure

fix: correctly set exit code on failure

Before this PR

Due to an upgrade of picocli we would swallow errors and always exit 0

After this PR

==COMMIT_MSG== correctly set exit code on failure. ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. -->

+1 -1

0 comment

1 changed file

pr created time in a month

create barnchpalantir/conjure

branch : fo/correctly-propogate-failure

created branch time in a month

Pull request review commentpalantir/gradle-consistent-versions

Enforce lock constraints using shared platform

 public final void apply(Project project) {                                 .set(project.getLayout().getProjectDirectory().file("versions.props"));                     });             project.getTasks().named("check").configure(task -> task.dependsOn(checkNoUnusedConstraints));++            // Create "platform" configuration in root project, which will hold the versions props constraints+            project.getConfigurations().register("gcvVersionsPropsConstraints", conf -> {+                conf.getAttributes().attribute(Usage.USAGE_ATTRIBUTE, gcvVersionsPropsUsage);+                conf.getOutgoing().capability(gcvVersionsPropsCapability);+                conf.setCanBeResolved(false);+                conf.setCanBeConsumed(true);+                conf.setVisible(false);++                // Note: don't add constraints to the ConstraintHandler, only call `create` / `platform` on it.

What do you mean here? could you explain why?

dansanduleac

comment created time in a month

PullRequestReviewEvent

Pull request review commentpalantir/gradle-consistent-versions

Enforce lock constraints using shared platform

 public final void apply(Project project) {         // (but that's internal)         project.getPluginManager().apply("java-base"); +        // Create "platform" configuration in root project, which will hold the strictConstraints+        NamedDomainObjectProvider<Configuration> gcvLocksConfiguration = project.getConfigurations()+                .register("gcvLocks", conf -> {+                    conf.getAttributes().attribute(Usage.USAGE_ATTRIBUTE, internalUsage);+                    conf.getOutgoing().capability(GCV_LOCKS_CAPABILITY);+                    conf.setCanBeResolved(false);+                    conf.setVisible(false);+                });++        ProjectDependency locksDependency =+                (ProjectDependency) project.getDependencies().create(project);+        locksDependency.capabilities(moduleDependencyCapabilitiesHandler ->

is this necessary given that we already have configured the configuration?

dansanduleac

comment created time in a month

PullRequestReviewEvent

Pull request review commentpalantir/gradle-consistent-versions

Enforce lock constraints using shared platform

 public final void apply(Project project) {         // (but that's internal)         project.getPluginManager().apply("java-base"); +        // Create "platform" configuration in root project, which will hold the strictConstraints+        NamedDomainObjectProvider<Configuration> gcvLocksConfiguration = project.getConfigurations()+                .register("gcvLocks", conf -> {+                    conf.getAttributes().attribute(Usage.USAGE_ATTRIBUTE, internalUsage);+                    conf.getOutgoing().capability(GCV_LOCKS_CAPABILITY);+                    conf.setCanBeResolved(false);+                    conf.setVisible(false);+                });++        ProjectDependency locksDependency =

why do we create a self dependency?

dansanduleac

comment created time in a month

PullRequestReviewEvent

pull request commentpalantir/conjure

Revert "cache parsed results across multiple runs (#667)"

Do we understand why this problem is happening? It seems pretty odd that caching within the Conjure process would impact output across invocations in gradle.

CRogers

comment created time in a month

PullRequestReviewEvent

Pull request review commentpalantir/gradle-conjure

expose conjureIr via consumable configuration

 private static void createIrTasks(             compileIr.getProductDependencies().set(project.provider(pdepsExtension::getProductDependencies));             compileIr.dependsOn(copyConjureSourcesTask);             compileIr.dependsOn(extractCompilerTask);++            project.getConfigurations().create(CONJURE_IR_CONFIGURATION, conf -> {

This also means that you'll need to tag the consuming configuration with the same attributes

mrauen

comment created time in a month

Pull request review commentpalantir/gradle-conjure

expose conjureIr via consumable configuration

 private static void createIrTasks(             compileIr.getProductDependencies().set(project.provider(pdepsExtension::getProductDependencies));             compileIr.dependsOn(copyConjureSourcesTask);             compileIr.dependsOn(extractCompilerTask);++            project.getConfigurations().create(CONJURE_IR_CONFIGURATION, conf -> {

You'll want to tag this configuration with some attributes so that gradle selects the right variant in cases where there are multiple outgoing configurations (i.e. the conjure project also has the Java plugin applied)

mrauen

comment created time in a month

PR opened palantir/metric-schema

fix: markdown updates correctly

Before this PR

<!-- What's wrong with the current state of the world and why change it now? -->

After this PR

==COMMIT_MSG== <!-- User-facing outcomes this PR delivers --> ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. -->

+54 -13

0 comment

2 changed files

pr created time in a month

push eventpalantir/metric-schema

forozco

commit sha 0f7e3a6040688fb3b9ef1434609c9ee7e3350b6d

fix markdown update on empty schema

view details

push time in a month

create barnchpalantir/metric-schema

branch : fo/fix-empty-schema

created branch time in a month

pull request commentpalantir/conjure

Fix changelog from #667

thanks carter 🤦

carterkozak

comment created time in a month

delete branch palantir/conjure

delete branch : cache-results

delete time in a month

push eventpalantir/conjure

rzpt

commit sha 5715c5ce4cf0dc7dc5c51de8709c57666f4943ec

cache parsed results across multiple runs (#667) Co-authored-by: rzpt <> Co-authored-by: forozco <forozco@palantir.com>

view details

push time in a month

PR merged palantir/conjure

Reviewers
cache parsed results across multiple runs autorelease merge when ready

Before this PR

<!-- What's wrong with the current state of the world and why change it now? --> Parsed results were not cached between runs, so certain common files could be parsed many times in a single run.

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== Each conjure file will only be parsed once ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. --> The code is no longer thread safe due to sharing of a static HashMap across threads, but the cli is single-threaded.

+19 -4

8 comments

3 changed files

rzpt

pr closed time in a month

pull request commentpalantir/conjure

cache parsed results across multiple runs

👍

rzpt

comment created time in a month

push eventpalantir/conjure

forozco

commit sha 531af98c2192cc509e03031102b45c198cfe6c4d

changelog

view details

push time in a month

pull request commentpalantir/conjure

cache parsed results across multiple runs

Ok, rather than introducing static state could we refactor the code to allow us to re-use the Recursive parser?

rzpt

comment created time in 2 months

pull request commentpalantir/conjure

cache parsed results across multiple runs

@rzpt mind giving a bit more details about how you're using Conjure? Given that it is typically used an executable, I don't believe the change you have made will have any impact across "run"s

rzpt

comment created time in 2 months

Pull request review commentpalantir/dialogue

Dialogue clients use a sympathetic validation interval

+/*+ * (c) Copyright 2020 Palantir Technologies Inc. All rights reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ *     http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package com.palantir.dialogue.hc5;++import com.palantir.logsafe.SafeArg;+import java.util.Objects;+import java.util.concurrent.atomic.AtomicReference;+import org.apache.hc.client5.http.ConnectionKeepAliveStrategy;+import org.apache.hc.client5.http.impl.DefaultConnectionKeepAliveStrategy;+import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;+import org.apache.hc.core5.http.Header;+import org.apache.hc.core5.http.HeaderElements;+import org.apache.hc.core5.http.HttpResponse;+import org.apache.hc.core5.http.protocol.HttpContext;+import org.apache.hc.core5.util.TimeValue;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;++final class InactivityValidationAwareConnectionKeepAliveStrategy implements ConnectionKeepAliveStrategy {+    private static final Logger log =+            LoggerFactory.getLogger(InactivityValidationAwareConnectionKeepAliveStrategy.class);++    private static final ConnectionKeepAliveStrategy DELEGATE = DefaultConnectionKeepAliveStrategy.INSTANCE;+    private final PoolingHttpClientConnectionManager connectionManager;+    private final String clientName;+    private final TimeValue defaultValidateAfterInactivity;+    /**+     * This field is used for observability. It's possible, though unlikely, that the value can get out of sync+     * with the connection manager in some scenarios.+     */+    private final AtomicReference<TimeValue> currentValidationInterval;++    InactivityValidationAwareConnectionKeepAliveStrategy(+            PoolingHttpClientConnectionManager connectionManager, String clientName) {+        this.connectionManager = connectionManager;+        this.clientName = clientName;+        // Store the initial inactivity interval to restore if responses re received without+        // keep-alive headers.+        this.defaultValidateAfterInactivity = connectionManager.getValidateAfterInactivity();+        this.currentValidationInterval = new AtomicReference<>(defaultValidateAfterInactivity);+    }++    @Override+    public TimeValue getKeepAliveDuration(HttpResponse response, HttpContext context) {+        TimeValue result = DELEGATE.getKeepAliveDuration(response, context);+        if (result != null+                // Only use keep-alive values from 2xx responses+                && response.getCode() / 100 == 2) {+            TimeValue newInterval =+                    containsKeepAliveHeaderWithTimeout(response) ? result : defaultValidateAfterInactivity;+            TimeValue previousInterval = currentValidationInterval.getAndSet(newInterval);+            if (!Objects.equals(previousInterval, newInterval)) {+                log.info(

might want to push this down to debug otherwise it could get noisy

carterkozak

comment created time in 2 months

pull request commentpalantir/dialogue

Response leak detection is always active

👍

carterkozak

comment created time in 2 months

Pull request review commentpalantir/dialogue

Response leak detection is always active

+/*+ * (c) Copyright 2020 Palantir Technologies Inc. All rights reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ *     http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package com.palantir.conjure.java.dialogue.serde;++import com.palantir.logsafe.exceptions.SafeRuntimeException;+import java.lang.reflect.InvocationTargetException;+import java.lang.reflect.Method;+import java.util.function.BiConsumer;+import javax.annotation.Nullable;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;++/** Reflective shim to allow consumers on new runtime versions to take advantage of java.lang.ref.Cleaner. */+final class CleanerSupport {

Why do we have this duplicate definition?

carterkozak

comment created time in 2 months

Pull request review commentpalantir/dialogue

Response leak detection is always active

+/*+ * (c) Copyright 2020 Palantir Technologies Inc. All rights reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ *     http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package com.palantir.dialogue.hc5;++import static org.assertj.core.api.Assertions.assertThat;+import static org.assertj.core.api.Assumptions.assumeThat;++import java.io.ByteArrayOutputStream;+import java.nio.charset.StandardCharsets;+import java.time.Duration;+import java.util.concurrent.atomic.AtomicInteger;+import org.awaitility.Awaitility;+import org.junit.jupiter.api.Test;++class CleanerSupportTest {++    @Test+    void testEnabled() {+        boolean isJava8 = "1.8".equals(System.getProperty("java.specification.version"));

Junit exposes EnabledForJreRange to manage which JREs test should run on

carterkozak

comment created time in 2 months

pull request commentpalantir/dialogue

Authenticated proxy tests use special characters

🤖

carterkozak

comment created time in 2 months

pull request commentpalantir/dialogue

Authenticated proxy tests use special characters

👍

carterkozak

comment created time in 2 months

PR closed palantir/gradle-baseline

fix: logsafe argname is resilient to static final identifiers

Closes #1463

Before this PR

<!-- What's wrong with the current state of the world and why change it now? -->

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== logsafe argname is resilient to static final identifiers ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. -->

+23 -1

1 comment

3 changed files

ferozco

pr closed time in 2 months

pull request commentpalantir/gradle-baseline

fix: logsafe argname is resilient to static final identifiers

Closing in favour of #1465

ferozco

comment created time in 2 months

PR opened palantir/gradle-baseline

fix: logsafe argname is resilient to static final identifiers

Closes #1463

Before this PR

<!-- What's wrong with the current state of the world and why change it now? -->

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== logsafe argname is resilient to static final identifiers ==COMMIT_MSG==

Possible downsides?

<!-- Please describe any way users could be negatively affected by this PR. -->

+18 -1

0 comment

2 changed files

pr created time in 2 months

create barnchpalantir/gradle-baseline

branch : fo/fix-logsafe-argname

created branch time in 2 months

pull request commentpalantir/sls-packaging

Update YourKit version

👍

fawind

comment created time in 2 months

pull request commentpalantir/sls-packaging

Update YourKit version

We do this every few months we really should look into replacing yourKit or automating this

fawind

comment created time in 2 months

push eventpalantir/conjure-java

forozco

commit sha 55d4d9a98084c273990c1a35b74c750e9a58f412

fix

view details

forozco

commit sha 4f6edd37d60f5c416895449cebc4f61282dcc843

Merge branch 'fo/ignore-undertow-async' of github.com:palantir/conjure-java into fo/ignore-undertow-async

view details

push time in 2 months

pull request commentpalantir/conjure-java

improvement: dialogue interfaces ignore undertow async marker

@carterkozak it doesn't actually look like markers are used by undertow besides checking for the async flag so I think this is ready to go

ferozco

comment created time in 2 months

pull request commentpalantir/conjure-java

improvement: dialogue interfaces ignore undertow async marker

I was under the impression that undertow already omitted the annotation, will fix

ferozco

comment created time in 2 months

PR opened palantir/conjure-java

Reviewers
improvement: dialogue interfaces ignore undertow async marker

Before this PR

We would generate dialogue interfaces with a non-existant annotation if users chose to use the experimentalUndertowAsyncMarker

After this PR

<!-- User-facing outcomes this PR delivers go below --> ==COMMIT_MSG== Dialogue interfaces ignore undertow async marker ==COMMIT_MSG==

Possible downsides?

N/A

+48 -24

0 comment

3 changed files

pr created time in 2 months

push eventpalantir/gradle-conjure

forozco

commit sha a833424b0d7b367a8123308854db3da41a597ccd

Compat

view details

push time in 2 months

create barnchpalantir/conjure-java

branch : fo/ignore-undertow-async

created branch time in 2 months

push eventpalantir/gradle-conjure

forozco

commit sha efade81cce9642c0fb60065994890570aff1055c

eagerly execute clean rule

view details

push time in 2 months

PR opened palantir/gradle-conjure

pull out IR compilation into separate base plugin

Before this PR

We had a monolithic plugin that contained all of the logic for going from conjure source to generated code

After this PR

==COMMIT_MSG== pull out IR compilation into separate base plugin ==COMMIT_MSG==

Possible downsides?

N/A

+166 -96

0 comment

3 changed files

pr created time in 2 months

create barnchpalantir/gradle-conjure

branch : fo/refactor-ir-compilation

created branch time in 2 months

push eventpalantir/gradle-baseline

forozco

commit sha 9635426c5c486deaba8f5999a67aa7ce65a551f5

CR

view details

push time in 2 months

pull request commentpalantir/gradle-baseline

feature: add LogsafeArgName errorprone rule

I'd like to merge the associated internal PR first so that excavator will correctly apply the fix on baseline upgrades

ferozco

comment created time in 2 months

delete branch palantir/gradle-shadow-jar

delete branch : circleci/manage-circleci-oss

delete time in 2 months

PR merged palantir/gradle-shadow-jar

Excavator: Render CircleCI file using template specified in .circleci/template.sh no changelog
excavator is a bot for automating changes across repositories.

Changes produced by the circleci/manage-circleci-oss check.

To enable or disable this check, please contact the maintainers of Excavator.

+1 -1

0 comment

1 changed file

svc-excavator-bot

pr closed time in 2 months

delete branch palantir/gradle-shadow-jar

delete branch : roomba/oss-publish-scripts

delete time in 2 months

push eventpalantir/gradle-shadow-jar

Excavator Bot

commit sha 4593c0cd70e410d9adbd10535f6a7fce3ad86ef5

Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files (#31) Co-authored-by: svc-excavator-bot <svc-excavator-bot@palantir.com>

view details

push time in 2 months

PR merged palantir/gradle-shadow-jar

Excavator: Ensure consistent gradle/publish-(jar|dist).gradle files no changelog
excavator is a bot for automating changes across repositories.

Changes produced by the roomba/oss-publish-scripts check.

To enable or disable this check, please contact the maintainers of Excavator.

+1 -1

0 comment

1 changed file

svc-excavator-bot

pr closed time in 2 months

Pull request review commentpalantir/dialogue

Handshake time is no longer bounded by the connect timeout

+/*+ * (c) Copyright 2020 Palantir Technologies Inc. All rights reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ *     http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package com.palantir.dialogue;++import static org.assertj.core.api.Assertions.assertThat;+import static org.assertj.core.api.Assertions.assertThatThrownBy;++import com.google.common.collect.Iterables;+import com.google.common.util.concurrent.ForwardingExecutorService;+import com.google.common.util.concurrent.MoreExecutors;+import com.google.common.util.concurrent.Uninterruptibles;+import com.palantir.conjure.java.client.config.ClientConfiguration;+import com.palantir.conjure.java.config.ssl.SslSocketFactories;+import com.palantir.logsafe.Preconditions;+import com.palantir.logsafe.SafeLoggable;+import io.undertow.Undertow;+import io.undertow.server.handlers.ResponseCodeHandler;+import java.io.IOException;+import java.io.OutputStream;+import java.net.InetSocketAddress;+import java.net.SocketTimeoutException;+import java.nio.charset.StandardCharsets;+import java.time.Duration;+import java.util.concurrent.ExecutorService;+import java.util.concurrent.Executors;+import java.util.concurrent.atomic.AtomicReference;+import javax.net.ssl.SSLContext;+import org.junit.jupiter.api.Test;+import org.xnio.Xnio;+import org.xnio.XnioWorker;++public abstract class AbstractHandshakeTimeoutTest {++    private static final Request request = Request.builder()+            .body(new RequestBody() {+                @Override+                public void writeTo(OutputStream output) throws IOException {+                    output.write("Hello, World".getBytes(StandardCharsets.UTF_8));+                }++                @Override+                public String contentType() {+                    return "text/plain";+                }++                @Override+                public boolean repeatable() {+                    return true;+                }++                @Override+                public void close() {}+            })+            .build();++    protected abstract Channel create(ClientConfiguration config);++    private static int getPort(Undertow undertow) {+        return ((InetSocketAddress)+                        Iterables.getOnlyElement(undertow.getListenerInfo()).getAddress())+                .getPort();+    }++    @Test+    public void testHandshakeTimeout() throws Exception {+        SSLContext sslContext = SslSocketFactories.createSslContext(TestConfigurations.SSL_CONFIG);+        Xnio xnio = Xnio.getInstance(Undertow.class.getClassLoader());+        DelayingNextTaskExecutorService executor = new DelayingNextTaskExecutorService(Executors.newCachedThreadPool());+        XnioWorker worker = xnio.createWorkerBuilder()+                .setWorkerIoThreads(1)+                .setExternalExecutorService(executor)+                .build();+        Undertow server = Undertow.builder()+                .setWorker(worker)+                .setHandler(ResponseCodeHandler.HANDLE_200)+                .addHttpsListener(0, null, sslContext)+                .build();+        server.start();+        try {+            int serverPort = getPort(server);+            ClientConfiguration noRetryConfig = ClientConfiguration.builder()+                    .from(TestConfigurations.create("https://localhost:" + serverPort))+                    .connectTimeout(Duration.ofMillis(500))+                    .readTimeout(Duration.ofMillis(500))+                    .writeTimeout(Duration.ofMillis(500))+                    .maxNumRetries(0)+                    .build();+            Channel noRetryChannel = create(noRetryConfig);++            executor.delayNextTask(Duration.ofSeconds(1));++            assertThatThrownBy(noRetryChannel.execute(TestEndpoint.POST, request)::get)+                    .getCause()+                    .satisfies(cause -> assertThat(cause)+                            .isInstanceOf(SafeLoggable.class)+                            .isInstanceOf(IOException.class)+                            .isNotInstanceOf(SocketTimeoutException.class)+                            .extracting(value -> value.getClass().getSimpleName())+                            .isEqualTo("SafeConnectTimeoutException"));++            ClientConfiguration retryConfig = ClientConfiguration.builder()

mind pulling this out into a separate test case so that we have one that verifies the exception that is thrown and another which verifies the retry behaviour? I think having them be named test cases will make it clearer for future readers

carterkozak

comment created time in 2 months

Pull request review commentpalantir/dialogue

Handshake time is no longer bounded by the connect timeout

+/*+ * (c) Copyright 2020 Palantir Technologies Inc. All rights reserved.+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ *     http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++package com.palantir.dialogue;++import static org.assertj.core.api.Assertions.assertThat;+import static org.assertj.core.api.Assertions.assertThatThrownBy;++import com.google.common.collect.Iterables;+import com.google.common.util.concurrent.ForwardingExecutorService;+import com.google.common.util.concurrent.MoreExecutors;+import com.google.common.util.concurrent.Uninterruptibles;+import com.palantir.conjure.java.client.config.ClientConfiguration;+import com.palantir.conjure.java.config.ssl.SslSocketFactories;+import com.palantir.logsafe.Preconditions;+import com.palantir.logsafe.SafeLoggable;+import io.undertow.Undertow;+import io.undertow.server.handlers.ResponseCodeHandler;+import java.io.IOException;+import java.io.OutputStream;+import java.net.InetSocketAddress;+import java.net.SocketTimeoutException;+import java.nio.charset.StandardCharsets;+import java.time.Duration;+import java.util.concurrent.ExecutorService;+import java.util.concurrent.Executors;+import java.util.concurrent.atomic.AtomicReference;+import javax.net.ssl.SSLContext;+import org.junit.jupiter.api.Test;+import org.xnio.Xnio;+import org.xnio.XnioWorker;++public abstract class AbstractHandshakeTimeoutTest {++    private static final Request request = Request.builder()+            .body(new RequestBody() {+                @Override+                public void writeTo(OutputStream output) throws IOException {+                    output.write("Hello, World".getBytes(StandardCharsets.UTF_8));+                }++                @Override+                public String contentType() {+                    return "text/plain";+                }++                @Override+                public boolean repeatable() {+                    return true;+                }++                @Override+                public void close() {}+            })+            .build();++    protected abstract Channel create(ClientConfiguration config);++    private static int getPort(Undertow undertow) {+        return ((InetSocketAddress)+                        Iterables.getOnlyElement(undertow.getListenerInfo()).getAddress())+                .getPort();+    }++    @Test+    public void testHandshakeTimeout() throws Exception {+        SSLContext sslContext = SslSocketFactories.createSslContext(TestConfigurations.SSL_CONFIG);+        Xnio xnio = Xnio.getInstance(Undertow.class.getClassLoader());+        DelayingNextTaskExecutorService executor = new DelayingNextTaskExecutorService(Executors.newCachedThreadPool());+        XnioWorker worker = xnio.createWorkerBuilder()+                .setWorkerIoThreads(1)+                .setExternalExecutorService(executor)+                .build();+        Undertow server = Undertow.builder()+                .setWorker(worker)+                .setHandler(ResponseCodeHandler.HANDLE_200)+                .addHttpsListener(0, null, sslContext)+                .build();+        server.start();+        try {+            int serverPort = getPort(server);+            ClientConfiguration noRetryConfig = ClientConfiguration.builder()+                    .from(TestConfigurations.create("https://localhost:" + serverPort))+                    .connectTimeout(Duration.ofMillis(500))+                    .readTimeout(Duration.ofMillis(500))+                    .writeTimeout(Duration.ofMillis(500))+                    .maxNumRetries(0)+                    .build();+            Channel noRetryChannel = create(noRetryConfig);++            executor.delayNextTask(Duration.ofSeconds(1));++            assertThatThrownBy(noRetryChannel.execute(TestEndpoint.POST, request)::get)+                    .getCause()+                    .satisfies(cause -> assertThat(cause)+                            .isInstanceOf(SafeLoggable.class)+                            .isInstanceOf(IOException.class)+                            .isNotInstanceOf(SocketTimeoutException.class)+                            .extracting(value -> value.getClass().getSimpleName())+                            .isEqualTo("SafeConnectTimeoutException"));

need to do all of this since SafeConnectTimeoutException is packagePrivate

carterkozak

comment created time in 2 months

more