Skip to content

SK-3061: revert getFields() to Map<String, Object>, keep getTokens() typed - #409

Merged
Devesh-Skyflow merged 1 commit into
flowvault-release/26.8.13from
devesh/sk-3061-getfields-revert
Aug 13, 2026
Merged

SK-3061: revert getFields() to Map<String, Object>, keep getTokens() typed#409
Devesh-Skyflow merged 1 commit into
flowvault-release/26.8.13from
devesh/sk-3061-getfields-revert

Conversation

@Devesh-Skyflow

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #408 (already merged). That PR made InsertResponseRecord.getTokens() typed (Map<String, List<Token>>), and had getFields() (the deprecated fieldstokens alias) delegate straight to it — which meant getFields()'s return type became typed too, Map<String, List<Token>> instead of its original Map<String, Object>.

This reverts just that: getFields() is back to public Map<String, Object> getFields(), its pre-#408 contract. getTokens() is untouched and stays typed.

Why

getFields() is @Deprecated(forRemoval = true) — nobody should be writing new code against it, and changing its return type generics is an avoidable japicmp-breaking change for a method that exists purely so old callers keep compiling. #408 accepted that break (and regenerated the baseline) rather than doing the extra work to avoid it; this PR does that extra work instead, since it's a small, contained fix.

Change

  • Added Token.toRawTokens(Map<String, List<Token>>): Map<String, Object> — package-private, the inverse of Token.parseTokens(Map<String, Object>). Package-private keeps it outside the accessModifier=protectedjapicmp contract in flowvault/pom.xml, so it isn't itself a compatibility commitment.
  • InsertResponseRecord.getFields() now does return Token.toRawTokens(getTokens()); instead of delegating directly.
  • The round trip is lossless for map-shaped wire input (the normal case — a list of {token, tokenGroupName} entries per column) but lossy for the bare-value edge case parseTokens() also has to handle: a raw "tok-abc" string round-trips to {"token": "tok-abc", "tokenGroupName": null} — still valid, just not byte-identical to the original wire shape. Only affects getFields(), the deprecated path.
  • Updated every test asserting on getFields()'s shape (ResponseComponentTests, BulkResponseTests, UtilsTests, VaultControllerTests), and added direct toRawTokens() coverage (null input, single/multiple token groups, round-trip-with-map-input) in ResponseComponentTests.
  • Updated flowvault/README.md's description of getFields() to match.
  • Regenerated flowvault/api-report/skyflow-flowvault-java.baseline.jar via scripts/contract-snapshot-update.sh flowvaultgetFields()'s return type change (typed → back to Map<String, Object>) is itself a japicmp-flagged change relative to SK-3061: revert fields→tokens rename, restore data field on bulkInsert response #408's baseline, so the baseline needs updating again here. No samples call getFields(), so none needed changes.

Testing

  • mvn -pl common,flowvault -am test -Dtest='!TokenTests#testExpiredTokenForIsExpiredToken' -DfailIfNoTests=false696 tests, 0 failures (the excluded test is a pre-existing, unrelated failure — reads a CI-only secret from a .env file not committed to the repo).
  • mvn -pl common,flowvault -am verify -Dgpg.skip=true (same exclusion) → BUILD SUCCESS, japicmp passes clean against the regenerated baseline in this PR.

🤖 Generated with Claude Code

…typed
getTokens() itself (item 6, commit 8148504) stays Map<String, List<Token>>.
But getFields() delegating straight to it changed its return-type generics
from Object to List<Token> - a needless japicmp break for a deprecated
alias nobody should be adding new calls to anyway, and one this PR had
flagged as avoidable but initially left in favor of just regenerating the
baseline.
Reverted getFields() to its original Map<String, Object> contract by
rendering getTokens()'s typed data back into that raw shape via a new
package-private Token.toRawTokens(Map<String, List<Token>>) - the inverse
of Token.parseTokens(). Package-private keeps it outside the
accessModifier=protected japicmp contract, so it doesn't itself become a
compatibility commitment.
The round trip is lossless for map-shaped wire input (the normal case) but
lossy for the bare-value edge case parseTokens() also handles (a raw
"tok-abc" string loses its way back to {"token": "tok-abc", "tokenGroupName":
null} - still valid data, just not byte-identical to the original wire
shape). Updated every test asserting on getFields() accordingly, and added
direct toRawTokens() coverage (null input, single/multiple token groups,
round-trip-with-map-input) in ResponseComponentTests.
Regenerated flowvault/api-report/skyflow-flowvault-java.baseline.jar via
scripts/contract-snapshot-update.sh flowvault - this supersedes the
baseline regenerated in f326ec2, since that one still had getFields()
returning the typed map. mvn -pl common,flowvault -am verify passes clean
against it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Contract baseline change detected (flowvault)

This PR updates flowvault/api-report/skyflow-flowvault-java.baseline.jar (the approved public API contract). Here is exactly what it changes, comparing the baseline on flowvault-release/26.8.13 against the baseline committed in this PR:

Compatibility Report

semver PATCH

Summary

Important

Compatible bug fixes found while checking backward compatibility of version skyflow-flowvault-java.baseline with the previous version old-baseline.

Expand to see options used.
  • Report only summary: No
  • Report only changes: Yes
  • Report only binary-incompatible changes: No
  • Access modifier filter: PROTECTED
  • Old archives:
    • old-baseline unknown
  • New archives:
    • skyflow-flowvault-java.baseline unknown
  • Evaluate annotations: Yes
  • Include synthetic classes and class members: No
  • Include specific elements: Yes
    • com.skyflow.Skyflow
    • com.skyflow.config
    • com.skyflow.enums
    • com.skyflow.errors
    • com.skyflow.serviceaccount.util
    • com.skyflow.vault.audit
    • com.skyflow.vault.bin
    • com.skyflow.vault.connection
    • com.skyflow.vault.controller
    • com.skyflow.vault.data
    • com.skyflow.vault.detect
    • com.skyflow.vault.tokens
  • Exclude specific elements: No
  • Ignore all missing classes: Yes
  • Ignore specific missing classes: No
  • Treat changes as errors:
    • Any changes: No
    • Binary incompatible changes: No
    • Source incompatible changes: No
    • Incompatible changes caused by excluded classes: Yes
    • Semantically incompatible changes: No
    • Semantically incompatible changes, including development versions: No
  • Classpath mode: TWO_SEPARATE_CLASSPATHS
  • Old classpath:
/home/runner/.m2/repository/com/skyflow/common/1.0.0/common-1.0.0.jar:/home/runner/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.17.2/jackson-databind-2.17.2.jar:/home/runner/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.17.2/jackson-annotations-2.17.2.jar:/home/runner/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.17.2/jackson-core-2.17.2.jar:/home/runner/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.18.6/jackson-datatype-jdk8-2.18.6.jar:/home/runner/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.18.6/jackson-datatype-jsr310-2.18.6.jar:/home/runner/.m2/repository/io/github/cdimascio/dotenv-java/2.2.0/dotenv-java-2.2.0.jar:/home/runner/.m2/repository/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar:/home/runner/.m2/repository/com/squareup/okhttp3/okhttp/4.12.0/okhttp-4.12.0.jar:/home/runner/.m2/repository/com/squareup/okio/okio/3.6.0/okio-3.6.0.jar:/home/runner/.m2/repository/com/squareup/okio/okio-jvm/3.6.0/okio-jvm-3.6.0.jar:/home/runner/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.10/kotlin-stdlib-common-1.9.10.jar:/home/runner/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.8.21/kotlin-stdlib-jdk8-1.8.21.jar:/home/runner/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.8.21/kotlin-stdlib-1.8.21.jar:/home/runner/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/home/runner/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.21/kotlin-stdlib-jdk7-1.8.21.jar:/home/runner/.m2/repository/io/jsonwebtoken/jjwt/0.12.6/jjwt-0.12.6.jar:/home/runner/.m2/repository/io/jsonwebtoken/jjwt-api/0.12.6/jjwt-api-0.12.6.jar:/home/runner/.m2/repository/io/jsonwebtoken/jjwt-impl/0.12.6/jjwt-impl-0.12.6.jar:/home/runner/.m2/repository/io/jsonwebtoken/jjwt-jackson/0.12.6/jjwt-jackson-0.12.6.jar:/home/runner/.m2/repository/junit/junit/4.13.2/junit-4.13.2.jar:/home/runner/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/home/runner/.m2/repository/org/powermock/powermock-module-junit4/2.0.9/powermock-module-junit4-2.0.9.jar:/home/runner/.m2/repository/org/powermock/powermock-module-junit4-common/2.0.9/powermock-module-junit4-common-2.0.9.jar:/home/runner/.m2/repository/org/powermock/powermock-reflect/2.0.9/powermock-reflect-2.0.9.jar:/home/runner/.m2/repository/net/bytebuddy/byte-buddy/1.10.14/byte-buddy-1.10.14.jar:/home/runner/.m2/repository/net/bytebuddy/byte-buddy-agent/1.10.14/byte-buddy-agent-1.10.14.jar:/home/runner/.m2/repository/org/powermock/powermock-core/2.0.9/powermock-core-2.0.9.jar:/home/runner/.m2/repository/org/javassist/javassist/3.27.0-GA/javassist-3.27.0-GA.jar:/home/runner/.m2/repository/org/powermock/powermock-api-mockito2/2.0.9/powermock-api-mockito2-2.0.9.jar:/home/runner/.m2/repository/org/powermock/powermock-api-support/2.0.9/powermock-api-support-2.0.9.jar:/home/runner/.m2/repository/org/mockito/mockito-core/3.3.3/mockito-core-3.3.3.jar:/home/runner/.m2/repository/org/objenesis/objenesis/2.6/objenesis-2.6.jar
  • New classpath:
/home/runner/.m2/repository/com/skyflow/common/1.0.0/common-1.0.0.jar:/home/runner/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.17.2/jackson-databind-2.17.2.jar:/home/runner/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.17.2/jackson-annotations-2.17.2.jar:/home/runner/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.17.2/jackson-core-2.17.2.jar:/home/runner/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.18.6/jackson-datatype-jdk8-2.18.6.jar:/home/runner/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.18.6/jackson-datatype-jsr310-2.18.6.jar:/home/runner/.m2/repository/io/github/cdimascio/dotenv-java/2.2.0/dotenv-java-2.2.0.jar:/home/runner/.m2/repository/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar:/home/runner/.m2/repository/com/squareup/okhttp3/okhttp/4.12.0/okhttp-4.12.0.jar:/home/runner/.m2/repository/com/squareup/okio/okio/3.6.0/okio-3.6.0.jar:/home/runner/.m2/repository/com/squareup/okio/okio-jvm/3.6.0/okio-jvm-3.6.0.jar:/home/runner/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.10/kotlin-stdlib-common-1.9.10.jar:/home/runner/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.8.21/kotlin-stdlib-jdk8-1.8.21.jar:/home/runner/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.8.21/kotlin-stdlib-1.8.21.jar:/home/runner/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/home/runner/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.21/kotlin-stdlib-jdk7-1.8.21.jar:/home/runner/.m2/repository/io/jsonwebtoken/jjwt/0.12.6/jjwt-0.12.6.jar:/home/runner/.m2/repository/io/jsonwebtoken/jjwt-api/0.12.6/jjwt-api-0.12.6.jar:/home/runner/.m2/repository/io/jsonwebtoken/jjwt-impl/0.12.6/jjwt-impl-0.12.6.jar:/home/runner/.m2/repository/io/jsonwebtoken/jjwt-jackson/0.12.6/jjwt-jackson-0.12.6.jar:/home/runner/.m2/repository/junit/junit/4.13.2/junit-4.13.2.jar:/home/runner/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/home/runner/.m2/repository/org/powermock/powermock-module-junit4/2.0.9/powermock-module-junit4-2.0.9.jar:/home/runner/.m2/repository/org/powermock/powermock-module-junit4-common/2.0.9/powermock-module-junit4-common-2.0.9.jar:/home/runner/.m2/repository/org/powermock/powermock-reflect/2.0.9/powermock-reflect-2.0.9.jar:/home/runner/.m2/repository/net/bytebuddy/byte-buddy/1.10.14/byte-buddy-1.10.14.jar:/home/runner/.m2/repository/net/bytebuddy/byte-buddy-agent/1.10.14/byte-buddy-agent-1.10.14.jar:/home/runner/.m2/repository/org/powermock/powermock-core/2.0.9/powermock-core-2.0.9.jar:/home/runner/.m2/repository/org/javassist/javassist/3.27.0-GA/javassist-3.27.0-GA.jar:/home/runner/.m2/repository/org/powermock/powermock-api-mockito2/2.0.9/powermock-api-mockito2-2.0.9.jar:/home/runner/.m2/repository/org/powermock/powermock-api-support/2.0.9/powermock-api-support-2.0.9.jar:/home/runner/.m2/repository/org/mockito/mockito-core/3.3.3/mockito-core-3.3.3.jar:/home/runner/.m2/repository/org/objenesis/objenesis/2.6/objenesis-2.6.jar

Results

StatusTypeSerializationCompatibility Changes
Source-incompatiblecom.skyflow.vault.data.InsertResponseRecordNot serializableMethod return type generics changed
Modifiedcom.skyflow.vault.data.TokenNot serializableNo changes
Expand for details.

com.skyflow.vault.data.InsertResponseRecord

  • Binary-compatible
  • Source-compatible
  • Serialization-compatible
StatusModifiersTypeNameExtendsJDKSerializationCompatibility Changes
Source-incompatiblepublicClassInsertResponseRecordObjectJDK 8Not serializableNo changes

Methods

StatusModifiersGenericsTypeMethodAnnotationsThrowsCompatibility Changes
Source-incompatiblepublicMap<String, List<Token>>Map<String, Object>getFields()Method return type generics changed

com.skyflow.vault.data.Token

  • Binary-compatible
  • Source-compatible
  • Serialization-compatible
StatusModifiersTypeNameExtendsJDKSerializationCompatibility Changes
ModifiedpublicClassTokenObjectJDK 8Not serializableNo changes

Warning

All missing classes, i.e. superclasses and interfaces that could not be found on the classpath were ignored.

Hence changes caused by these superclasses and interfaces are not reflected in the output.


Generated on: 2026-08-13 15:53:26.244+0000.

@codecov

codecovBot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (flowvault-release/26.8.13@44d7340). Learn more about missing BASE report.

Additional details and impacted files
@@ Coverage Diff @@## flowvault-release/26.8.13 #409 +/- ##
============================================================
Coverage ? 91.37% Complexity ? 28 ============================================================
Files ? 158 Lines ? 6448 Branches ? 861 ============================================================
Hits ? 5892 Misses ? 362 Partials ? 194 
FlagCoverage Δ
unittests-flowvault89.93% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

ComponentsCoverage Δ
Module: common88.39% <0.00%> (?)
Module: skyvault94.72% <0.00%> (?)
Module: flowvault88.92% <0.00%> (?)
Service Account86.69% <0.00%> (?)
Vault Data91.81% <0.00%> (?)
Vault Tokens99.03% <0.00%> (?)
Vault Connection100.00% <0.00%> (?)
Vault Controller85.31% <0.00%> (?)
Detect100.00% <0.00%> (?)
Audit100.00% <0.00%> (?)
BIN Lookup100.00% <0.00%> (?)
Config96.26% <0.00%> (?)
Utils89.18% <0.00%> (?)
Errors100.00% <0.00%> (?)
Enums100.00% <0.00%> (?)
Logs95.34% <0.00%> (?)
Files with missing linesCoverage Δ
...a/com/skyflow/vault/data/InsertResponseRecord.java100.00% <100.00%> (ø)
...lt/src/main/java/com/skyflow/vault/data/Token.java96.22% <100.00%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 44d7340...3998545. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Devesh-Skyflow
Devesh-Skyflow merged commit 7f1a295 into flowvault-release/26.8.13Aug 13, 2026
28 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Devesh-Skyflow