Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- **This description will be used to generate release notes when the PR is merged**
- add the label `ignore-for-release` to prevent this PR from being linked to a release
- Please fill out the description of what was changed/added/fixed in this PR
- Be sure to link any issues
- Increment the version in the pom.xml and README.md if you want a release & maven publish to happen upon merge
8 changes: 8 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Changes
labels:
- "*"
52 changes: 0 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,7 @@ on:
- master

jobs:
get_javadocs_status:
name: get-javadocs-status
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10 # important for use of HEAD^2
# find the last commit message on the source branch
- name: Get last commit message
shell: bash
run: echo "##[set-output name=commitMsg;]$(git log --format=%B -n 1 HEAD^2)"
id: extract_message
outputs:
# create an output that tells the following jobs whether or not we need to generate javadocs
generate_javadocs: ${{ steps.extract_message.outputs.commitMsg != '--- auto-generation of javadocs ---' }}

publish-javadocs:
needs: get_javadocs_status
# only run this if we have not generated javadocs in last commit
if: ${{ needs.get_javadocs_status.outputs.generate_javadocs == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# extract the PR source branch name from the env variable where we can use it later
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF#refs/heads/})"
id: extract_branch
# generate the javadocs into the target/site/apidocs folder (default)
- name: Generate javadocs with Maven
run: mvn javadoc:javadoc
# publish the generated javadocs into the /docs folder on a new commit in this branch
- name: Publish javadocs to GitHub Pages
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: ${{ steps.extract_branch.outputs.branch }}
folder: target/site/apidocs
target-folder: docs
git-config-name: Continuous Integration
git-config-email: devs@sovren.com
commit-message: --- auto-generation of javadocs ---
token: ${{ secrets.JAVADOCS_CI_TOKEN }}

build:
needs: get_javadocs_status
# only run this if we have already generated javadocs in last commit
if: ${{ needs.get_javadocs_status.outputs.generate_javadocs == 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -70,10 +20,8 @@ jobs:
run: mvn -B compile --file pom.xml

unit-tests:
needs: get_javadocs_status
runs-on: ubuntu-latest
# only run this if we have already generated javadocs in last commit
if: ${{ needs.get_javadocs_status.outputs.generate_javadocs == 'false' }}
steps:
- name: Checkout the latest code
uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,63 @@
# This workflow will build a package using Maven and then publish it to Maven Central when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path

name: maven-publish
name: create-release

on:
release:
types: [published]
push:
branches:
- master
workflow_dispatch: #add this option in case of a failure and we need to re-run

jobs:
build:

get-version-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get version
id: package_version
uses: PERES-Richard/maven-get-version-action@v3.0.0
outputs:
version_tag: v${{ steps.package_version.outputs.version }}
check-tag-exists:
needs: get-version-tag
runs-on: ubuntu-latest
steps:
- uses: mukunku/tag-exists-action@v1.6.0
id: check_tag
with:
tag: ${{ needs.get-version-tag.outputs.version_tag }}
outputs:
should_create_release: ${{ steps.check_tag.outputs.exists != 'true' }}
create-release:
needs: [check-tag-exists, get-version-tag]
if: ${{ needs.check-tag-exists.outputs.should_create_release == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
make_latest: 'true'
tag_name: ${{ needs.get-version-tag.outputs.version_tag }}
name: ${{ needs.get-version-tag.outputs.version_tag }}
maven-publish:
needs: [create-release, check-tag-exists]
if: ${{ needs.check-tag-exists.outputs.should_create_release == 'true' }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Build with Maven
run: mvn -B package -DskipTests --file pom.xml

- name: Set up Apache Maven Central
uses: actions/setup-java@v1
with: # running setup-java again overwrites the settings.xml
Expand All @@ -32,7 +67,6 @@ jobs:
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_TK }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

- name: Publish to Apache Maven Central
run: mvn -B clean deploy -DskipTests
env:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow will generate javadocs, build, and test a package using Maven

name: docs-publish

on:
push:
branches:
- master
workflow_dispatch: #add this option in case of a failure and we need to re-run

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# generate the javadocs into the target/site/apidocs folder (default)
- name: Generate javadocs with Maven
run: mvn javadoc:javadoc
# upload the generated docs into an artifact that can be used by the job below
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v3
with:
path: target/site/apidocs
deploy:
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The official Java SDK for the Textkernel Tx v10 API for resume/CV and job parsin
### Gradle Users
Add this dependency to your project's build file:
```
implementation "com.textkernel:tx-java:2.3.3"
implementation "com.textkernel:tx-java:2.3.4"
```

### Maven Users
Expand All @@ -22,13 +22,13 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.textkernel</groupId>
<artifactId>tx-java</artifactId>
<version>2.3.3</version>
<version>2.3.4</version>
</dependency>
```

### Others
You'll need to manually install the following JARs:
- The Textkernel Tx JAR from https://repo1.maven.org/maven2/com/textkernel/tx-java/2.3.3/tx-java-2.3.3.jar
- The Textkernel Tx JAR from https://repo1.maven.org/maven2/com/textkernel/tx-java/2.3.4/tx-java-2.3.4.jar
- [Google Gson][gson_url] from https://repo1.maven.org/maven2/com/google/code/gson/gson/2.9.0/gson-2.9.0.jar
- [Square OkHttp][okhttp_url] from https://repo1.maven.org/maven2/com/squareup/okhttp3/okhttp/4.12.0/okhttp-4.12.0.jar

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.textkernel</groupId>
<artifactId>tx-java</artifactId>

<version>2.3.3</version>
<version>2.3.4</version>

<packaging>jar</packaging>
<name>Textkernel Tx Java SDK</name>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/textkernel/tx/TxClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,9 @@ public DeleteDocumentResponse deleteDocument(String indexId, String documentId)
* @throws TxException Thrown when an API error occurs
*/
public DeleteMultipleDocumentsResponse deleteMultipleDocuments(String indexId, List<String> documentIds) throws TxException {
RequestBody requestBody = createJsonBody(documentIds);
DeleteMultipleDocumentsRequest request = new DeleteMultipleDocumentsRequest();
request.DocumentIds = documentIds;
RequestBody requestBody = createJsonBody(request);
Request apiRequest = new Request.Builder()
.url(_endpoints.multipleDocuments(indexId))
.delete(requestBody)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright © 2023 Textkernel BV. All rights reserved.
// This file is provided for use by, or on behalf of, Textkernel licensees
// within the terms of their license of Textkernel products or Textkernel customers
// within the Terms of Service pertaining to the Textkernel SaaS products.

package com.textkernel.tx.models.api.indexes;

import java.util.List;

/**
* Request body to delete multiple indexed documents
*/
public class DeleteMultipleDocumentsRequest {

/** The document IDs to delete */
public List<String> DocumentIds;
}
4 changes: 2 additions & 2 deletions src/test/java/com/textkernel/tx/integration/ParsingTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testLargeDocumentParse() {
Client.parseResume(new ParseRequest(new Document(new byte[40_000_000], LocalDate.now()), null));
});

String expected = "Request body too large.";
String expected = "Request body was too large";
assertEquals(expected, e.getMessage().substring(0, expected.length()));
}

Expand Down Expand Up @@ -614,7 +614,7 @@ public void TestProfessionNormalization() throws Exception {
assertNotNull(response.Value.ResumeData.EmploymentHistory.Positions.get(0).NormalizedProfession.ISCO);
assertNotNull(response.Value.ResumeData.EmploymentHistory.Positions.get(0).NormalizedProfession.ONET);
assertNotNull(response.Value.ResumeData.EmploymentHistory.Positions.get(0).NormalizedProfession.ONET.Version);
assertEquals("2010", response.Value.ResumeData.EmploymentHistory.Positions.get(0).NormalizedProfession.ONET.Version);
assertEquals("2019", response.Value.ResumeData.EmploymentHistory.Positions.get(0).NormalizedProfession.ONET.Version);
assertNotEquals(0, response.Value.ResumeData.EmploymentHistory.Positions.get(0).NormalizedProfession.Confidence);

assertNotNull(response.Value.ResumeData.EmploymentHistory.Positions.get(1).NormalizedProfession);
Expand Down