Skip to content

fix(ci): bump schema-version to v3.1.0 and resolve formatter sources lazily INTER-2002#19

Merged
JuroUhlar merged 1 commit into
mainfrom
fix/sync-schema-version-and-format-eval
Apr 23, 2026
Merged

fix(ci): bump schema-version to v3.1.0 and resolve formatter sources lazily INTER-2002#19
JuroUhlar merged 1 commit into
mainfrom
fix/sync-schema-version-and-format-eval

Conversation

@JuroUhlar

Copy link
Copy Markdown
Contributor

Summary

The Server SDK sync job failed trying to re-apply ancient v3-API schema releases against the current v4 codebase. Two layered issues:

  1. .schema-version was stale. The v4 migration (commit beaaea4, "feat: update APIv4 to Schema v3.1.0") didn't bump .schema-version, which was still v2.12.0. The sync action iterates every OpenAPI release between .schema-version and the target tag, so it tried to re-apply v2.12.1 (old v3 API) first — against generator config that targets com.fingerprint.v4.{api,model}. Bumping to v3.1.0 (what the committed code reflects) so the next sync starts from the correct point. The sync action writes the new tag to .schema-version on success, so future runs are self-healing.

  2. Latent bug in the Gradle format task. inputFiles was resolved at Gradle configuration time via fileTree("src").files.map { it.absolutePath }. But openApiGenerate runs removeClasses (which deletes sdk/src/main/java/com/fingerprint/v4/{api,model}) and then copyGeneratedArtifacts before format runs via finalizedBy. When the regenerated file set differs from the pre-generation set (exactly what happens when an older schema is applied), google-java-format fails with could not read file: …TamperingConfidence.java etc. for the stale entries. Moving srcJavaFiles() evaluation into doLast makes format/checkFormat robust to file churn.

Issue 1 alone would fix the immediate CI failure; issue 2 is defense-in-depth so a future generator change can't produce the same class of breakage.

Failure

https://github.com/fingerprintjs/fingerprint-pro-server-api-openapi/actions/runs/24790520856 — Java job.

Test plan

  • ./gradlew :sdk:openApiGenerate (full chain: removeClasses → generate → copy → format) runs clean locally
  • ./gradlew :sdk:checkFormat runs clean
  • Simulated CI failure mode (delete TamperingConfidence.java, run format/checkFormat) → both succeed after the lazy-eval fix
  • Re-run the Sync Server-Side SDKs schema workflow after merge to confirm the Java job succeeds

…lazily

The Server SDK sync job was stuck re-applying old v3-API schema releases
(v2.12.1, v3.0.0, v3.0.1) against the current v4 codebase because
`.schema-version` was never bumped when the SDK was migrated to API v4
(commit beaaea4). Bumping to v3.1.0 (what the committed code reflects)
so the next sync starts from the correct point.

The downstream symptom exposed a latent bug in the Gradle format task:
`inputFiles` was resolved at configuration time, but `removeClasses`
deletes and regenerates sources at execution time. When the regenerated
file set differs from the pre-generation set (as it does when an older
schema is applied), google-java-format fails with "could not read file"
for files in the stale list. Resolve `srcJavaFiles()` lazily inside
`doLast` for both format and checkFormat so the list reflects disk
state when formatting runs.

Failure: https://github.com/fingerprintjs/fingerprint-pro-server-api-openapi/actions/runs/24790520856
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

@JuroUhlar
JuroUhlar merged commit 0720530 into main Apr 23, 2026
16 checks passed
@JuroUhlar
JuroUhlar deleted the fix/sync-schema-version-and-format-eval branch April 23, 2026 10:06
@JuroUhlar JuroUhlar changed the title fix(ci): bump schema-version to v3.1.0 and resolve formatter sources lazily fix(ci): bump schema-version to v3.1.0 and resolve formatter sources lazily INTER-2002 May 4, 2026
Sign up for free to 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.

2 participants