Skip to content

Commit 45183ab

Browse files
committed
Merge branch 'main' of github.com:apache/datasketches-java into test-cross-language-test-for-reservoir-sampling-sketch
2 parents fdf8c9f + f1ac363 commit 45183ab

File tree

14 files changed

+479
-378
lines changed

14 files changed

+479
-378
lines changed

.github/workflows/auto-jdk-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
66
pull_request:
7-
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
7+
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/LICENSE', '**/NOTICE' ]
88
# The branches below must be a subset of the branches above
99
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
1010
workflow_dispatch:
@@ -48,7 +48,7 @@ jobs:
4848
java-version: ${{ matrix.jdk }}
4949
distribution: 'temurin'
5050
java-package: jdk
51-
architecture: x64
51+
architecture: x64
5252

5353
- name: Echo Java Version
5454
run: >

.github/workflows/auto-os-matrix.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Auto OS Matrix Test & Install
22

33
on:
44
push:
5-
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
5+
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/LICENSE', '**/NOTICE' ]
66
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
77
pull_request:
8-
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
8+
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/LICENSE', '**/NOTICE' ]
99
# The branches below must be a subset of the branches above
1010
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
1111
workflow_dispatch:
@@ -58,7 +58,7 @@ jobs:
5858
java-version: ${{ matrix.jdk }}
5959
distribution: 'temurin'
6060
java-package: jdk
61-
architecture: x64
61+
architecture: x64
6262

6363
- name: Echo Java Version
6464
run: >
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: CPP SerDe Compatibility Test
22

33
on:
44
push:
5-
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
5+
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/LICENSE', '**/NOTICE' ]
66
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
77
pull_request:
8-
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ]
8+
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/LICENSE', '**/NOTICE' ]
99
# The branches below must be a subset of the branches above
1010
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
1111
workflow_dispatch:

.github/workflows/javadoc.yml

Lines changed: 67 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@ name: Deploy Versioned Javadoc (Manual Trigger)
33
# Select the target TAG where to run the workflow from.
44
# This TAG name becomes the subdirectory under branch gh-pages/docs/${TAG}
55
# where the javadocs will be copied to.
6+
# The gh-pages/docs branch/folder must exist.
67

78
on:
89
workflow_dispatch:
910
inputs:
1011
tag_ref:
11-
description: 'Existing Git Tag to deploy (e.g., 1.0.0)'
12+
description: 'Existing Git Tag to deploy (e.g., 1.0.0):'
1213
required: true
13-
default: '1.0.0' # Default can be left blank or set to a placeholder
14+
default: '99.0.0' # unlikely to conflict if accidentally used. Can be left blank
1415

1516
jobs:
1617
build-and-deploy-javadoc:
1718
runs-on: ubuntu-latest
1819
permissions:
19-
contents: write # Sufficient for checkout and pushing to gh-pages
20+
contents: write
2021

2122
steps:
2223
- name: Checkout Code at Specified Tag
@@ -30,37 +31,68 @@ jobs:
3031
with:
3132
java-version: '25'
3233
distribution: 'temurin'
33-
cache: 'maven'
34-
35-
- name: Build and Generate Javadoc
36-
run: mvn javadoc:javadoc
37-
38-
- name: Deploy Javadoc to gh-pages/docs/${TAG}
34+
cache: 'maven'
35+
36+
- name: Build and Generate Javadoc # POM is configured to output to target/site/apidocs
37+
run: mvn clean javadoc:javadoc
38+
39+
- name: Deploy Javadoc via Worktree
3940
env:
40-
GH_PAGES_EMAIL: noreply@github.com
41-
GH_PAGES_NAME: github-actions[bot]
42-
GIT_TAG_NAME: ${{ github.event.inputs.tag_ref }}
43-
TARGET_DIR: docs/${{ github.event.inputs.tag_ref }}
44-
41+
TAG_NAME: ${{ github.event.inputs.tag_ref }}
42+
run: |
43+
if [ -z "$TAG_NAME" ]; then echo "ERROR: No tag specified"; exit 1; fi
44+
45+
# 1. Initialize error tracking
46+
EXIT_CODE=0
47+
48+
# 2. Configure Git Identity
49+
git config user.email "noreply@github.com"
50+
git config user.name "github-actions[bot]"
51+
52+
# 3. Ensure gh-pages exists and is fetched
53+
echo "ECHO: git fetch origin gh-pages"
54+
git fetch origin gh-pages
55+
56+
# 4. Create worktree for the gh-pages branch in a separate folder
57+
echo "ECHO: git worktree add -B gh-pages ./gh-pages-dir origin/gh-pages"
58+
git worktree add -B gh-pages ./gh-pages-dir origin/gh-pages
59+
60+
# 5. Deployment Logic in a subshell to capture exit code
61+
(
62+
set -e
63+
TARGET_PATH="gh-pages-dir/docs/$TAG_NAME"
64+
mkdir -p "$TARGET_PATH"
65+
66+
echo "ECHO: cp -a target/site/apidocs/. $TARGET_PATH/"
67+
cp -a target/site/apidocs/. "$TARGET_PATH/"
68+
cd gh-pages-dir
69+
70+
echo "ECHO: git pull origin gh-pages --rebase"
71+
git pull origin gh-pages --rebase
72+
73+
echo "git add docs/$TAG_NAME"
74+
git add "docs/$TAG_NAME"
75+
76+
if git diff --staged --quiet; then
77+
echo "No changes detected for Javadoc $TAG_NAME."
78+
else
79+
echo "ECHO: Changes detected for Javadoc $TAG_NAME."
80+
echo "ECHO: git commit ..."
81+
git commit -m "Manual Javadoc deployment for tag $TAG_NAME"
82+
echo "ECHO: git push origin gh-pages"
83+
git push origin gh-pages
84+
fi
85+
) || EXIT_CODE=$?
86+
87+
# 6. Cleanup (Always runs)
88+
echo "ECHO: Cleaning up worktree..."
89+
git worktree remove --force ./gh-pages-dir || true
90+
91+
# 7. Final exit based on subshell success
92+
exit $EXIT_CODE
93+
94+
- name: Confirm Deployment
95+
if: success()
4596
run: |
46-
# 1. Configure Git user
47-
git config user.email "${GH_PAGES_EMAIL}"
48-
git config user.name "${GH_PAGES_NAME}"
49-
50-
# 2. Fetch and checkout the existing gh-pages branch (or create it if it doesn't exist)
51-
git fetch origin gh-pages:gh-pages
52-
git checkout gh-pages
53-
54-
# 3. Clean up any previous documentation for this tag (optional, but safer)
55-
rm -rf $TARGET_DIR
56-
57-
# 4. Create the versioned directory structure
58-
mkdir -p $TARGET_DIR
59-
60-
# 5. Copy the generated Javadoc files into the versioned directory
61-
cp -r target/reports/apidocs/* $TARGET_DIR/
62-
63-
# 6. Add the new directory and files, commit, and push
64-
git add $TARGET_DIR
65-
git commit -m "Manual Javadoc deployment for tag ${GIT_TAG_NAME} into $TARGET_DIR"
66-
git push origin gh-pages
97+
echo "ECHO: Javadoc for ${{ github.event.inputs.tag_ref }} is now live on gh-pages."
98+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# Additional tools
1717
.clover/
18+
.mvn/
1819

1920
# OSX files
2021
**/.DS_Store

.mvn/maven.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# suppresses the warning:
2+
# Direct modification of testCompileSourceRoots through add() is deprecated and will not work in Maven 4.0.0. Please use the add/remove methods instead.
3+
# If you're using a plugin that causes this warning, please upgrade to the latest version and report an issue if the warning persists.
4+
# To disable these warnings, set -Dmaven.project.sourceRoots.warningsDisabled=true on the command line, in the .mvn/maven.config file,
5+
# or in project POM properties.
6+
-Dmaven.project.sourceRoots.warningsDisabled=true

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,23 @@
2020
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.datasketches/datasketches-java/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.datasketches/datasketches-java)
2121
[![Coverage Status](https://coveralls.io/repos/github/apache/datasketches-java/badge.svg)](https://coveralls.io/github/apache/datasketches-java)
2222

23-
=================
23+
-----------------
24+
25+
# Apache® DataSketches™ Core Java Library Component
2426

25-
# Apache<sup>&reg;</sup> DataSketches&trade; Core Java Library Component
2627
This is the core Java component of the DataSketches library. It contains all of the sketching algorithms and can be accessed directly from user applications.
2728

2829
This component is also a dependency of other components of the library that create adaptors for target systems, such as the [Apache Pig adaptor](https://github.com/apache/datasketches-pig), the [Apache Hive adaptor](https://github.com/apache/datasketches-hive), and others.
2930

30-
Note that we have parallel core library components for C++, Python and GO implementations of many of the same sketch algorithms:
31+
Note that we have parallel core library components for C++, Python, and GO implementations of many of the same sketch algorithms:
3132

32-
- [datasketches-cpp](https://github.com/apache/datasketches-cpp),
33-
- [datasketches-python](https://github.com/apache/datasketches-python),
34-
- [datasketches-go](https://github.com/apache/datasketches-go).
33+
- [datasketches-cpp](https://github.com/apache/datasketches-cpp)
34+
- [datasketches-python](https://github.com/apache/datasketches-python)
35+
- [datasketches-go](https://github.com/apache/datasketches-go)
3536

3637
Please visit the main [DataSketches website](https://datasketches.apache.org) for more information.
3738

38-
If you are interested in making contributions to this site please see our [Community](https://datasketches.apache.org/docs/Community/) page for how to contact us.
39+
If you are interested in making contributions to this site, please see our [Community](https://datasketches.apache.org/docs/Community/) page for how to contact us.
3940

4041

4142
## Build & Runtime Dependencies
@@ -76,7 +77,7 @@ This will create the following jars:
7677

7778
### SpotBugs
7879

79-
* Make sure you configure SpotBugs with the /tools/FindBugsExcludeFilter.xml file. Otherwise, you may get a lot of false positive or low risk issues that we have examined and eliminated with this exclusion file.
80+
* Make sure you configure SpotBugs with the `/tools/FindBugsExcludeFilter.xml` file. Otherwise, you may get a lot of false positive or low risk issues that we have examined and eliminated with this exclusion file.
8081

8182
### Checkstyle
8283

0 commit comments

Comments
 (0)