Skip to content

Commit fdba4e2

Browse files
Merge pull request #213 from skyflowapi/v3-release/25.8.2
SK-2274 release/25.8.2
2 parents fbc045e + 7cbf0ff commit fdba4e2

File tree

458 files changed

+14464
-1280
lines changed

Some content is hidden

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

458 files changed

+14464
-1280
lines changed

.github/workflows/beta-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ jobs:
77
uses: ./.github/workflows/shared-build-and-deploy.yml
88
with:
99
ref: ${{ github.ref_name }}
10-
server-id: ossrh
10+
server-id: central
1111
profile: maven-central
1212
tag: 'beta'
13+
module: 'v3'
1314
secrets:
1415
server-username: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_USERNAME }}
1516
server-password: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_PASSWORD }}
1617
gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
1718
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
1819
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
1920
test-expired-token: ${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
20-
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
21+
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
name: Publish package to the JFROG Artifactory
1+
name: Publish v3 module to the JFROG Artifactory
22
on:
33
push:
44
tags-ignore:
55
- '*.*'
66
paths-ignore:
77
- "*.md"
88
branches:
9-
- release/*
9+
- v3-release/*
1010

1111
jobs:
12-
build-and-deploy:
12+
build-and-deploy-v3:
1313
uses: ./.github/workflows/shared-build-and-deploy.yml
1414
with:
1515
ref: ${{ github.ref_name }}
1616
server-id: central
1717
profile: jfrog
1818
tag: 'internal'
19+
module: 'v3'
1920
secrets:
2021
server-username: ${{ secrets.ARTIFACTORY_USERNAME }}
2122
server-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
2223
gpg-key: ${{ secrets.JFROG_GPG_KEY }}
2324
gpg-passphrase: ${{ secrets.JFROG_GPG_PASSPHRASE }}
2425
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
2526
test-expired-token: ${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
26-
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
27+
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env

.github/workflows/shared-build-and-deploy.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ on:
2121
description: 'Release Tag'
2222
required: true
2323
type: string
24+
25+
module:
26+
description: 'Module to build and publish'
27+
required: false
28+
type: string
29+
default: ''
30+
2431
secrets:
2532
server-username:
2633
required: true
@@ -54,7 +61,7 @@ jobs:
5461
- name: Set up maven or jfrog repository
5562
uses: actions/setup-java@v1
5663
with:
57-
java-version: "1.8"
64+
java-version: "11"
5865
distribution: "adopt"
5966
server-id: ${{ inputs.server-id }}
6067
server-username: SERVER_USERNAME
@@ -87,7 +94,7 @@ jobs:
8794
if ${{ inputs.tag == 'internal' }}; then
8895
./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")"
8996
else
90-
./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}"
97+
./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "" "${{ inputs.module }}"
9198
fi
9299
93100
- name: Commit changes
@@ -99,7 +106,7 @@ jobs:
99106
git checkout ${{ env.branch_name }}
100107
fi
101108
102-
git add pom.xml
109+
git add v3/pom.xml
103110
if [[ "${{ inputs.tag }}" == "internal" ]]; then
104111
git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}-dev-$(git rev-parse --short $GITHUB_SHA)"
105112
git push origin ${{ github.ref_name }} -f
@@ -125,9 +132,14 @@ jobs:
125132
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
126133

127134
- name: Publish package
128-
run: mvn --batch-mode deploy -P ${{ inputs.profile }}
135+
run: |
136+
if [[ "${{ inputs.tag }}" == "internal" ]]; then
137+
mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P jfrog
138+
elif [[ "${{ inputs.tag }}" == "beta" || "${{ inputs.tag }}" == "public" ]]; then
139+
mvn --batch-mode -pl ${{ inputs.module }} -am deploy -P ${{ inputs.profile }}
140+
fi
129141
130142
env:
131143
SERVER_USERNAME: ${{ secrets.server-username }}
132144
SERVER_PASSWORD: ${{ secrets.server-password }}
133-
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
145+
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.idea
22

3-
target
3+
target
4+
5+
**/dependency-reduced-pom.xml
6+
.env

common/pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<parent>
7+
<groupId>com.skyflow</groupId>
8+
<artifactId>skyflow</artifactId>
9+
<version>1.0.0</version>
10+
<relativePath>../pom.xml</relativePath>
11+
</parent>
12+
13+
<artifactId>common</artifactId>
14+
<version>1.0.0</version>
15+
16+
17+
<properties>
18+
<maven.compiler.source>8</maven.compiler.source>
19+
<maven.compiler.target>8</maven.compiler.target>
20+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
21+
</properties>
22+
</project>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package com.skyflow;
2+
3+
import com.skyflow.config.Credentials;
4+
import com.skyflow.config.VaultConfig;
5+
import com.skyflow.enums.LogLevel;
6+
import com.skyflow.logs.InfoLogs;
7+
import com.skyflow.utils.BaseUtils;
8+
import com.skyflow.utils.logger.LogUtil;
9+
10+
import java.util.LinkedHashMap;
11+
12+
class BaseSkyflow {
13+
private final BaseSkyflowClientBuilder builder;
14+
15+
protected BaseSkyflow(BaseSkyflowClientBuilder builder) {
16+
this.builder = builder;
17+
}
18+
19+
public LogLevel getLogLevel() {
20+
return this.builder.logLevel;
21+
}
22+
23+
public VaultConfig getVaultConfig() {
24+
Object[] array = this.builder.vaultConfigMap.values().toArray();
25+
return (VaultConfig) array[0];
26+
}
27+
28+
static class BaseSkyflowClientBuilder {
29+
protected final LinkedHashMap<String, VaultConfig> vaultConfigMap;
30+
protected Credentials skyflowCredentials;
31+
protected LogLevel logLevel;
32+
33+
protected BaseSkyflowClientBuilder() {
34+
this.vaultConfigMap = new LinkedHashMap<>();
35+
this.skyflowCredentials = null;
36+
this.logLevel = LogLevel.ERROR;
37+
}
38+
39+
public BaseSkyflowClientBuilder setLogLevel(LogLevel logLevel) {
40+
this.logLevel = logLevel == null ? LogLevel.ERROR : logLevel;
41+
LogUtil.setupLogger(this.logLevel);
42+
LogUtil.printInfoLog(BaseUtils.parameterizedString(
43+
InfoLogs.CURRENT_LOG_LEVEL.getLog(), String.valueOf(logLevel)
44+
));
45+
return this;
46+
}
47+
}
48+
}

src/main/java/com/skyflow/config/Credentials.java renamed to common/src/main/java/com/skyflow/config/Credentials.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.util.ArrayList;
44

5-
public class Credentials {
5+
public class Credentials implements Cloneable {
66
private String path;
77
private ArrayList<String> roles;
88
private String context;
@@ -63,4 +63,13 @@ public String getApiKey() {
6363
public void setApiKey(String apiKey) {
6464
this.apiKey = apiKey;
6565
}
66+
67+
@Override
68+
public Object clone() throws CloneNotSupportedException {
69+
Credentials cloned = (Credentials) super.clone();
70+
if (this.roles != null) {
71+
cloned.roles = new ArrayList<>(this.roles);
72+
}
73+
return cloned;
74+
}
6675
}

src/main/java/com/skyflow/config/VaultConfig.java renamed to common/src/main/java/com/skyflow/config/VaultConfig.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.skyflow.enums.Env;
44

5-
public class VaultConfig {
5+
public class VaultConfig implements Cloneable {
66
private String vaultId;
77
private String clusterId;
88
private Env env;
@@ -46,4 +46,13 @@ public Credentials getCredentials() {
4646
public void setCredentials(Credentials credentials) {
4747
this.credentials = credentials;
4848
}
49+
50+
@Override
51+
public Object clone() throws CloneNotSupportedException {
52+
VaultConfig cloned = (VaultConfig) super.clone();
53+
if (this.credentials != null) {
54+
cloned.credentials = (Credentials) this.credentials.clone();
55+
}
56+
return cloned;
57+
}
4958
}
File renamed without changes.

src/main/java/com/skyflow/enums/InterfaceName.java renamed to common/src/main/java/com/skyflow/enums/InterfaceName.java

File renamed without changes.

0 commit comments

Comments
 (0)