Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade GSON and other optional dependencies #1077

Merged
merged 3 commits into from
Nov 7, 2022

Conversation

seratch
Copy link
Member

@seratch seratch commented Oct 27, 2022

This pull request upgrades dependencies before the upcoming minor version release. The only critical one is GSON's minor upgrade but I believe that it's safe enough.

Category (place an x in each of the [ ])

  • bolt (Bolt for Java)
  • bolt-{sub modules} (Bolt for Java - optional modules)
  • slack-api-client (Slack API Clients)
  • slack-api-model (Slack API Data Models)
  • slack-api-*-kotlin-extension (Kotlin Extensions for Slack API Clients)
  • slack-app-backend (The primitive layer of Bolt for Java)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you agree to those rules.

@seratch seratch added project:bolt project:slack-api-client project:slack-api-client project:slack-api-model project:slack-api-model dependencies Pull requests that update a dependency file project:slack-app-backend labels Oct 27, 2022
@seratch seratch added this to the 1.27.0 milestone Oct 27, 2022
@seratch seratch self-assigned this Oct 27, 2022
@@ -68,6 +68,7 @@
<aws.s3.version>[1.12.62,1.13.0)</aws.s3.version>
<junit.version>4.13.2</junit.version>
<logback.version>1.2.11</logback.version>
<logback-slf4j-v2.version>1.4.4</logback-slf4j-v2.version>
Copy link
Member Author

Choose a reason for hiding this comment

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

This slf4j-api v2 compatible version is supposed to be used only for test code and example projects. See also: #1034

@seratch
Copy link
Member Author

seratch commented Oct 27, 2022

Ah, UnknownPropertyDetectionAdapterFactory's internal field access fails with the new version. I will look into this tomorrow in my timezone.

@seratch
Copy link
Member Author

seratch commented Oct 27, 2022

java.lang.IllegalStateException: java.lang.NoSuchFieldException: boundFields
	at com.slack.api.util.json.UnknownPropertyDetectionAdapterFactory.create(UnknownPropertyDetectionAdapterFactory.java:60)
	at com.google.gson.Gson.getAdapter(Gson.java:546)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:295)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130)
	at com.google.gson.Gson.getDelegateAdapter(Gson.java:635)
	at com.slack.api.util.json.UnknownPropertyDetectionAdapterFactory.create(UnknownPropertyDetectionAdapterFactory.java:24)
	at com.google.gson.Gson.getAdapter(Gson.java:546)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory.create(CollectionTypeAdapterFactory.java:53)
	at com.google.gson.Gson.getDelegateAdapter(Gson.java:635)
	at com.slack.api.util.json.UnknownPropertyDetectionAdapterFactory.create(UnknownPropertyDetectionAdapterFactory.java:24)
	at com.google.gson.Gson.getAdapter(Gson.java:546)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:160)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:295)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:130)
	at com.google.gson.Gson.getDelegateAdapter(Gson.java:635)
	at com.slack.api.util.json.UnknownPropertyDetectionAdapterFactory.create(UnknownPropertyDetectionAdapterFactory.java:24)
	at com.google.gson.Gson.getAdapter(Gson.java:546)
	at com.google.gson.Gson.toJson(Gson.java:817)
	at com.google.gson.Gson.toJsonTree(Gson.java:695)
	at com.google.gson.Gson.toJsonTree(Gson.java:672)
	at test_locally.util.JSONUtilityTest$GsonContextImpl.serialize(JSONUtilityTest.java:33)
	at com.slack.api.util.json.GsonBlockElementFactory.serialize(GsonBlockElementFactory.java:40)
	at test_locally.util.JSONUtilityTest.testGsonBlockElementFactory(JSONUtilityTest.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.NoSuchFieldException: boundFields
	at java.lang.Class.getDeclaredField(Class.java:2070)
	at com.slack.api.util.json.UnknownPropertyDetectionAdapterFactory.create(UnknownPropertyDetectionAdapterFactory.java:31)
	... 55 more

@seratch seratch marked this pull request as draft November 4, 2022 04:00
@seratch seratch marked this pull request as ready for review November 7, 2022 04:56
@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Merging #1077 (1168b93) into main (e49e92f) will increase coverage by 0.00%.
The diff coverage is 69.23%.

@@            Coverage Diff            @@
##               main    #1077   +/-   ##
=========================================
  Coverage     75.99%   76.00%           
- Complexity     3775     3776    +1     
=========================================
  Files           413      413           
  Lines         11741    11750    +9     
  Branches       1150     1152    +2     
=========================================
+ Hits           8922     8930    +8     
  Misses         2126     2126           
- Partials        693      694    +1     
Impacted Files Coverage Δ
...l/json/UnknownPropertyDetectionAdapterFactory.java 73.33% <69.23%> (-7.62%) ⬇️
...va/com/slack/api/socket_mode/SocketModeClient.java 68.15% <0.00%> (-0.64%) ⬇️
...imits/metrics/impl/BaseMemoryMetricsDatastore.java 80.08% <0.00%> (+0.43%) ⬆️
.../com/slack/api/bolt/socket_mode/SocketModeApp.java 75.94% <0.00%> (+3.79%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@seratch seratch merged commit d57682b into slackapi:main Nov 7, 2022
@seratch seratch deleted the bump-deps-2022-10 branch November 7, 2022 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file project:bolt project:slack-api-client project:slack-api-client project:slack-api-model project:slack-api-model project:slack-app-backend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant