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

Fix FidoMetadataDownloader failure on unknown properties #376

Merged
merged 13 commits into from
Sep 3, 2024

Conversation

emlun
Copy link
Member

@emlun emlun commented Sep 3, 2024

Fixes #375.

The first three commits are cherry-picks from main to fix the Gradle build being broken.

(git cherry-pick a62d4c8)

Fixes this build failure that suddenly occurred with no code changes:

```
$ ./gradlew :webauthn-server-core:compileTestScala
Execution failed for task ':webauthn-server-core:compileTestScala'.
>
bad constant pool index: 0 at pos: 89856
while compiling: ./webauthn-server-core/src/test/scala/com/yubico/scalacheck/gen/JacksonGenerators.scala
during phase: globalPhase=typer, enteringPhase=namer
library version: version 2.13.8
compiler version: version 2.13.8
reconstructed args: [9876 characters redacted for brevity]

last tree to typer: Ident(com)
tree position: line 35 of ./webauthn-server-core/src/test/scala/com/yubico/scalacheck/gen/JacksonGenerators.scala
tree tpe: com.type
symbol: final package com
symbol definition: final package com (a ModuleSymbol)
symbol package: <none>
symbol owners: package com
call site: package gen in package scalacheck in package scalacheck

== Source file context for tree position ==

32 import com.fasterxml.jackson.databind.node.NumericNode
33 import com.fasterxml.jackson.databind.node.ObjectNode
34 import com.fasterxml.jackson.databind.node.TextNode
35 import com.upokecenter.cbor.CBORObject
36 import com.yubico.internal.util.JacksonCodecs
37 import org.scalacheck.Arbitrary
38 import org.scalacheck.Arbitrary.arbitrary
```
(git cherry-pick 3a67ec4)

The `ignoreSourceSets` config is needed to fix errors like this:

```
Execution failed for task ':yubico-util:configSemanticDBMain'.
> Failed to calculate the value of task ':yubico-util:configSemanticDBMain' property 'scalaVersion'.
> Unable to detect the Scala version for the 'main' source set. Please ensure it declares dependency to scala-library or consider adding it to 'ignoreSourceSets'
```

The change to `project-convention-code-formatting-internal.gradle` is needed to fix this error:

```
Execution failed for task ':yubico-util-scala:compileScala'.
> Could not resolve all files for configuration ':yubico-util-scala:detachedConfiguration1'.
   > Could not find org.scalameta:semanticdb-scalac_2.13.13:4.5.5.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/org/scalameta/semanticdb-scalac_2.13.13/4.5.5/semanticdb-scalac_2.13.13-4.5.5.pom
     If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the re
pository declaration.
     Required by:
         project :yubico-util-scala
```
@emlun emlun added the bug Something isn't working label Sep 3, 2024
@emlun emlun requested a review from fdennis September 3, 2024 13:05
@emlun emlun self-assigned this Sep 3, 2024
@emlun emlun changed the base branch from main to release-2.5 September 3, 2024 13:12
@emlun emlun force-pushed the fido-mds-unknown-fields branch from 54efa19 to f384e8e Compare September 3, 2024 13:19
@emlun
Copy link
Member Author

emlun commented Sep 3, 2024

Confirming that the integration test workflow fails correctly: https://github.com/Yubico/java-webauthn-server/actions/runs/10683857466

Copy link

github-actions bot commented Sep 3, 2024

Test Results

1 309 tests   1 305 ✅  53s ⏱️
   43 suites      4 💤
   43 files        0 ❌

Results for commit 63bc71b.

♻️ This comment has been updated with latest results.

@emlun emlun marked this pull request as ready for review September 3, 2024 13:49
@emlun emlun requested a review from dainnilsson September 3, 2024 13:49
Copy link

@georgespalding georgespalding left a comment

Choose a reason for hiding this comment

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

I reviewed the code changes mainly.
Ignoring unknown properties is the way to go to be forward compatible 🚀

@emlun emlun merged commit 67634f8 into release-2.5 Sep 3, 2024
20 checks passed
@emlun emlun deleted the fido-mds-unknown-fields branch September 3, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

FidoMetadataDownloader::parseBlob fails with 'Unrecognized field "friendlyNames"'
4 participants