Skip to content

Commit eb1336d

Browse files
Merge pull request #193 from skyflowapi/skyflow-vivek/SK-2259-immutable-skyflow-client-initialisation
SK-2259 immutable skyflow client initialisation
2 parents 4e9e454 + facb699 commit eb1336d

File tree

545 files changed

+61391
-11235
lines changed

Some content is hidden

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

545 files changed

+61391
-11235
lines changed

.github/workflows/beta-release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Public beta release
2+
on:
3+
push:
4+
tags: '*.*.*-beta.*'
5+
jobs:
6+
build-and-deploy:
7+
uses: ./.github/workflows/shared-build-and-deploy.yml
8+
with:
9+
ref: ${{ github.ref_name }}
10+
server-id: ossrh
11+
profile: maven-central
12+
tag: 'beta'
13+
secrets:
14+
server-username: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_USERNAME }}
15+
server-password: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_PASSWORD }}
16+
gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
17+
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
18+
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
19+
test-expired-token: ${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
20+
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env

.github/workflows/endorlabsScan.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Publish package to the JFROG Artifactory
22
on:
33
push:
4-
tags: '*.*.*'
4+
tags-ignore:
5+
- '*.*'
56
paths-ignore:
6-
- "pom.xml"
77
- "*.md"
88
branches:
99
- release/*
@@ -13,11 +13,14 @@ jobs:
1313
uses: ./.github/workflows/shared-build-and-deploy.yml
1414
with:
1515
ref: ${{ github.ref_name }}
16-
is-internal: true
1716
server-id: central
1817
profile: jfrog
18+
tag: 'internal'
1919
secrets:
2020
server-username: ${{ secrets.ARTIFACTORY_USERNAME }}
2121
server-password: ${{ secrets.ARTIFACTORY_PASSWORD }}
2222
gpg-key: ${{ secrets.JFROG_GPG_KEY }}
23-
gpg-passphrase: ${{ secrets.JFROG_GPG_PASSPHRASE }}
23+
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

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
2424

2525
- name: Build & Run tests with Maven
26-
run: mvn -B package -DTEST_VAULT_ID=${{ secrets.TEST_VAULT_ID }} -DTEST_VAULT_URL=${{ secrets.TEST_VAULT_URL }} -DTEST_SKYFLOW_ID=${{ secrets.TEST_SKYFLOW_ID }} -DTEST_TOKEN=${{ secrets.TEST_TOKEN }} -DTEST_CREDENTIALS=${{ secrets.TEST_CREDENTIALS_FILE_STRING }} -DTEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} -f pom.xml
26+
run: mvn -B package -DTEST_VAULT_ID=${{ secrets.TEST_VAULT_ID }} -DTEST_VAULT_URL=${{ secrets.TEST_VAULT_URL }} -DTEST_SKYFLOW_ID=${{ secrets.TEST_SKYFLOW_ID }} -DTEST_TOKEN=${{ secrets.TEST_TOKEN }} -DTEST_CREDENTIALS=${{ secrets.TEST_CREDENTIALS_FILE_STRING }} -DTEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} -DTEST_REUSABLE_TOKEN=${{ secrets.TEST_REUSABLE_TOKEN }} -f pom.xml
2727

2828
- name: Codecov
2929
uses: codecov/codecov-action@v2.1.0

.github/workflows/pr.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: PR CI Checks
22

3-
on: [ pull_request ]
3+
on: [pull_request]
44

55
jobs:
66
check-commit-message:
@@ -11,18 +11,18 @@ jobs:
1111
uses: gsactions/commit-message-checker@v1
1212
with:
1313
pattern: '(\[?[A-Z]{1,5}-[1-9][0-9]*)|(\[AUTOMATED\])|(Merge)|(Release).+$'
14-
flags: 'gm'
15-
excludeDescription: 'true'
16-
checkAllCommitMessages: 'true'
14+
flags: "gm"
15+
excludeDescription: "true"
16+
checkAllCommitMessages: "true"
1717
accessToken: ${{ secrets.PAT_ACTIONS }}
18-
error: 'One of your your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )'
18+
error: "One of your your commit messages is not matching the format with JIRA ID Ex: ( SDK-123 commit message )"
1919
Test:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v1
2323
- uses: actions/setup-java@v1
2424
with:
25-
java-version: '1.8'
25+
java-version: "1.8"
2626

2727
- name: create-json
2828
id: create-json
@@ -31,8 +31,16 @@ jobs:
3131
name: "credentials.json"
3232
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
3333

34+
- name: create env
35+
id: create-env
36+
run: |
37+
touch .env
38+
echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
39+
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
40+
echo TEST_REUSABLE_TOKEN=${{ secrets.TEST_REUSABLE_TOKEN }} >> .env
41+
3442
- name: Build & Run tests with Maven
35-
run: mvn -B package -DTEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} -DTEST_DATA_CREDENTIALS_FILE=${{ secrets.TEST_DATA_CREDENTIALS_FILE }} -f pom.xml
43+
run: mvn -B package -f pom.xml -Dmaven.javadoc.skip=true
3644

3745
- name: Codecov
3846
uses: codecov/codecov-action@v2.1.0

.github/workflows/release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish package to the Maven Central Repository
1+
name: Public release
22
on:
33
push:
44
tags: '*.*.*'
@@ -7,11 +7,14 @@ jobs:
77
uses: ./.github/workflows/shared-build-and-deploy.yml
88
with:
99
ref: ${{ github.ref_name }}
10-
is-internal: false
1110
server-id: ossrh
1211
profile: maven-central
12+
tag: 'public'
1313
secrets:
14-
server-username: ${{ secrets.OSSRH_USERNAME }}
15-
server-password: ${{ secrets.OSSRH_PASSWORD }}
14+
server-username: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_USERNAME }}
15+
server-password: ${{ secrets.CENTRAL_PUBLISHER_PORTAL_PASSWORD }}
1616
gpg-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
17-
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
17+
gpg-passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
18+
skyflow-credentials: ${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
19+
test-expired-token: ${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
20+
test-reusable-token: ${{ secrets.TEST_REUSABLE_TOKEN }} >> .env

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

Lines changed: 49 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ on:
33
workflow_call:
44
inputs:
55
ref:
6-
description: 'Git reference to use (e.g., main or branch name)'
6+
description: "Git reference to use (e.g., main or branch name)"
77
required: true
88
type: string
99

10-
is-internal:
11-
description: 'Flag for internal release'
12-
required: true
13-
type: boolean
14-
1510
server-id:
16-
description: 'Id of the repository'
11+
description: "Id of the repository"
1712
required: true
1813
type: string
19-
14+
2015
profile:
21-
description: 'Profile to pick from pom.xml'
16+
description: "Profile to pick from pom.xml"
17+
required: true
18+
type: string
19+
20+
tag:
21+
description: 'Release Tag'
2222
required: true
2323
type: string
2424
secrets:
@@ -34,25 +34,46 @@ on:
3434
gpg-passphrase:
3535
required: true
3636

37+
skyflow-credentials:
38+
required: true
39+
40+
test-expired-token:
41+
required: true
42+
43+
test-reusable-token:
44+
required: true
45+
3746
jobs:
3847
publish:
3948
runs-on: ubuntu-latest
4049
steps:
4150
- uses: actions/checkout@v2
4251
with:
43-
ref: ${{ inputs.ref }}
4452
fetch-depth: 0
4553

4654
- name: Set up maven or jfrog repository
4755
uses: actions/setup-java@v1
4856
with:
49-
java-version: '1.8'
50-
distribution: 'adopt'
57+
java-version: "1.8"
58+
distribution: "adopt"
5159
server-id: ${{ inputs.server-id }}
5260
server-username: SERVER_USERNAME
5361
server-password: SERVER_PASSWORD
5462
gpg-private-key: ${{ secrets.gpg-key }} # Value of the GPG private key to import
5563
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase
64+
65+
- name: Resolve Branch for the Tagged Commit
66+
id: resolve-branch
67+
if: ${{ inputs.tag == 'beta' || inputs.tag == 'public' }}
68+
run: |
69+
TAG_COMMIT=$(git rev-list -n 1 ${{ github.ref_name }})
70+
BRANCH_NAME=$(git branch -r --contains $TAG_COMMIT | grep -o 'origin/.*' | sed 's|origin/||' | head -n 1)
71+
if [ -z "$BRANCH_NAME" ]; then
72+
echo "Error: Could not resolve branch for the tag."
73+
exit 1
74+
fi
75+
echo "Resolved Branch Name: $BRANCH_NAME"
76+
echo "branch_name=$BRANCH_NAME" >> $GITHUB_ENV
5677
5778
- name: Get Previous tag
5879
id: previoustag
@@ -63,7 +84,7 @@ jobs:
6384
- name: Bump Version
6485
run: |
6586
chmod +x ./scripts/bump_version.sh
66-
if ${{ inputs.is-internal }}; then
87+
if ${{ inputs.tag == 'internal' }}; then
6788
./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}" "$(git rev-parse --short "$GITHUB_SHA")"
6889
else
6990
./scripts/bump_version.sh "${{ steps.previoustag.outputs.tag }}"
@@ -73,22 +94,28 @@ jobs:
7394
run: |
7495
git config user.name ${{ github.actor }}
7596
git config user.email ${{ github.actor }}@users.noreply.github.com
97+
98+
if [[ "${{ inputs.tag }}" == "beta" || "${{ inputs.tag }}" == "public" ]]; then
99+
git checkout ${{ env.branch_name }}
100+
fi
101+
76102
git add pom.xml
77-
if ${{ inputs.is-internal }}; then
103+
if [[ "${{ inputs.tag }}" == "internal" ]]; then
78104
git commit -m "[AUTOMATED] Private Release ${{ steps.previoustag.outputs.tag }}-dev-$(git rev-parse --short $GITHUB_SHA)"
79105
git push origin ${{ github.ref_name }} -f
80-
else
106+
fi
107+
if [[ "${{ inputs.tag }}" == "beta" || "${{ inputs.tag }}" == "public" ]]; then
81108
git commit -m "[AUTOMATED] Public Release - ${{ steps.previoustag.outputs.tag }}"
82-
git push origin
109+
git push origin ${{ env.branch_name }}
83110
fi
84111
85112
- name: Create env
86-
if: ${{ inputs.is-internal }}
87113
id: create-env
88114
run: |
89115
touch .env
90-
echo SKYFLOW_CREDENTIALS=${{ secrets.SKYFLOW_CREDENTIALS }} >> .env
91-
echo TEST_EXPIRED_TOKEN=${{ secrets.TEST_EXPIRED_TOKEN }} >> .env
116+
echo SKYFLOW_CREDENTIALS=${{ secrets.skyflow-credentials }} >> .env
117+
echo TEST_EXPIRED_TOKEN=${{ secrets.test-expired-token }} >> .env
118+
echo TEST_REUSABLE_TOKEN=${{ secrets.test-reusable-token }} >> .env
92119
93120
- name: Create credentials json
94121
id: create-json
@@ -98,8 +125,9 @@ jobs:
98125
json: ${{ secrets.TEST_CREDENTIALS_FILE_STRING }}
99126

100127
- name: Publish package
101-
run: mvn clean deploy -P ${{ inputs.profile }}
128+
run: mvn --batch-mode deploy -P ${{ inputs.profile }}
129+
102130
env:
103131
SERVER_USERNAME: ${{ secrets.server-username }}
104132
SERVER_PASSWORD: ${{ secrets.server-password }}
105-
GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
133+
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

0 commit comments

Comments
 (0)