Skip to content

Commit b3cf737

Browse files
skyflow-bhartisaileshwar-skyflowDevesh-Skyflowclaude
authored
SK-3002 release/26.8.1 (#386)
* SK-2967 split out the common things from v2 and v3 into common module * SK-2967 add interface for skyflow * SK-2967 move common code from v2 and flowvault * SK-2967 fix tests * SK-2967 add base insert request and refactor the base skyflow * SK-2967 move vault url in v3 * SK-2967 update generated code * SK-2967 update the internal release * SK-2967 update script version * [AUTOMATED] Private Release 1.15.1-dev-f6a6992 * SK-2967 update internal release workflow * [AUTOMATED] Private Release 1.15.1-dev-807824c * SK-2967 add interfaces * SK-2967 fix internal release workflows * [AUTOMATED] Private Release 1.15.1-dev-cd30d53 * SK-2967 fix internal release workflows * [AUTOMATED] Private Release 1.15.1-dev-139086e * SK-2967 fix internal release workflows * SK-2967 fix internal release workflows * SK-2967 fix internal release workflows * SK-2967 add back the bulk interfaces * SK-2967 implement client * SK-2967 fix compile errors * SK-2967 fix compile errors * SK-2967 revert generated code * SK-2967 improve the issues * SK-2984 Add contract testing for v2 SDK (#352) * SK-2967 added query and get methods * SK-3026 insert and detokenize added accordingt to doc * SK-3026 fix test env * SK-3026 fix response building * SK-3026 fix spell check * SK-3026 fix spell check * SK-3026 point codecov at per-module jacoco reports The Codecov step uploaded target/site/jacoco/jacoco.xml, which was correct when this repo was a single Maven module. Since the common/v2/flowvault split the root pom is <packaging>pom</packaging> with no sources, so that file is never generated - codecov received nothing and reported no coverage for the PR. Verified locally: 'mvn -B package -f pom.xml' produces reports only at common/, v2/ and flowvault/ target/site/jacoco/jacoco.xml; the root path does not exist. Same class of issue as the 'Distribute test fixtures to modules' step already added on this branch - a repo-root path left over from the single-module layout. * SK-3026 fix codecov component paths for the modular layout Every individual_component path was rooted at src/main/java/..., which was correct when this was a single Maven module. Sources now live at <module>/src/main/java/..., so all 11 component globs matched zero files and each component reported no coverage data - which is the 'no coverage reports found' seen on the PR. The uploaded report itself was fine: the Codecov API shows state 'complete' for c1c5719 with 115 files at 91.75% (v2 55, common 30, flowvault 30), correctly path-resolved. Only the component matching was broken. Prefixed each glob with **/ so components aggregate a functional area across all modules, matching the previous semantics. Quoted because a bare leading * is a YAML alias. Verified against the real file list from the Codecov API: 0 components match zero files (was 11/11). * SK-3026 added retries * SK-3026 update the name of vaultURL * [AUTOMATED] Private Release 3.0.0-beta.13-dev-671dbf3 * SK-3026 fix the doc error in release * [AUTOMATED] Private Release 3.0.0-beta.13-dev-0d4db0a * SK-3026 added samples folder in each modules v2 and v3 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-202473d3 * SK-3026 added samples folder in each modules v2 and v3 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-a341d09f * SK-3037: rework delete and tokenize to the FlowDB contract (#385) * [AUTOMATED] Private Release 3.0.0-beta.13-dev-1dea6f89 * SK-3026 fix insert issue * [AUTOMATED] Private Release 3.0.0-beta.13-dev-9a074a90 * SK-3026 Fix api exception level issue * [AUTOMATED] Private Release 3.0.0-beta.13-dev-61de168d * SK-3026 Fix api exception level issue for detokenize * [AUTOMATED] Private Release 3.0.0-beta.13-dev-f70f738d * SK-3026 fix naming for skyflow id in detokenize * [AUTOMATED] Private Release 3.0.0-beta.13-dev-28dcc895 * SK-3026 add request id in insert and detokenize * [AUTOMATED] Private Release 3.0.0-beta.13-dev-1458dbdb * SK-3026 update options name in insert and detokenize * [AUTOMATED] Private Release 3.0.0-beta.13-dev-ed84cb86 * SK-3026 fix spell check * [AUTOMATED] Private Release 3.0.0-beta.13-dev-3671a19a * [AUTOMATED] Private Release 3.0.0-beta.13-dev-16df1ee5 * SK-3037 give the bulk tokenize and delete interfaces their own options types (#390) * [AUTOMATED] Private Release 3.0.0-beta.13-dev-6577fa70 * SK-3026 retry logic update * [AUTOMATED] Private Release 3.0.0-beta.13-dev-9bd1b4be * [AUTOMATED] Private Release 3.0.0-beta.13-dev-969e339a * SK-3026 fix spell check * [AUTOMATED] Private Release 3.0.0-beta.13-dev-eb744eb6 * SK-3026 update v2 folder to skyvault * [AUTOMATED] Private Release 3.0.0-beta.13-dev-f2f6bb20 * SK-3026 add unit tests * [AUTOMATED] Private Release 3.0.0-beta.13-dev-5e368050 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-f72e2218 * SK-3037 report the real cause when tokenize or delete never reach the API (#394) * [AUTOMATED] Private Release 3.0.0-beta.13-dev-2a83759e * SK-3026 add tests * [AUTOMATED] Private Release 3.0.0-beta.13-dev-58dda850 * SK-3026 add tests * [AUTOMATED] Private Release 3.0.0-beta.13-dev-1ff91444 * SK-2967 Backport pr-flowvault.yml CI workflow (#391) * Backport pr-flowvault.yml CI workflow from flowvault-release/test-artifactory-path Verified via a dummy test PR (#381) against that branch - Build and Unit Tests jobs both passed, scoped correctly to flowvault/common/pom.xml path changes. This workflow only existed on the test-artifactory-path branch until now; it was never on main or any other release branch. * SK-2967 backport internal + public release workflow fixes Internal releases (both modules) Version now comes from the module's own pom plus the commit SHA, via scripts/current_module_version.sh, instead of get-previous-tag. Tag lookup is repo-wide with no module awareness, so it stamped an unrelated v3 tag onto both flowvault and v2 builds (3.0.0-beta.13-dev.<sha>). A module's own pom is inherently per-module. Verified: flowvault 1.0.0-dev.<sha>, v2 2.1.1-dev.<sha>. internal-release.yml no longer fires on tag pushes. tags-ignore was '*.*', and Actions' glob '*' does not match '/', so slash tags like flowvault/v1.0.0 were never ignored - a public release tag also started an internal release, resolving to the wrong module. Now '**'. Public/beta releases Triggered by publishing a GitHub Release rather than a raw tag push, so the branch comes from target_commitish - the branch chosen in the release UI. It was previously guessed by matching a branch tip to the tagged commit, which failed once anything landed after the tag (re-runs never worked) and silently pushed to an unrelated branch when several shared a tip. Tags are <module>/v<semver>[-beta.N]; the prefix selects the module and is stripped, so Maven Central sees a plain semver. Malformed tags are rejected instead of publishing something unintended. beta-release.yml merged in: 'release' events cannot be filtered by tag pattern, so both files would fire on every release, and beta/public were already handled identically in every conditional. Kind is derived from the tag. Empty-commit guard: when the pom already holds the release version - the normal case when it is set before tagging - a bare git commit exits 1 and aborted the release. Now treated as success. dry-run input added so this path can be exercised without publishing; Maven Central is immutable. Verified with a real published Release (since deleted): correct module/version/branch, 383 tests, GPG signed, zero uploads. Merged with the base rather than overwriting it: the javadoc-skip added on flowvault-release/26.8.1 is kept for internal builds, but NOT applied to beta/public - Sonatype requires the -javadoc.jar and rejects bundles without one. That matches the intent stated in the base's own comment, which its code contradicted. * SK-2967 stage Maven Central releases instead of auto-publishing Sets autoPublish=false for both flowvault and v2. Deployments now upload and validate, then wait in the Central Portal as VALIDATED until someone clicks Publish - or Drop, to discard them. Maven Central is immutable: a published version can never be edited or removed, and the only remedy for a bad release is shipping another one. With autoPublish=true there was no point at which anything could be checked before that became permanent. Sonatype's validation only checks that required fields are present, not that they are correct. flowvault/pom.xml currently carries <description>Skyflow V3 SDK for the Java programming language</description> on an artifact named skyflow-flowvault-java - copy-paste from the v3 module. That passes validation and would have shipped permanently on the first release of a brand-new coordinate. Exactly what the staging step is for. Note this changes v2's behaviour too: its releases previously went live automatically once mvn deploy succeeded, and now need the extra click. * SK-2967 follow the v2 -> skyvault rename release.yml mapped the skyvault tag prefix to MODULE="v2", a directory that no longer exists - 'mvn -pl v2' would have failed outright. Both prefixes now map straight to their directory name. internal-release.yml already resolved to skyvault: that came from the base and survived the merge, so only release.yml carried the stale mapping. Also refreshed comments that still said v2. Tag examples like skyvault/v2.1.2 are unchanged and correct - the v2 there is the version 2.1.2, not the module. * SK-2967 add skyvault-release/* trigger for internal releases Gives skyvault the same per-module release branch flowvault already had, so both read the same way: flowvault-release/* and skyvault-release/*. release/* is kept as a legacy alias, still mapping to skyvault. Module resolution is now an explicit case with no catch-all. The previous if/else defaulted anything that was not flowvault-release/* to skyvault, which is exactly how a flowvault tag once ended up publishing skyvault - unrecognised refs silently became the wrong module. An unmatched branch now fails loudly, and the resolved module is logged. * [AUTOMATED] Private Release 3.0.0-beta.13-dev-ef9fa592 * SK-3037 add bulk tokenize and delete-tokens samples (#395) * SK-3026 update custom header naming convention * SK-3026 fix workfow * [AUTOMATED] Private Release 3.0.0-beta.13-dev-b05ef4fb * [AUTOMATED] Private Release 3.0.0-beta.13-dev-60859567 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-e8e0e2d0 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-eb82be1b * [AUTOMATED] Private Release 3.0.0-beta.13-dev-496c83a0 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-5ddc5628 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-e6552a0a * [AUTOMATED] Private Release 3.0.0-beta.13-dev-c804c748 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-6ff46f02 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-291b8206 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-99612f55 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-674f7b00 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-068e293a * [AUTOMATED] Private Release 3.0.0-beta.13-dev-1af848a0 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-821cc992 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-610b8f21 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-43f0ba69 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-f9737826 * [AUTOMATED] Private Release 3.0.0-beta.13-dev-6ea42d7c * SK-2967 restore the [AUTOMATED] loop guard to stop the release recursion The internal release force-pushes its own version-bump commit, that push re-triggers the workflow, and it bumps and pushes again - roughly every 30 seconds. It ran ~60 times on this branch before being cancelled. The push uses PAT_ACTIONS, and PAT-authenticated pushes DO trigger workflows; GITHUB_TOKEN pushes deliberately do not. So the guard only becomes load-bearing once the PAT is wired up correctly - which is why the loop started the moment that was fixed, not before (while the secret resolved to empty, checkout failed and nothing could recurse). The guard existed on the v3 branch with a comment describing this exact failure mode, and was lost in the modularization. * Split READMEs per package and resolve flowvault README review (#396) * Split monolithic README into per-package docs for skyvault and flowvault Ports the README restructure from devesh/v2-flowvault-readmes onto this release branch, which already carries the v2 -> skyvault rename: - root README.md becomes a short landing page pointing at each package - skyvault/README.md holds the full skyflow-java documentation - flowvault/README.md documents the skyflow-flowvault-java bulk surface Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Address README review: self-contained flowvault docs, per-record error model Resolves review comments on the flowvault README: - Quickstart declared `VaultController vault` twice. The second line also called `skyflowClient.vault("<VAULT_ID>")`, which flowvault does not expose — its `vault()` takes no argument and always resolves to the first configured vault. Both fixed, and the single-vault behaviour is now stated. - Auth, Credentials, VaultConfig and error handling lived only in the skyvault README, so flowvault users had to switch documents to get started. flowvault now documents them inline: credential types and their setters, credential resolution order, bearer token generation, a full VaultConfig / Skyflow.builder() reference, timeout and retry resolution with defaults, and logging. Only the exotic token variants (context, scoped, signed) still point at skyvault. - Added a note that flowvault is a new SDK versioned independently, so a 1.x flowvault next to a 2.x skyvault does not read as a downgrade. In both the flowvault README and the root package table. - Rewrote Error Handling around flowvault's actual model: request-level SkyflowException versus per-record success/failure inside a call that returns normally, including the trap that a call where every record failed still does not throw. Documents index/httpCode/error/requestId per record, the per-operation summaries, consumption loops for both the one-level and two-level (tokenize) shapes, and the retry helpers. Also brings the API surface in line with this branch, which renamed several types after the README was first written: BulkInsertRequestRecord (was BulkInsertRecord), tableName (was table), UpsertOptions (was upsert/upsertType), TokenGroupRedactions (was BulkTokenGroupRedactions), Bulk*Options (was InsertOptions/TokenizeOptions/...), CustomHeaderKey .SkyflowAccountId/.RequestIdHeader, and the response shape, which is now a single `records` list rather than separate `success` and `errors` lists. Verified: all 20 Java snippets compile against the branch's classes, and every sample JSON response matches the real toString() output. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Document bulk batch size and concurrency configuration The flowvault README noted that bulk calls are split into batches sent concurrently, but never documented how to configure that. Add a "Batching and concurrency" section covering the per-operation env vars, their defaults and maximums, and how effective values are resolved. Values verified against Constants.java and the configure*ConcurrencyAndBatchSize methods in VaultController: batch size is min(value, max) with a warning-and- clamp above the max and a warning-and-default for invalid input; concurrency is additionally capped at ceil(itemCount / batchSize), so it never exceeds the number of batches to run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * [AUTOMATED] Private Release 3.0.0-beta.13-dev-2e606ceb * SK-2967 trim verbose comments in the release workflows Cuts the incident narratives down to the constraint each one exists to protect, 86 comment lines to 36. Every non-comment line is byte-identical to before - verified by stripping comments and blanks from both sides. Also removes a duplicated comment above the fixtures step that had become wrong: it described a glob-based implementation while the step uses a hardcoded module list. * [AUTOMATED] Private Release 3.0.0-beta.13-dev-18f8f1ba * SK-3026 update samples * [AUTOMATED] Private Release 3.0.0-beta.13-dev-ecf6b4be * SK-3037 run contract tests for flowvault, and gate on the public API only (#397) * [AUTOMATED] Private Release 3.0.0-beta.13-dev-962614b1 * SK-3026 remove unused tokens key in insert * [AUTOMATED] Private Release 3.0.0-beta.13-dev-dda2bace * SK-3026 fix tests * [AUTOMATED] Private Release 3.0.0-beta.13-dev-46cbffad * [AUTOMATED] Private Release 3.0.0-beta.13-dev-7e97883a * SK-3026 added tokens support * [AUTOMATED] Private Release 3.0.0-beta.13-dev-7c0fb7be * [AUTOMATED] Private Release 3.0.0-beta.13-dev-c7311820 --------- Co-authored-by: skyflow-bharti <skyflow-bharti@users.noreply.github.com> Co-authored-by: saileshwar-skyflow <156889717+saileshwar-skyflow@users.noreply.github.com> Co-authored-by: Devesh-Skyflow <devesh.bhardwaj@skyflow.com> Co-authored-by: saileshwar-skyflow <saileshwar-skyflow@users.noreply.github.com> Co-authored-by: Devesh-Skyflow <Devesh-Skyflow@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent e9d78dc commit b3cf737

627 files changed

Lines changed: 39271 additions & 6064 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cspell.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"**/*.{java,md,xml,yml,yaml,json,txt,properties}"
77
],
88
"words": [
9+
"japicmp",
910
"Skyflow",
1011
"skyflow",
1112
"skyflowapi",
@@ -96,9 +97,20 @@
9697
"nocreds",
9798
"nodir",
9899
"detok",
99-
"qhdmceurtnlz",
100100
"ngrok",
101-
"obac"
101+
"obac",
102+
"siom",
103+
"vaultid",
104+
"recordss",
105+
"synthesise",
106+
"synthesised",
107+
"deserialise",
108+
"deserialised",
109+
"unmodelled",
110+
"recordss",
111+
"rarr",
112+
"servname",
113+
"nodename"
102114
],
103115
"languageSettings": [
104116
{
@@ -118,7 +130,8 @@
118130
"**/target/**",
119131
"*.lock",
120132
"Rule/**",
121-
"src/main/java/com/skyflow/generated/**",
133+
"**/src/main/java/com/skyflow/generated/**",
134+
"**/generated/**",
122135
"**/*.ts",
123136
"**/processed-*",
124137
"samples/src/main/java/com/example/credentials.json",

.github/workflows/beta-release.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: Contract Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- release/*
8+
- flowvault-release/*
9+
10+
jobs:
11+
contract-tests:
12+
# One job per module so a break in one is reported against that module by name,
13+
# and both still run even when the other fails.
14+
name: Contract Tests (${{ matrix.module }})
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- module: skyvault
22+
artifact: skyflow-java
23+
- module: flowvault
24+
artifact: skyflow-flowvault-java
25+
26+
permissions:
27+
contents: read
28+
pull-requests: write
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Setup Java
37+
uses: actions/setup-java@v4
38+
with:
39+
distribution: 'temurin'
40+
java-version: '11'
41+
cache: 'maven'
42+
43+
- name: Verify API surface snapshot
44+
run: mvn -B install -pl common,${{ matrix.module }} -am -DskipTests -Dmaven.javadoc.skip=true -Dgpg.skip=true
45+
46+
- name: Show API surface diff
47+
if: failure()
48+
run: |
49+
echo "### API surface changes detected in ${{ matrix.module }} ###"
50+
echo "Compared against ${{ matrix.module }}/api-report/${{ matrix.artifact }}.baseline.jar."
51+
echo "If this change is intentional, run:"
52+
echo " scripts/contract-snapshot-update.sh ${{ matrix.module }}"
53+
echo "and commit the updated baseline jar."
54+
echo ""
55+
cat ${{ matrix.module }}/target/japicmp/default-cli.diff || true
56+
57+
- name: Upload API surface diff on failure
58+
if: failure()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: api-surface-diff-${{ matrix.module }}
62+
path: ${{ matrix.module }}/target/japicmp/**
63+
retention-days: 7
64+
65+
# The step above only shows a diff when the CURRENT build differs from the
66+
# committed baseline - once someone runs contract-snapshot-update.sh and
67+
# commits the refreshed baseline jar, that check goes green and shows nothing.
68+
# A reviewer looking at a green PR that touches api-report/*.baseline.jar
69+
# (a binary file) would otherwise have no way to see WHAT was just approved as
70+
# the new contract. These steps explicitly diff the OLD committed baseline
71+
# (from the PR's base branch) against the NEW committed baseline (from this PR)
72+
# and post it as a PR comment, regardless of whether the check above passed.
73+
- name: Check if contract baseline was updated in this PR
74+
id: baseline-diff-check
75+
if: always() && github.event.pull_request
76+
run: |
77+
git fetch origin "${{ github.event.pull_request.base.ref }}" --depth=1
78+
BASELINE="${{ matrix.module }}/api-report/${{ matrix.artifact }}.baseline.jar"
79+
if ! git diff --name-only "origin/${{ github.event.pull_request.base.ref }}" HEAD -- "$BASELINE" | grep -q .; then
80+
echo "changed=false" >> "$GITHUB_OUTPUT"
81+
elif git cat-file -e "origin/${{ github.event.pull_request.base.ref }}:$BASELINE" 2>/dev/null; then
82+
echo "changed=true" >> "$GITHUB_OUTPUT"
83+
else
84+
# Added by this PR rather than modified: the module is getting its
85+
# first baseline. git diff reports an addition as a change, but there
86+
# is no old snapshot to `git show`, so a plain "true" here would send
87+
# the next step into `git show <base>:<path>` and exit 128.
88+
echo "changed=new" >> "$GITHUB_OUTPUT"
89+
fi
90+
91+
- name: Diff old vs new contract baseline
92+
if: always() && (steps.baseline-diff-check.outputs.changed == 'true' || steps.baseline-diff-check.outputs.changed == 'new')
93+
run: |
94+
BASELINE="${{ matrix.module }}/api-report/${{ matrix.artifact }}.baseline.jar"
95+
96+
if [ "${{ steps.baseline-diff-check.outputs.changed }}" = "new" ]; then
97+
{
98+
echo "\`$BASELINE\` is **new in this PR** - \`${{ matrix.module }}\` had no committed baseline before, so there is nothing to diff against."
99+
echo ""
100+
echo "This snapshot becomes the approved contract: every later PR is compared against it, and any incompatible change fails the \`Contract Tests (${{ matrix.module }})\` job until someone regenerates it deliberately. Review it as the starting point, not as a change."
101+
} > /tmp/contract-baseline-diff.md
102+
cat /tmp/contract-baseline-diff.md
103+
exit 0
104+
fi
105+
106+
curl -sL -o /tmp/japicmp-cli.jar "https://repo.maven.apache.org/maven2/com/github/siom79/japicmp/japicmp/0.26.0/japicmp-0.26.0-jar-with-dependencies.jar"
107+
mvn -q -B dependency:build-classpath -pl ${{ matrix.module }} -Dmdep.outputFile=/tmp/module-classpath.txt -Dmaven.javadoc.skip=true -Dgpg.skip=true
108+
git show "origin/${{ github.event.pull_request.base.ref }}:$BASELINE" > /tmp/old-baseline.jar
109+
110+
# Same allowlist the poms gate on, so the comment shows the contract and
111+
# nothing else. Keep these in sync with the <includes> in the module poms.
112+
java -jar /tmp/japicmp-cli.jar \
113+
-o /tmp/old-baseline.jar \
114+
-n "$BASELINE" \
115+
-a protected \
116+
-i "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" \
117+
--old-classpath "$(cat /tmp/module-classpath.txt)" \
118+
--new-classpath "$(cat /tmp/module-classpath.txt)" \
119+
-m \
120+
--ignore-missing-classes \
121+
--markdown > /tmp/contract-baseline-diff.md || true
122+
123+
cat /tmp/contract-baseline-diff.md
124+
125+
- name: Comment contract baseline change on PR
126+
if: always() && (steps.baseline-diff-check.outputs.changed == 'true' || steps.baseline-diff-check.outputs.changed == 'new')
127+
uses: actions/github-script@v7
128+
env:
129+
BASELINE_STATE: ${{ steps.baseline-diff-check.outputs.changed }}
130+
with:
131+
script: |
132+
const fs = require('fs');
133+
const module = '${{ matrix.module }}';
134+
const artifact = '${{ matrix.artifact }}';
135+
const summary = fs.readFileSync('/tmp/contract-baseline-diff.md', 'utf8');
136+
// per-module marker so the two matrix jobs update their own comment
137+
const marker = `<!-- contract-baseline-diff:${module} -->`;
138+
const isNew = process.env.BASELINE_STATE === 'new';
139+
const heading = isNew
140+
? `## Contract baseline added (\`${module}\`)`
141+
: `## Contract baseline change detected (\`${module}\`)`;
142+
const preamble = isNew
143+
? `This PR adds \`${module}/api-report/${artifact}.baseline.jar\`, the approved public API contract for this module.`
144+
: `This PR updates \`${module}/api-report/${artifact}.baseline.jar\` (the approved public API contract). Here is exactly what it changes, comparing the baseline on \`${{ github.event.pull_request.base.ref }}\` against the baseline committed in this PR:`;
145+
const body = `${marker}\n${heading}\n\n${preamble}\n\n${summary}`;
146+
const { data: comments } = await github.rest.issues.listComments({
147+
owner: context.repo.owner,
148+
repo: context.repo.repo,
149+
issue_number: context.issue.number,
150+
});
151+
const existing = comments.find(c => c.body && c.body.includes(marker));
152+
if (existing) {
153+
await github.rest.issues.updateComment({
154+
owner: context.repo.owner,
155+
repo: context.repo.repo,
156+
comment_id: existing.id,
157+
body,
158+
});
159+
} else {
160+
await github.rest.issues.createComment({
161+
owner: context.repo.owner,
162+
repo: context.repo.repo,
163+
issue_number: context.issue.number,
164+
body,
165+
});
166+
}

.github/workflows/endorlabsScan.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ jobs:
3636
name: "credentials.json"
3737
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
3838

39+
- name: Distribute test fixtures to modules
40+
run: |
41+
# Surefire runs each module's tests with the module directory as the working
42+
# directory, so dotenv and ./credentials.json lookups miss the repo-root copies.
43+
for module in common skyvault flowvault; do
44+
cp .env "$module/.env"
45+
cp credentials.json "$module/credentials.json"
46+
done
47+
3948
- name: Compile Package
4049
run: mvn -B package -f pom.xml -Dmaven.javadoc.skip=true
4150

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,62 @@
1-
name: Publish package to the JFROG Artifactory
1+
name: Publish module to the JFROG Artifactory
22
on:
33
push:
4+
# '**' not '*.*': Actions glob '*' does not match '/', so '*.*' let slash
5+
# tags (flowvault/v1.0.0) through and fired this branch-only workflow.
46
tags-ignore:
5-
- '*.*'
7+
- '**'
68
paths-ignore:
79
- "*.md"
810
branches:
11+
- flowvault-release/*
12+
- skyvault-release/*
13+
# Legacy: predates the per-module naming, still maps to skyvault.
914
- release/*
1015

1116
jobs:
17+
resolve-module:
18+
runs-on: ubuntu-latest
19+
# Skip our own bump commit, or this loops: bump -> push -> release -> bump.
20+
# PAT-authenticated pushes DO trigger workflows; GITHUB_TOKEN pushes do not.
21+
# build-and-deploy needs this job, so skipping here skips the run.
22+
if: ${{ !contains(github.event.head_commit.message, '[AUTOMATED]') }}
23+
outputs:
24+
module: ${{ steps.set-module.outputs.module }}
25+
steps:
26+
# Explicit match, no catch-all: defaulting once published the wrong module.
27+
- name: Resolve module from branch name
28+
id: set-module
29+
env:
30+
BRANCH: ${{ github.ref_name }}
31+
run: |
32+
case "$BRANCH" in
33+
flowvault-release/*) MODULE="flowvault" ;;
34+
skyvault-release/*) MODULE="skyvault" ;;
35+
release/*) MODULE="skyvault" ;;
36+
*)
37+
echo "::error::Branch '$BRANCH' does not map to a module."
38+
exit 1
39+
;;
40+
esac
41+
echo "Branch '$BRANCH' -> module '$MODULE'"
42+
echo "module=$MODULE" >> "$GITHUB_OUTPUT"
43+
1244
build-and-deploy:
45+
needs: resolve-module
1346
uses: ./.github/workflows/shared-build-and-deploy.yml
1447
with:
1548
ref: ${{ github.ref_name }}
1649
server-id: central
1750
profile: jfrog
1851
tag: 'internal'
52+
module: ${{ needs.resolve-module.outputs.module }}
1953
secrets:
2054
server-username: ${{ secrets.ARTIFACTORY_USERNAME }}
2155
server-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
2256
gpg-key: ${{ secrets.JFROG_GPG_KEY }}
2357
gpg-passphrase: ${{ secrets.JFROG_GPG_PASSPHRASE }}
24-
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
25-
test-expired-token: ${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
26-
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
58+
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }}
59+
test-expired-token: ${{ secrets.TEST_EXPIRED_TOKEN }}
60+
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }}
61+
pat-actions: ${{ secrets.PAT_ACTIONS }}
62+
test-credentials-file-string: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}

.github/workflows/main.yml

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,65 @@ jobs:
3030
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
3131
echo TEST_REUSABLE_TOKEN=${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
3232
33+
- name: Distribute test fixtures to modules
34+
run: |
35+
# Surefire runs each module's tests with the module directory as the working
36+
# directory, so dotenv and ./credentials.json lookups miss the repo-root copies.
37+
for module in common skyvault flowvault; do
38+
cp .env "$module/.env"
39+
cp credentials.json "$module/credentials.json"
40+
done
41+
3342
- name: Build & Run tests with Maven
3443
run: mvn -B package -f pom.xml -Dmaven.javadoc.skip=true
3544

36-
- name: Codecov
37-
uses: codecov/codecov-action@v2.1.0
45+
# JaCoCo records packages as "com/skyflow/..." with no module prefix, and all three
46+
# modules share the com.skyflow package (deliberate split-package convention). So
47+
# "com/skyflow/config/VaultConfig.java" matches BOTH skyvault and flowvault, Codecov
48+
# resolves it to one of them, and the other module's file silently reports no data.
49+
# Prefixing each report with its own source root makes every path unique and match the
50+
# repo exactly, so all three modules' files are attributed correctly.
51+
- name: Qualify JaCoCo report paths with their module
52+
run: |
53+
for module in common skyvault flowvault; do
54+
report="$module/target/site/jacoco/jacoco.xml"
55+
if [ ! -f "$report" ]; then
56+
echo "Error: expected $report to exist after the build."
57+
exit 1
58+
fi
59+
tmp="$(mktemp)"
60+
sed "s|<package name=\"|<package name=\"$module/src/main/java/|g" "$report" > "$tmp"
61+
mv "$tmp" "$report"
62+
done
63+
64+
# One upload per module, each with its own flag, so Codecov reports per-module
65+
# coverage instead of merging three same-named package trees into one number.
66+
- name: Codecov (common)
67+
uses: codecov/codecov-action@v5
68+
with:
69+
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
70+
files: common/target/site/jacoco/jacoco.xml
71+
flags: common
72+
name: codecov-common
73+
verbose: true
74+
fail_ci_if_error: true
75+
76+
- name: Codecov (skyvault)
77+
uses: codecov/codecov-action@v5
78+
with:
79+
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
80+
files: skyvault/target/site/jacoco/jacoco.xml
81+
flags: skyvault
82+
name: codecov-skyvault
83+
verbose: true
84+
fail_ci_if_error: true
85+
86+
- name: Codecov (flowvault)
87+
uses: codecov/codecov-action@v5
3888
with:
3989
token: ${{ secrets.CODECOV_REPO_UPLOAD_TOKEN }}
40-
files: target/site/jacoco/jacoco.xml
41-
name: codecov-skyflow-java
90+
files: flowvault/target/site/jacoco/jacoco.xml
91+
flags: flowvault
92+
name: codecov-flowvault
4293
verbose: true
94+
fail_ci_if_error: true

0 commit comments

Comments
 (0)