Skip to content

chore(xtest): Refactor to eliminate duplicate Java SDK version mappings #381

@pflynn-virtru

Description

@pflynn-virtru

Summary

The Java SDK version-to-platform-branch mappings are now duplicated in two places:

  • xtest/sdk/scripts/resolve-version.py (Python, lines ~122-145)
  • xtest/sdk/scripts/post-checkout-java.sh (Bash, get_platform_branch() function)

This creates a maintenance burden - when a new Java SDK version is released, both files must be updated.

Suggested Approaches

Option A: Shared config file

Extract mappings to a JSON/YAML file that both scripts read:

// xtest/sdk/scripts/java-platform-versions.json
{
  "0.7.8": "protocol/go/v0.2.29",
  "0.7.7": "protocol/go/v0.2.29",
  "0.7.6": "protocol/go/v0.2.25",
  "0.7.5": "protocol/go/v0.2.18",
  ...
}

Option B: Call resolve-version.py from bash

Have post-checkout-java.sh call resolve-version.py to get the mapping:

PLATFORM_BRANCH=$(python3 "$SCRIPT_DIR/resolve-version.py" --platform-branch-for-java "$VERSION")

Option C: Pass platform.branch during checkout

Have the workflow/checkout script pass the correct platform.branch as a parameter, eliminating the need for post-checkout detection.

Recommendation

Option A (shared config) is cleanest - single source of truth, easy to read from both Python and Bash.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions