-
Notifications
You must be signed in to change notification settings - Fork 173
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
chore(dependency): upgrade spring boot from 2.7.x to 3.0.x and spring cloud from 2021.0.x to 2022.0.x #1216
base: master
Are you sure you want to change the base?
Conversation
kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java
Outdated
Show resolved
Hide resolved
kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedisPool.java
Outdated
Show resolved
Hide resolved
kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java
Outdated
Show resolved
Hide resolved
this.delegated = delegated; | ||
this.poolName = poolName; | ||
/* | ||
Removed all parameterised constructors, as no default constructor is available in Pipeline |
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.
A comment like this feels like it belongs in the commit message. What changed in Pipeline to make that constructor disappear? What users of InstrumentedPipeline are affected by this?
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.
Working on it.
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.
In Jedis 4.x, default constructor of Pipeline
class has be removed in lieu of parameterised constructor to obtain Connection
object either directly passing Connection
or Jedis
, as discussed here. So, updating the constructor by replacing the Pipeline
with Jedis
, and updated its usage in InstrumentedJedis.pipelined()
method.
kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java
Outdated
Show resolved
Hide resolved
import redis.clients.jedis.commands.RedisPipeline; | ||
import redis.clients.jedis.commands.ScriptingCommands; | ||
import redis.clients.jedis.params.ScanParams; | ||
import redis.clients.jedis.resps.ScanResult; | ||
import redis.clients.jedis.util.Pool; | ||
|
||
public class JedisClientDelegate implements RedisClientDelegate { |
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.
Would switching this to kotlin and using delegation help here?
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.
Kotlin delegation seems to be an effortless option for this class, however IMO it can be taken up as a separate PR.
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.
Yeah, I think we'd get the most benefit by doing it first since I figure that makes the spring boot upgrade simpler.
51f1d69
to
1333099
Compare
The version of kotlin changes from 1.6.21 in spring boot 2.7.18 to 1.7.22 in spring boot 3.0.13. What changes do we need to stay in sync with that? |
import redis.clients.jedis.params.ZAddParams; | ||
import redis.clients.jedis.params.ZIncrByParams; | ||
import redis.clients.jedis.params.ZParams; | ||
import redis.clients.jedis.resps.GeoRadiusResponse; | ||
import redis.clients.jedis.resps.Tuple; | ||
|
||
public class InstrumentedPipeline extends Pipeline { |
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.
Please add some javadoc describing what this class does and why we have it....and to each member variable as well.
springBoot : "2.7.18", | ||
springCloud : "2021.0.8", | ||
springBoot : "3.0.13", | ||
springCloud : "2022.0.5", | ||
swagger : "2.2.22", | ||
// 2.7.18 brings in 9.0.83, which fixes all CVEs to date (20-feb-24). Continue to pin. |
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.
please update the comment for 3.0.13.
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.
Updated the code.
97ce137
to
316af12
Compare
@@ -46,14 +48,13 @@ public EventBus eventBus() { | |||
return new EventBusImpl(); | |||
} | |||
|
|||
/** @deprecated use EurekaClient rather than DiscoveryClient */ |
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.
Why remove the deprecation?
import org.springframework.util.StringUtils; | ||
|
||
@Component | ||
public class ActuatorSanitizingFunction implements SanitizingFunction { |
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.
javadoc please. And where do all these hard-coded strings come from?
f402830
to
7f086f3
Compare
… cloud from 2021.0.x to 2022.0.x Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5. Spring cloud release 2022.0.x is compatible with spring boot 3.0.x. https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases Unpinning okhttp and rest-assured, as spring boot [3.0.13](https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/3.0.13/spring-boot-dependencies-3.0.13.pom) brings okhttp 4.10.0 and rest-assured 5.2.1. While upgrading the spring boot and spring cloud, encountered the below errors during build process of kork-jedis module: ``` > Task :kork-jedis:compileJava FAILED /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:23: error: cannot find symbol import redis.clients.jedis.ScanParams; ^ symbol: class ScanParams location: package redis.clients.jedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:24: error: cannot find symbol import redis.clients.jedis.ScanResult; ^ symbol: class ScanResult location: package redis.clients.jedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:26: error: cannot find symbol import redis.clients.jedis.commands.BinaryJedisCommands; ^ symbol: class BinaryJedisCommands location: package redis.clients.jedis.commands /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:28: error: cannot find symbol import redis.clients.jedis.commands.MultiKeyCommands; ^ symbol: class MultiKeyCommands location: package redis.clients.jedis.commands /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:29: error: cannot find symbol import redis.clients.jedis.commands.RedisPipeline; ^ symbol: class RedisPipeline location: package redis.clients.jedis.commands /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:30: error: cannot find symbol import redis.clients.jedis.commands.ScriptingCommands; ^ symbol: class ScriptingCommands location: package redis.clients.jedis.commands /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:22: error: cannot find symbol import redis.clients.jedis.commands.BinaryJedisCommands; ^ symbol: class BinaryJedisCommands location: package redis.clients.jedis.commands /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:24: error: cannot find symbol import redis.clients.jedis.commands.MultiKeyCommands; ^ symbol: class MultiKeyCommands location: package redis.clients.jedis.commands /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:25: error: cannot find symbol import redis.clients.jedis.commands.RedisPipeline; ^ symbol: class RedisPipeline location: package redis.clients.jedis.commands /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:26: error: cannot find symbol import redis.clients.jedis.commands.ScriptingCommands; ^ symbol: class ScriptingCommands location: package redis.clients.jedis.commands /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:67: error: cannot find symbol public <R> R withMultiClient(Function<MultiKeyCommands, R> f) { ^ symbol: class MultiKeyCommands location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:74: error: cannot find symbol public void withMultiClient(Consumer<MultiKeyCommands> f) { ^ symbol: class MultiKeyCommands location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:81: error: cannot find symbol public <R> R withBinaryClient(Function<BinaryJedisCommands, R> f) { ^ symbol: class BinaryJedisCommands location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:88: error: cannot find symbol public void withBinaryClient(Consumer<BinaryJedisCommands> f) { ^ symbol: class BinaryJedisCommands location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:95: error: cannot find symbol public void withPipeline(Consumer<RedisPipeline> f) { ^ symbol: class RedisPipeline location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:102: error: cannot find symbol public <R> R withPipeline(Function<RedisPipeline, R> f) { ^ symbol: class RedisPipeline location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:109: error: cannot find symbol public void syncPipeline(RedisPipeline p) { ^ symbol: class RedisPipeline location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:162: error: cannot find symbol public void withScriptingClient(Consumer<ScriptingCommands> f) { ^ symbol: class ScriptingCommands location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/JedisClientDelegate.java:169: error: cannot find symbol public <R> R withScriptingClient(Function<ScriptingCommands, R> f) { ^ symbol: class ScriptingCommands location: class JedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:41: error: cannot find symbol <R> R withMultiClient(Function<MultiKeyCommands, R> f); ^ symbol: class MultiKeyCommands location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:43: error: cannot find symbol void withMultiClient(Consumer<MultiKeyCommands> f); ^ symbol: class MultiKeyCommands location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:45: error: cannot find symbol <R> R withBinaryClient(Function<BinaryJedisCommands, R> f); ^ symbol: class BinaryJedisCommands location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:47: error: cannot find symbol void withBinaryClient(Consumer<BinaryJedisCommands> f); ^ symbol: class BinaryJedisCommands location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:49: error: cannot find symbol void withPipeline(Consumer<RedisPipeline> f); ^ symbol: class RedisPipeline location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:51: error: cannot find symbol <R> R withPipeline(Function<RedisPipeline, R> f); ^ symbol: class RedisPipeline location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:53: error: cannot find symbol void syncPipeline(RedisPipeline p); ^ symbol: class RedisPipeline location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:69: error: cannot find symbol void withScriptingClient(Consumer<ScriptingCommands> f); ^ symbol: class ScriptingCommands location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/RedisClientDelegate.java:71: error: cannot find symbol <R> R withScriptingClient(Function<ScriptingCommands, R> f); ^ symbol: class ScriptingCommands location: interface RedisClientDelegate /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:107: error: cannot find symbol public void setClient(Client client) { ^ symbol: class Client location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:386: error: cannot find symbol public Response<Long> sort(String key, SortingParams sortingParameters, String dstkey) { ^ symbol: class SortingParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:392: error: cannot find symbol public Response<Long> sort(byte[] key, SortingParams sortingParameters, byte[] dstkey) { ^ symbol: class SortingParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:458: error: cannot find symbol public Response<Long> zinterstore(String dstkey, ZParams params, String... sets) { ^ symbol: class ZParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:464: error: cannot find symbol public Response<Long> zinterstore(byte[] dstkey, ZParams params, byte[]... sets) { ^ symbol: class ZParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:482: error: cannot find symbol public Response<Long> zunionstore(String dstkey, ZParams params, String... sets) { ^ symbol: class ZParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:488: error: cannot find symbol public Response<Long> zunionstore(byte[] dstkey, ZParams params, byte[]... sets) { ^ symbol: class ZParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:626: error: cannot find symbol public Response<Long> bitop(BitOP op, byte[] destKey, byte[]... srcKeys) { ^ symbol: class BitOP location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:632: error: cannot find symbol public Response<Long> bitop(BitOP op, String destKey, String... srcKeys) { ^ symbol: class BitOP location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:916: error: cannot find symbol public Response<Long> bitpos(String key, boolean value, BitPosParams params) { ^ symbol: class BitPosParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:928: error: cannot find symbol public Response<Long> bitpos(byte[] key, boolean value, BitPosParams params) { ^ symbol: class BitPosParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1414: error: cannot find symbol public Response<List<String>> sort(String key, SortingParams sortingParameters) { ^ symbol: class SortingParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1420: error: cannot find symbol public Response<List<byte[]>> sort(byte[] key, SortingParams sortingParameters) { ^ symbol: class SortingParams location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1708: error: cannot find symbol public Response<Set<Tuple>> zrangeByScoreWithScores(String key, double min, double max) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1714: error: cannot find symbol public Response<Set<Tuple>> zrangeByScoreWithScores(String key, String min, String max) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1720: error: cannot find symbol public Response<Set<Tuple>> zrangeByScoreWithScores(byte[] key, double min, double max) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1726: error: cannot find symbol public Response<Set<Tuple>> zrangeByScoreWithScores(byte[] key, byte[] min, byte[] max) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1732: error: cannot find symbol public Response<Set<Tuple>> zrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1740: error: cannot find symbol public Response<Set<Tuple>> zrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1748: error: cannot find symbol public Response<Set<Tuple>> zrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1756: error: cannot find symbol public Response<Set<Tuple>> zrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1816: error: cannot find symbol public Response<Set<Tuple>> zrevrangeByScoreWithScores(String key, double max, double min) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1822: error: cannot find symbol public Response<Set<Tuple>> zrevrangeByScoreWithScores(String key, String max, String min) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1828: error: cannot find symbol public Response<Set<Tuple>> zrevrangeByScoreWithScores(byte[] key, double max, double min) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1834: error: cannot find symbol public Response<Set<Tuple>> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] min) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1840: error: cannot find symbol public Response<Set<Tuple>> zrevrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1848: error: cannot find symbol public Response<Set<Tuple>> zrevrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1856: error: cannot find symbol public Response<Set<Tuple>> zrevrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1864: error: cannot find symbol public Response<Set<Tuple>> zrevrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1872: error: cannot find symbol public Response<Set<Tuple>> zrangeWithScores(String key, long start, long end) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1878: error: cannot find symbol public Response<Set<Tuple>> zrangeWithScores(byte[] key, long start, long end) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1956: error: cannot find symbol public Response<Set<Tuple>> zrevrangeWithScores(String key, long start, long end) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:1962: error: cannot find symbol public Response<Set<Tuple>> zrevrangeWithScores(byte[] key, long start, long end) { ^ symbol: class Tuple location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2346: error: cannot find symbol public Response<Double> geodist(byte[] key, byte[] member1, byte[] member2, GeoUnit unit) { ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2358: error: cannot find symbol public Response<Double> geodist(String key, String member1, String member2, GeoUnit unit) { ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2389: error: cannot find symbol byte[] key, double longitude, double latitude, double radius, GeoUnit unit) { ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2388: error: cannot find symbol public Response<List<GeoRadiusResponse>> georadius( ^ symbol: class GeoRadiusResponse location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2400: error: cannot find symbol GeoUnit unit, ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2395: error: cannot find symbol public Response<List<GeoRadiusResponse>> georadius( ^ symbol: class GeoRadiusResponse location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2409: error: cannot find symbol String key, double longitude, double latitude, double radius, GeoUnit unit) { ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2408: error: cannot find symbol public Response<List<GeoRadiusResponse>> georadius( ^ symbol: class GeoRadiusResponse location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2420: error: cannot find symbol GeoUnit unit, ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2415: error: cannot find symbol public Response<List<GeoRadiusResponse>> georadius( ^ symbol: class GeoRadiusResponse location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2429: error: cannot find symbol byte[] key, byte[] member, double radius, GeoUnit unit) { ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2428: error: cannot find symbol public Response<List<GeoRadiusResponse>> georadiusByMember( ^ symbol: class GeoRadiusResponse location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2436: error: cannot find symbol byte[] key, byte[] member, double radius, GeoUnit unit, GeoRadiusParam param) { ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2435: error: cannot find symbol public Response<List<GeoRadiusResponse>> georadiusByMember( ^ symbol: class GeoRadiusResponse location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2444: error: cannot find symbol String key, String member, double radius, GeoUnit unit) { ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2443: error: cannot find symbol public Response<List<GeoRadiusResponse>> georadiusByMember( ^ symbol: class GeoRadiusResponse location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2451: error: cannot find symbol String key, String member, double radius, GeoUnit unit, GeoRadiusParam param) { ^ symbol: class GeoUnit location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedPipeline.java:2450: error: cannot find symbol public Response<List<GeoRadiusResponse>> georadiusByMember( ^ symbol: class GeoRadiusResponse location: class InstrumentedPipeline /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:33: error: cannot find symbol import redis.clients.jedis.util.Slowlog; ^ symbol: class Slowlog location: package redis.clients.jedis.util /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:599: error: cannot find symbol public Set<Tuple> zrangeWithScores(String key, long start, long end) { ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:605: error: cannot find symbol public Set<Tuple> zrevrangeWithScores(String key, long start, long end) { ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:635: error: cannot find symbol public List<String> sort(String key, SortingParams sortingParameters) { ^ symbol: class SortingParams location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:659: error: cannot find symbol public Long sort(String key, SortingParams sortingParameters, String dstkey) { ^ symbol: class SortingParams location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:713: error: cannot find symbol public Set<Tuple> zrangeByScoreWithScores(String key, double min, double max) { ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:719: error: cannot find symbol public Set<Tuple> zrangeByScoreWithScores(String key, String min, String max) { ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:725: error: cannot find symbol public Set<Tuple> zrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:733: error: cannot find symbol public Set<Tuple> zrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:759: error: cannot find symbol public Set<Tuple> zrevrangeByScoreWithScores(String key, double max, double min) { ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:765: error: cannot find symbol public Set<Tuple> zrevrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:773: error: cannot find symbol public Set<Tuple> zrevrangeByScoreWithScores( ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:787: error: cannot find symbol public Set<Tuple> zrevrangeByScoreWithScores(String key, String max, String min) { ^ symbol: class Tuple location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:817: error: cannot find symbol public Long zunionstore(String dstkey, ZParams params, String... sets) { ^ symbol: class ZParams location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:829: error: cannot find symbol public Long zinterstore(String dstkey, ZParams params, String... sets) { ^ symbol: class ZParams location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:902: error: cannot find symbol final String key, final ListPosition where, final String pivot, final String value) { ^ symbol: class ListPosition location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:951: error: cannot find symbol public Long bitpos(String key, boolean value, BitPosParams params) { ^ symbol: class BitPosParams location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:1044: error: cannot find symbol public List<Slowlog> slowlogGet() { ^ symbol: class Slowlog location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:1050: error: cannot find symbol public List<Slowlog> slowlogGet(long entries) { ^ symbol: class Slowlog location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:1086: error: cannot find symbol public Long bitop(BitOP op, String destKey, String... srcKeys) { ^ symbol: class BitOP location: class InstrumentedJedis /kork/kork-jedis/src/main/java/com/netflix/spinnaker/kork/jedis/telemetry/InstrumentedJedis.java:1195: error: cannot find symbol public ScanResult<String> scan(String cursor) { ^ symbol: class ScanResult location: class InstrumentedJedis 100 errors only showing the first 100 errors, of 166 total; use -Xmaxerrs if you would like to see more ``` The root cause of these errors is upgrade of `redis.clients:jedis` from 3.8.0 to 4.3.2 with spring boot upgrade from 2.x to 3.x. In order to fix these issues, migrated jedis from 3.x to 4.x by following the migration [document](https://github.com/redis/jedis/blob/master/docs/3to4.md) And for further changelogs, please refer [here](https://github.com/redis/jedis/releases/tag/v4.0.0) Removed the reflection logic to check the `internalPool` field from `JedisPool` object, as `internalPool` field has been removed from Jedis [4.3.2](https://javadoc.io/static/redis.clients/jedis/4.3.2/redis/clients/jedis/util/Pool.html#internalPool) and `JedisPool` is sub class of `GenericObjectPool` from Jedis [4.0.0](redis/jedis#2521) onwards. So, refactoring the logic to check null value. In Jedis 4.x, default constructor of `Pipeline` class has be removed in lieu of parameterised constructor to obtain `Connection` object either directly passing `Connection` or `Jedis`, as discussed [here](redis/jedis#2693). So, updating the constructor by replacing the `Pipeline` with `Jedis`, and updated its usage in `InstrumentedJedis.pipelined()` method.
…orAdapter with HandlerInterceptor during upgrade of spring boot 3.0.x Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades So, replacing the imports with `javax` to `jakarta`. Since `org.springframework.web.servlet.handler.HandlerInterceptorAdapter` has been deprecated in springframework 5.3.0. So, replacing it with `org.springframework.web.servlet.HandlerInterceptor`. spring-projects/spring-framework#25147 terasolunaorg/terasoluna-gfw#991
…g upgrade of spring boot 3.0.x While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-crypto module: ``` > Task :kork-crypto:compileJava FAILED /kork/kork-crypto/src/main/java/com/netflix/spinnaker/kork/crypto/NestedSecurityIOException.java:20: error: cannot find symbol import org.springframework.core.NestedIOException; ^ symbol: class NestedIOException location: package org.springframework.core /kork/kork-crypto/src/main/java/com/netflix/spinnaker/kork/crypto/NestedSecurityIOException.java:22: error: cannot find symbol public class NestedSecurityIOException extends NestedIOException { ^ symbol: class NestedIOException 2 errors ``` The root cause is the removal of `org.springframework.core.NestedIOException` from springframework 6.0, as mentioned in the below links: spring-projects/spring-framework#28198 spring-projects/spring-framework#28929 So, replacing `org.springframework.core.NestedIOException` with `java.io.IOException`.
…code during upgrade of spring boot 3.0.x While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-eureka module: ``` > Task :kork-eureka:compileJava FAILED /kork/kork-eureka/src/main/java/com/netflix/spinnaker/kork/eureka/EurekaAutoConfiguration.java:55: error: cannot find symbol DiscoveryClient.DiscoveryClientOptionalArgs optionalArgs) { ^ symbol: class DiscoveryClientOptionalArgs location: class DiscoveryClient /kork/kork-eureka/src/main/java/com/netflix/spinnaker/kork/eureka/EurekaAutoConfiguration.java:89: error: cannot find symbol DiscoveryClient.DiscoveryClientOptionalArgs optionalArgs( ^ symbol: class DiscoveryClientOptionalArgs location: class DiscoveryClient 2 errors ``` Spring cloud upgrade from 2021.0.x to 2022.0.x also upgrades the eureka client transitively from [1.10.17](https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2021.0.8) to [2.0.1](https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2022.0.5) Eureka client 2.0.x is not backward compatible with 1.0.x. The constructor has also introduced new parameter. So, update the code accordingly. https://github.com/Netflix/eureka/releases/tag/v2.0.0
…ring upgrade of spring boot 3.0.x While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-telemetry module: ``` > Task :kork-telemetry:compileJava FAILED /kork/kork-telemetry/src/main/java/com/netflix/spinnaker/kork/telemetry/caffeine/CaffeineStatsCounter.java:26: error: CaffeineStatsCounter is not abstract and does not override abstract method recordEviction(int,RemovalCause) in StatsCounter public class CaffeineStatsCounter implements StatsCounter { ^ /kork/kork-telemetry/src/main/java/com/netflix/spinnaker/kork/telemetry/caffeine/CaffeineStatsCounter.java:73: error: method does not override or implement a method from a supertype @OverRide ^ /kork/kork-telemetry/src/main/java/com/netflix/spinnaker/kork/telemetry/caffeine/CaffeineStatsCounter.java:79: error: method does not override or implement a method from a supertype @OverRide ^ /kork/kork-telemetry/src/main/java/com/netflix/spinnaker/kork/telemetry/caffeine/CaffeineStatsCounter.java:87: error: CacheStats(long,long,long,long,long,long,long) has private access in CacheStats return new CacheStats( ^ 4 errors ``` Spring boot upgrade brings the caffeine 3.1.8 transitively, that was 2.9.3 with spring boot 2.7.x. In caffeine 3.x, `StatsCounter.recordEviction` method variation has been deprecated and `CacheStats` constructor. So, update the both of them. https://github.com/ben-manes/caffeine/releases/tag/v3.0.0 https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/latest/com.github.benmanes.caffeine/com/github/benmanes/caffeine/cache/stats/StatsCounter.html https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.9.3/com/github/benmanes/caffeine/cache/stats/StatsCounter.html
…pring boot 3.0.x While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-stackdriver module: ``` > Task :kork-stackdriver:compileJava FAILED /kork/kork-stackdriver/src/main/java/com/netflix/spinnaker/config/StackdriverConfig.java:41: error: package rx does not exist import rx.Observable; ^ /kork/kork-stackdriver/src/main/java/com/netflix/spinnaker/config/StackdriverConfig.java:42: error: package rx does not exist import rx.Scheduler; ^ /kork/kork-stackdriver/src/main/java/com/netflix/spinnaker/config/StackdriverConfig.java:43: error: package rx.schedulers does not exist import rx.schedulers.Schedulers; ^ 3 errors ``` Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava
…ith spring boot upgrade to 3.x While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-actuator module: ``` > Task :kork-actuator:compileJava FAILED /kork/kork-actuator/src/main/java/com/netflix/spinnaker/kork/actuator/ActuatorEndpointsConfiguration.java:26: error: cannot find symbol import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; ^ symbol: class WebSecurityConfigurerAdapter location: package org.springframework.security.config.annotation.web.configuration /kork/kork-actuator/src/main/java/com/netflix/spinnaker/kork/actuator/ActuatorEndpointsConfiguration.java:30: error: cannot find symbol public class ActuatorEndpointsConfiguration extends WebSecurityConfigurerAdapter { ^ symbol: class WebSecurityConfigurerAdapter 2 errors ``` With spring boot upgrade, spring security also upgrades from 5.x to 6.x. As per the migration [steps](https://www.baeldung.com/spring-security-migrate-5-to-6), `WebSecurityConfigurerAdapter` has been removed. So, it is not required to be extended, instead bean can be registered. ``` > Task :kork-actuator:compileJava FAILED /kork/kork-actuator/src/main/java/com/netflix/spinnaker/kork/actuator/endpoint/ResolvedEnvironmentEndpoint.java:45: error: invalid method reference .ifPresent(sanitizer::setKeysToSanitize); ^ cannot find symbol symbol: method setKeysToSanitize(T) location: class Sanitizer where T is a type-variable: T extends Object declared in class Optional /kork/kork-actuator/src/main/java/com/netflix/spinnaker/kork/actuator/endpoint/ResolvedEnvironmentEndpoint.java:56: error: incompatible types: String cannot be converted to SanitizableData return sanitizer.sanitize(property, environment.getProperty(property)); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 2 errors ``` In spring boot 3, changes are introduced in sanitization of actuator [endpoints](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#actuator-endpoints-sanitization). Default `Sanitizer` implementation has been removed and replaced with `SanitizingFunction`. spring-projects/spring-boot#33448 spring-projects/spring-boot#39243 spring-projects/spring-boot#32156 So, added the `ActuatorSanitizingFunction` class to provide the default implementation of `SanitizingFunction`.
…grade wiremock as part of spring boot 3.x upgrade While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors: ``` Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.inject.Provider<com.netflix.spectator.api.Registry>' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1824) at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1383) at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) at app//org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:910) at app//org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ... 175 more ``` The root cause is use of `javax.inject` that has been moved from present coordinate to `jakarta.inject`. So, updating the coordinates in kork-eureka, kork-plugins and kork-web modules. google/guice#1463 google/guice#1383 https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject ``` javax/servlet/DispatcherType java.lang.NoClassDefFoundError: javax/servlet/DispatcherType at com.github.tomakehurst.wiremock.jetty9.JettyHttpServerFactory.buildHttpServer(JettyHttpServerFactory.java:31) at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:74) at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$Fixture.<init>(Ok3HttpClientIntegrationTest.kt:78) at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40) at com.netflix.spinnaker.kork.plugins.sdk.httpclient.Ok3HttpClientIntegrationTest$test$1$1.invoke(Ok3HttpClientIntegrationTest.kt:40) at dev.minutest.TestContextBuilder$fixture$1.invoke(ContextBuilder.kt:48) ``` In order to fix this issue, upgrading wiremock dependency to 3.0.4 and updating its coordinates. Wiremock [3.0.0](https://github.com/wiremock/wiremock/releases/tag/3.0.0) onwards 2 major breaking changes are introduced: 1. support for Java 17, dropping Java 8 support 2. Change the Maven repository groupID to org.wiremock https://github.com/wiremock/wiremock/releases?page=3
…n-profile as part of spring boot 3.x upgrade While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below error: ``` Caused by: org.springframework.boot.context.config.InvalidConfigDataPropertyException: Property 'spring.profiles' imported from location 'class path resource [application-test.yml]' is invalid and should be replaced with 'spring.config.activate.on-profile' [origin: class path resource [application-test.yml] - 38:13] at app//org.springframework.boot.context.config.InvalidConfigDataPropertyException.lambda$throwIfPropertyFound$0(InvalidConfigDataPropertyException.java:113) at [email protected]/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) at [email protected]/java.util.Collections$UnmodifiableMap.forEach(Collections.java:1553) at app//org.springframework.boot.context.config.InvalidConfigDataPropertyException.throwIfPropertyFound(InvalidConfigDataPropertyException.java:109) at app//org.springframework.boot.context.config.ConfigDataEnvironment.checkForInvalidProperties(ConfigDataEnvironment.java:364) ``` In order to fix this issue, replacing spring.profiles with spring.config.activate.on-profile in application-test.yml
…rt of spring boot 3.x upgrade ``` > Task :kork-sql-test:compileJava FAILED /kork/kork-sql-test/src/main/java/com/netflix/spinnaker/kork/sql/test/SqlTestUtil.java:278: error: cannot find symbol table.getType().isTable() ^ symbol: method isTable() location: class Class<CAP#1> where CAP#1 is a fresh type-variable: CAP#1 extends Record from capture of ? 1 error ``` The root cause is the change in method of `org.jooq.Table` class upgrading jooq transitively from 3.14.16 to 3.17.16 while spring boot 2.7.18 to 3.0.13 upgrade. In order to fix this issue refactoring the `getTableType()` method.
… spring security from 5.x to 6.x and ninja-squad upgrade with spring boot upgrade to 3.x While upgrading spring security from 5.x to 6.x, encountered the below error: ``` Cannot invoke method getForEntity() on null object java.lang.NullPointerException: Cannot invoke method getForEntity() on null object at com.netflix.spinnaker.kork.web.exceptions.GenericExceptionHandlersMvcSpec.ok request(GenericExceptionHandlersMvcSpec.groovy:42) Cannot invoke method getForEntity() on null object java.lang.NullPointerException: Cannot invoke method getForEntity() on null object at com.netflix.spinnaker.kork.web.exceptions.GenericExceptionHandlersMvcSpec.not found(GenericExceptionHandlersMvcSpec.groovy:50) Cannot invoke method postForEntity() on null object java.lang.NullPointerException: Cannot invoke method postForEntity() on null object at com.netflix.spinnaker.kork.web.exceptions.GenericExceptionHandlersMvcSpec.method not supported(GenericExceptionHandlersMvcSpec.groovy:58) Cannot invoke method getForEntity() on null object java.lang.NullPointerException: Cannot invoke method getForEntity() on null object at com.netflix.spinnaker.kork.web.exceptions.GenericExceptionHandlersMvcSpec.missing request param(GenericExceptionHandlersMvcSpec.groovy:66) Cannot invoke method getForEntity() on null object java.lang.NullPointerException: Cannot invoke method getForEntity() on null object at com.netflix.spinnaker.kork.web.exceptions.GenericExceptionHandlersMvcSpec.should map IllegalArgumentException as 400(GenericExceptionHandlersMvcSpec.groovy:74) Cannot invoke method getForEntity() on null object java.lang.NullPointerException: Cannot invoke method getForEntity() on null object at com.netflix.spinnaker.kork.web.exceptions.GenericExceptionHandlersMvcSpec.should handle IllegalStateException(GenericExceptionHandlersMvcSpec.groovy:82) ``` The root cause of this issue is a incompatibility bug in spockframework 2.3-groovy-4.0 version. In order to fix this issue upgraded the spockframe to 2.4-M1-groovy-4.0 spring-projects/spring-boot#33376 https://spockframework.org/spock/docs/2.4-M1/release_notes.html#_2_4_m1_2022_11_30 Also encountered below error during test execution of kork-plugins-tck module: ``` java.lang.NoClassDefFoundError: org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at com.ninjasquad.springmockk.MockkContextCustomizer.customizeContext(MockkContextCustomizer.kt:21) at org.springframework.boot.test.context.SpringBootContextLoader$ContextCustomizerAdapter.initialize(SpringBootContextLoader.java:435) at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:606) at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:386) ``` In order to fix this issue, upgraded the ninja-squad dependency from 2.0.3 to 4.0.2 for the compatibility with Spring boot 3.x and Java 17+. https://github.com/Ninja-Squad/springmockk?tab=readme-ov-file#versions-compatibility
… boot upgrade to 3.x Spring boot 3.0.13 brings snakeyaml 1.33 and logback 1.4.11. So, upgrading and pinning logback to 1.4.14, till spring boot >=3.1.7, as more secure version.
// upgrade >= 3.0.7 and to resolve CVE-2022-25857 and CVE-2022-38749. See | ||
// https://bitbucket.org/snakeyaml/snakeyaml/issues/547/restrict-the-size-of-incoming-data | ||
// and https://bitbucket.org/snakeyaml/snakeyaml/pull-requests/22. | ||
api("org.yaml:snakeyaml:1.31") |
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.
By unpinning, we get snakeyaml 1.33 from spring boot 3.0.13. And snakeyaml 1.32 limits the size of incoming data to 3MB by default. See:
- https://bitbucket.org/snakeyaml/snakeyaml/wiki/Changes
- https://bitbucket.org/snakeyaml/snakeyaml/issues/547/restrict-the-size-of-incoming-data
- https://bitbucket.org/snakeyaml/snakeyaml/pull-requests/22
I don't think it's safe to upgrade snakeyaml to >= 1.32 until we provide a config knob to change the limit.
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.
With 1.31 version, tests are breaking in fiat (yet to verify for other components):
PermissionsTest > testGetAuthorizations() FAILED
java.lang.NoSuchMethodError: 'void org.yaml.snakeyaml.LoaderOptions.setCodePointLimit(int)'
at org.springframework.boot.env.OriginTrackedYamlLoader.createYaml(OriginTrackedYamlLoader.java:70)
at org.springframework.beans.factory.config.YamlProcessor.process(YamlProcessor.java:164)
at org.springframework.boot.env.OriginTrackedYamlLoader.load(OriginTrackedYamlLoader.java:84)
at org.springframework.boot.env.YamlPropertySourceLoader.load(YamlPropertySourceLoader.java:50)
at com.netflix.spinnaker.fiat.YamlFileApplicationContextInitializer.initialize(YamlFileApplicationContextInitializer.java:36)
at org.springframework.test.context.support.AbstractContextLoader.invokeApplicationContextInitializers(AbstractContextLoader.java:172)
So, it seems pinning snakeyaml is blocker for other components.
In current situation, providing the config knob to change the limits would be priority. That helps to upgrade snakeyaml.
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.
Looks like spring boot depends on it, so yup, we need it. Did spring boot already add a config knob? That’ll work for e.g. spring config files. I think we’ll still need to add a knob for processing k8s yaml.
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.
It seems issue has been solved here and limit has been raise for Integer.MAX_VALUE
.
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.
Look at that! Thanks to @kirangodishala. We still need to handle explicit use of snakeyaml in spinnaker…
Upgrading spring boot 2.7.18 to 3.0.13 and spring cloud 2021.0.8 to 2022.0.5. Spring cloud release 2022.0.x is compatible with spring boot 3.0.x.
https://github.com/spring-cloud/spring-cloud-release/wiki/Supported-Versions#supported-releases
Unpinning okhttp and rest-assured, as spring boot 3.0.13 brings okhttp 4.10.0 and rest-assured 5.2.1.
While upgrading the spring boot and spring cloud, encountered the below errors during build process of kork-jedis module:
The root cause of these errors is upgrade of
redis.clients:jedis
from 3.8.0 to 4.3.2 with spring boot upgrade from 2.x to 3.x. In order to fix these issues, migrated jedis from 3.x to 4.x by following the migration document And for further changelogs, please refer hereRemoved the reflection logic to check the
internalPool
field fromJedisPool
object, asinternalPool
field has been removed from Jedis 4.3.2 andJedisPool
is sub class ofGenericObjectPool
from Jedis 4.0.0 onwards. So, refactoring the logic to check null value.In Jedis 4.x, default constructor of
Pipeline
class has be removed in lieu of parameterised constructor to obtainConnection
object either directly passingConnection
orJedis
, as discussed here. So, updating the constructor by replacing thePipeline
withJedis
, and updated its usage inInstrumentedJedis.pipelined()
method.======================================================================================
refactor(dependency): replace javax with jakarta and HandlerInterceptorAdapter with HandlerInterceptor during upgrade of spring boot 3.0.x
Spring Boot 3.0 has migrated from Java EE to Jakarta EE APIs for all dependencies.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes#third-party-library-upgrades
So, replacing the imports with
javax
tojakarta
.Since
org.springframework.web.servlet.handler.HandlerInterceptorAdapter
has been deprecated in springframework 5.3.0. So, replacing it withorg.springframework.web.servlet.HandlerInterceptor
.spring-projects/spring-framework#25147
terasolunaorg/terasoluna-gfw#991
==========================================================================================
refactor(exception): replace NestedIOException with IOException during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-crypto module:
The root cause is the removal of
org.springframework.core.NestedIOException
from springframework 6.0, as mentioned in the below links:spring-projects/spring-framework#28198
spring-projects/spring-framework#28929
So, replacing
org.springframework.core.NestedIOException
withjava.io.IOException
.========================================================================================
refactor(eureka): removed deprecated client and refactor constructor code during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-eureka module:
Spring cloud upgrade from 2021.0.x to 2022.0.x also upgrades the eureka client transitively from 1.10.17 to 2.0.1
Eureka client 2.0.x is not backward compatible with 1.0.x. The constructor has also introduced new parameter. So, update the code accordingly.
https://github.com/Netflix/eureka/releases/tag/v2.0.0
======================================================================================
refactor(telemetry): replace the deprecated method and constructor during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-telemetry module:
Spring boot upgrade brings the caffeine 3.1.8 transitively, that was 2.9.3 with spring boot 2.7.x.
In caffeine 3.x,
StatsCounter.recordEviction
method variation has been deprecated andCacheStats
constructor. So, update the both of them.https://github.com/ben-manes/caffeine/releases/tag/v3.0.0
https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/latest/com.github.benmanes.caffeine/com/github/benmanes/caffeine/cache/stats/StatsCounter.html
https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.9.3/com/github/benmanes/caffeine/cache/stats/StatsCounter.html
=====================================================================================
refactor(dependency): replace rxjava with rxjava3 during upgrade of spring boot 3.0.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-stackdriver module:
Spring boot 3.x deprecated and removed rxjava, and rxjava3 has been added. So, update the dependency.
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#rxjava
=================================================================================
refactor(spring-security): refactor spring security from 5.x to 6.x with spring boot upgrade to 3.x
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors during build process of kork-actuator module:
With spring boot upgrade, spring security also upgrades from 5.x to 6.x. As per the migration steps,
WebSecurityConfigurerAdapter
has been removed. So, it is not required to be extended, instead bean can be registered.In spring boot 3, changes are introduced in sanitization of actuator endpoints.
Default
Sanitizer
implementation has been removed and replaced withSanitizingFunction
.spring-projects/spring-boot#33448
spring-projects/spring-boot#39243
spring-projects/spring-boot#32156
So, added the
ActuatorSanitizingFunction
class to provide the default implementation ofSanitizingFunction
.===================================================================================
refactor(dependency): replace javax.inject with jakarta.inject and upgrade wiremock as part of spring boot 3.x upgrade
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below errors:
The root cause is use of
javax.inject
that has been moved from present coordinate tojakarta.inject
. So, updating the coordinates in kork-eureka, kork-plugins and kork-web modules.google/guice#1463
google/guice#1383
https://docs.openrewrite.org/recipes/java/migrate/jakarta/javaxinjectmigrationtojakartainject
In order to fix this issue, upgrading wiremock dependency to 3.0.4 and updating its coordinates.
Wiremock 3.0.0 onwards 2 major breaking changes are introduced:
https://github.com/wiremock/wiremock/releases?page=3
================================================================================
refactor(test): replace spring.profiles with spring.config.activate.on-profile as part of spring boot 3.x upgrade
While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below error:
In order to fix this issue, replacing spring.profiles with spring.config.activate.on-profile in application-test.yml
===================================================================================
refactor(test): refactor the method getType() to getTableType() as part of spring boot 3.x upgrade
The root cause is the change in method of
org.jooq.Table
class upgrading jooq transitively from 3.14.16 to 3.17.16 while spring boot 2.7.18 to 3.0.13 upgrade.In order to fix this issue refactoring the
getTableType()
method.===================================================================================
refactor(test): upgrade spockframework to fix issue during upgrade of spring security from 5.x to 6.x and ninja-squad upgrade with spring boot upgrade to 3.x
While upgrading spring security from 5.x to 6.x, encountered the below error:
The root cause of this issue is a incompatibility bug in spockframework 2.3-groovy-4.0 version.
In order to fix this issue upgraded the spockframe to 2.4-M1-groovy-4.0
spring-projects/spring-boot#33376
https://spockframework.org/spock/docs/2.4-M1/release_notes.html#_2_4_m1_2022_11_30
Also encountered below error during test execution of kork-plugins-tck module:
In order to fix this issue, upgraded the ninja-squad dependency from 2.0.3 to 4.0.2 for the compatibility with Spring boot 3.x and Java 17+.
https://github.com/Ninja-Squad/springmockk?tab=readme-ov-file#versions-compatibility
======================================================================================