initial Market Data Java SDK scaffold + CI#1
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
The author of this PR, MarketDataDev03, is not an activated member of this organization on Codecov. |
| if (isPresent(fromSystem)) { | ||
| return fromSystem; | ||
| } | ||
| String fromDotEnv = readDotEnv().get(envKey); |
There was a problem hiding this comment.
this could be called once on the constructor to avoid re reading env vile on every resolve call
There was a problem hiding this comment.
Good catch. I agree that repeated reading isn't ideal, but the actual cost is negligible: the file is small, the read only happens when building the client, and it takes microseconds per call.
However, after reviewing the code, it became clear that the static Configuration shape was the real problem. It blocks the ability to fully test. I'm going to rewrite it to fix the aforementioned problem and improve testability.
| # Gradle | ||
| .gradle/ | ||
| build/ | ||
| !gradle/wrapper/gradle-wrapper.jar |
There was a problem hiding this comment.
on README says this file is not commited and this is a rule with "!" to not exclude it, so the file was commited.
There was a problem hiding this comment.
You're right. The idea is to force it to always be committed (the standard convention in Gradle projects). The README is the one lying: it has an old paragraph from when the wrapper jar hadn't been generated yet, and I never updated it after committing. I'll fix it now.
feat: initial Market Data Java SDK scaffold + CI
Initial scaffold for the Java SDK. No endpoints are implemented in this PR — it lays the foundation that endpoints will land on. Subsequent PRs will add endpoints one by one, each shipping with its corresponding integration tests against the live API (gated by
MARKETDATA_RUN_INTEGRATION_TESTS=true).What's included
--release 17), Spotless (Google Java Format), JaCoCo, Vanniktech Maven Publish, separate source set for integration tests.MarketDataClientwith builder, shared HTTP/2HttpClient, 50-permit concurrency semaphore, rate-limit accessor.RateLimitsrecord. JSpecify@NullMarkedacross the entire public surface.MarketDataExceptionhierarchy with the 7 canonical subtypes (AuthenticationError,BadRequestError,NotFoundError,RateLimitError,ServerError,NetworkError,ParseError), each carrying support context (requestId,requestUrl,statusCode,timestamp) and agetSupportInfo()helper.explicit → MARKETDATA_* env var → .env → default. Defaults:https://api.marketdata.app,v1. Tokens are never logged verbatim (Tokens.redact).pull-request.yml: every PR open / sync runs./gradlew buildon JDK 17 and uploads the JaCoCo report to Codecov.pr-matrix-on-demand.yml: opt-in forward-compat run on JDK 21 and 25, triggered by a PR comment (see flow below).main.yml: every push tomainruns the full matrix{17, 21, 25}; the JDK 17 entry uploads coverage to Codecov, becoming the baseline that subsequent PRs are diffed against.codecov.ymlenforces the rules: PR coverage may not drop more than 5 pp vs base branch (project status), and code added by the PR must hit at least 70 % coverage (patch status).README.md,CLAUDE.md,CHANGELOG.md,LICENSE(MIT).How the CI flow works
The forward-compat matrix (JDK 21 + 25) is opt-in on PRs to keep regular iteration cheap, and mandatory at merge time:
pull-request.yml/run-all-jdks,/jdk-matrix, or/test-allon an open PRpr-matrix-on-demand.ymlmain(merge)main.ymlThe on-demand workflow listens to the
issue_commentevent (PRs are issues from GitHub's API perspective) and:write,maintain, oradminpermission. Without this, anyone in the world commenting on a fork PR could burn our CI minutes or attempt to leak secrets via a malicious build../gradlew test -PtestJdk=21and=25in parallel (fail-fast: false).A note on the "comment trigger doesn't fire from this branch" gotcha: GitHub always loads
issue_commentworkflows from the default branch's copy of the file. Until this PR is merged intomain, the slash commands have no effect. That's by design — it prevents a malicious PR from shipping its own self-modifying CI.Tests & coverage
16 tests, all passing. Coverage: 83.1 % lines, 98 % methods, 100 % on the
exceptionpackage.Architectural decisions
Follows ADRs 001–006 (already on
main) and the foundational rules in the cross-language SDK Requirements doc (§1, §4–§7, §10, §12, §15–§16). Request-flow specifics (retry, rate-limit header parsing, wire-format decoding, endpoints, integration tests) are intentionally deferred and listed explicitly inCLAUDE.md. They will land in the follow-up PRs alongside each endpoint.