Skip to content

Commit ad4d0c9

Browse files
authored
Merge pull request #2 from ballerina-platform/initial-impl
Add basic test cases and workflows for the Moesif extension
2 parents 0732910 + 3c85cab commit ad4d0c9

23 files changed

+1217
-295
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ensure all Java files use LF.
2+
*.java eol=lf

.github/workflows/build-main.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- '**/.md'
9+
10+
workflow_dispatch:
11+
12+
jobs:
13+
call_workflow:
14+
name: Run Build Workflow
15+
if: ${{ github.repository_owner == 'ballerina-platform' }}
16+
uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main
17+
secrets: inherit
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Publish to the Ballerina central
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
type: choice
8+
description: Select environment
9+
required: true
10+
options:
11+
- CENTRAL
12+
- DEV CENTRAL
13+
- STAGE CENTRAL
14+
15+
jobs:
16+
call_workflow:
17+
name: Run Central Publish Workflow
18+
if: ${{ github.repository_owner == 'ballerina-platform' }}
19+
uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main
20+
secrets: inherit
21+
with:
22+
environment: ${{ github.event.inputs.environment }}

.github/workflows/fossa-scan.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Fossa Scan
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '30 18 * * *' # 00:00 in LK time (GMT+5:30)
6+
jobs:
7+
fossa-scan:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: fossas/fossa-action@main
12+
env:
13+
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
14+
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
15+
with:
16+
api-key: ${{secrets.FOSSA_APIKEY}}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: GraalVM Check
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
lang_tag:
7+
description: Branch/Release Tag of the Ballerina Lang
8+
required: true
9+
default: master
10+
lang_version:
11+
description: Ballerina Lang Version (If given ballerina lang buid will be skipped)
12+
required: false
13+
default: ''
14+
native_image_options:
15+
description: Default native-image options
16+
required: false
17+
default: ''
18+
schedule:
19+
- cron: '30 18 * * *'
20+
pull_request:
21+
branches:
22+
- master
23+
types: [opened, synchronize, reopened, labeled, unlabeled]
24+
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
call_stdlib_workflow:
31+
name: Run StdLib Workflow
32+
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
33+
uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main
34+
with:
35+
lang_tag: ${{ inputs.lang_tag }}
36+
lang_version: ${{ inputs.lang_version }}
37+
native_image_options: ${{ inputs.native_image_options }}
38+
additional_ubuntu_build_flags: '-x :ftp-compiler-plugin-tests:test'
39+
additional_windows_build_flags: '-x :ftp-compiler-plugin-tests:test'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Publish release
2+
3+
on:
4+
workflow_dispatch:
5+
repository_dispatch:
6+
types: [ stdlib-release-pipeline ]
7+
8+
jobs:
9+
call_workflow:
10+
name: Run Release Workflow
11+
if: ${{ github.repository_owner == 'ballerina-platform' }}
12+
uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main
13+
secrets: inherit
14+
with:
15+
package-name: ftp
16+
package-org: ballerina

.github/workflows/pull-request.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: PR Build
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
5+
cancel-in-progress: true
6+
7+
on: pull_request
8+
9+
jobs:
10+
call_workflow:
11+
name: Run PR Build Workflow
12+
if: ${{ github.repository_owner == 'ballerina-platform' }}
13+
uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main
14+
secrets: inherit

.github/workflows/trivy-scan.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Trivy
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '30 20 * * *'
7+
8+
jobs:
9+
call_workflow:
10+
name: Run Trivy Scan Workflow
11+
if: ${{ github.repository_owner == 'ballerina-platform' }}
12+
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main
13+
secrets: inherit

ballerina/Ballerina.toml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,68 +15,68 @@
1515
[package]
1616
org = "ballerinax"
1717
name = "moesif"
18-
version = "@toml.version@"
19-
distribution = "@ballerina.version@"
18+
version = "1.0.0"
19+
distribution = "2201.12.0"
2020

2121
[platform.java21]
2222
graalvmCompatible = true
2323

2424
[[platform.java21.dependency]]
25-
path = "../native/build/libs/moesif-extension-native-@project.version@.jar"
25+
path = "../native/build/libs/moesif-extension-native-1.0.0-SNAPSHOT.jar"
2626
groupId = "ballerina"
2727
artifactId = "moesif-extension-native"
28-
version = "@project.version@"
28+
version = "1.0.0-SNAPSHOT"
2929

3030
[[platform.java21.dependency]]
31-
path = "./lib/opentelemetry-sdk-trace-@opentelemetrySDK.version@.jar"
31+
path = "./lib/opentelemetry-sdk-trace-1.32.0.jar"
3232
groupId = "io.opentelemetry"
3333
artifactId = "opentelemetry-sdk-trace"
34-
version = "@opentelemetrySDK.version@"
34+
version = "1.32.0"
3535

3636
[[platform.java21.dependency]]
37-
path = "./lib/opentelemetry-sdk-common-@opentelemetrySDK.version@.jar"
37+
path = "./lib/opentelemetry-sdk-common-1.32.0.jar"
3838
groupId = "io.opentelemetry"
3939
artifactId = "opentelemetry-sdk-common"
40-
version = "@opentelemetrySDK.version@"
40+
version = "1.32.0"
4141

4242
[[platform.java21.dependency]]
43-
path = "./lib/opentelemetry-semconv-@opentelemetrySemconv.version@.jar"
43+
path = "./lib/opentelemetry-semconv-1.21.0-alpha.jar"
4444
groupId = "io.opentelemetry.semconv"
4545
artifactId = "opentelemetry-semconv"
46-
version = "@opentelemetrySemconv.version@"
46+
version = "1.21.0-alpha"
4747

4848
[[platform.java21.dependency]]
49-
path = "./lib/opentelemetry-exporter-otlp-http-trace-@opentelemetryExporter.version@.jar"
49+
path = "./lib/opentelemetry-exporter-otlp-http-trace-1.14.0.jar"
5050
groupId = "io.opentelemetry"
5151
artifactId = "opentelemetry-exporter-otlp-http-trace"
52-
version = "@opentelemetryExporter.version@"
52+
version = "1.14.0"
5353

5454
[[platform.java21.dependency]]
55-
path = "./lib/opentelemetry-exporter-otlp-common-@opentelemetryExporter.version@.jar"
55+
path = "./lib/opentelemetry-exporter-otlp-common-1.14.0.jar"
5656
groupId = "io.opentelemetry"
5757
artifactId = "opentelemetry-exporter-otlp-common"
58-
version = "@opentelemetryExporter.version@"
58+
version = "1.14.0"
5959

6060
[[platform.java21.dependency]]
61-
path = "./lib/opentelemetry-extension-trace-propagators-@opentelemetry.version@.jar"
61+
path = "./lib/opentelemetry-extension-trace-propagators-1.32.0.jar"
6262
groupId = "io.opentelemetry"
6363
artifactId = "opentelemetry-extension-trace-propagators"
64-
version = "@opentelemetry.version@"
64+
version = "1.32.0"
6565

6666
[[platform.java21.dependency]]
67-
path = "./lib/okhttp-@okhttp.version@.jar"
67+
path = "./lib/okhttp-4.12.0.jar"
6868
groupId = "com.squareup.okhttp3"
6969
artifactId = "okhttp"
70-
version = "@okhttp.version@"
70+
version = "4.12.0"
7171

7272
[[platform.java21.dependency]]
73-
path = "./lib/kotlin-stdlib-@kotlin.version@.jar"
73+
path = "./lib/kotlin-stdlib-1.9.23.jar"
7474
groupId = "org.jetbrains.kotlin"
7575
artifactId = "kotlin-stdlib"
76-
version = "@kotlin.version@"
76+
version = "1.9.23"
7777

7878
[[platform.java21.dependency]]
79-
path = "./lib/okio-jvm-@okio.version@.jar"
79+
path = "./lib/okio-jvm-3.9.0.jar"
8080
groupId = "com.squareup.okio"
8181
artifactId = "okio"
82-
version = "@okio.version@"
82+
version = "3.9.0"

ballerina/Dependencies.toml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[ballerina]
77
dependencies-toml-version = "2"
8-
distribution-version = "2201.12.6"
8+
distribution-version = "2201.12.0"
99

1010
[[package]]
1111
org = "ballerina"
@@ -27,6 +27,41 @@ modules = [
2727
{org = "ballerina", packageName = "jballerina.java", moduleName = "jballerina.java"}
2828
]
2929

30+
[[package]]
31+
org = "ballerina"
32+
name = "lang.__internal"
33+
version = "0.0.0"
34+
scope = "testOnly"
35+
dependencies = [
36+
{org = "ballerina", name = "jballerina.java"},
37+
{org = "ballerina", name = "lang.object"}
38+
]
39+
40+
[[package]]
41+
org = "ballerina"
42+
name = "lang.array"
43+
version = "0.0.0"
44+
scope = "testOnly"
45+
dependencies = [
46+
{org = "ballerina", name = "jballerina.java"},
47+
{org = "ballerina", name = "lang.__internal"}
48+
]
49+
50+
[[package]]
51+
org = "ballerina"
52+
name = "lang.error"
53+
version = "0.0.0"
54+
scope = "testOnly"
55+
dependencies = [
56+
{org = "ballerina", name = "jballerina.java"}
57+
]
58+
59+
[[package]]
60+
org = "ballerina"
61+
name = "lang.object"
62+
version = "0.0.0"
63+
scope = "testOnly"
64+
3065
[[package]]
3166
org = "ballerina"
3267
name = "lang.value"
@@ -47,14 +82,29 @@ modules = [
4782
{org = "ballerina", packageName = "observe", moduleName = "observe.mockextension"}
4883
]
4984

85+
[[package]]
86+
org = "ballerina"
87+
name = "test"
88+
version = "0.0.0"
89+
scope = "testOnly"
90+
dependencies = [
91+
{org = "ballerina", name = "jballerina.java"},
92+
{org = "ballerina", name = "lang.array"},
93+
{org = "ballerina", name = "lang.error"}
94+
]
95+
modules = [
96+
{org = "ballerina", packageName = "test", moduleName = "test"}
97+
]
98+
5099
[[package]]
51100
org = "ballerinax"
52101
name = "moesif"
53102
version = "1.0.0"
54103
dependencies = [
55104
{org = "ballerina", name = "io"},
56105
{org = "ballerina", name = "jballerina.java"},
57-
{org = "ballerina", name = "observe"}
106+
{org = "ballerina", name = "observe"},
107+
{org = "ballerina", name = "test"}
58108
]
59109
modules = [
60110
{org = "ballerinax", packageName = "moesif", moduleName = "moesif"}

0 commit comments

Comments
 (0)