Skip to content

Commit 64fbe4e

Browse files
committed
`Merge branch 'nytian/exception-provider-middleware' of https://github.com/microsoft/durabletask-java into nytian/exception-provider-middleware
2 parents f09ee78 + 1e93b17 commit 64fbe4e

6 files changed

Lines changed: 78 additions & 21 deletions

File tree

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
groups:
6+
github-actions:
7+
patterns: ["*"]
8+
schedule:
9+
interval: "weekly"
10+
cooldown:
11+
default-days: 7

.github/workflows/build-validation.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ jobs:
2323
runs-on: ubuntu-latest
2424

2525
steps:
26-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2.8.0
2727

2828
- name: Set up JDK 11
29-
uses: actions/setup-java@v4
29+
uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1
3030
with:
3131
java-version: '11'
3232
distribution: 'microsoft'
3333

3434
- name: Setup Gradle
35-
uses: gradle/gradle-build-action@v2
35+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
3636

3737
- name: Build with Gradle
3838
run: ./gradlew build -x test
@@ -42,7 +42,7 @@ jobs:
4242
continue-on-error: false
4343

4444
- name: Upload SpotBugs reports
45-
uses: actions/upload-artifact@v4
45+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4646
with:
4747
name: SpotBugs Reports
4848
path: '**/build/reports/spotbugs'
@@ -54,7 +54,7 @@ jobs:
5454

5555
- name: Upload test reports if tests failed
5656
if: env.UNIT_TEST_FAILED == 'true'
57-
uses: actions/upload-artifact@v4
57+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
5858
with:
5959
name: Unit Test Reports
6060
path: '**/build/reports/tests/test'
@@ -131,27 +131,27 @@ jobs:
131131

132132
- name: Upload Durable Task Emulator Logs
133133
if: always()
134-
uses: actions/upload-artifact@v4
134+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
135135
with:
136136
name: Durable Task Emulator Logs
137137
path: durabletask-emulator.log
138138

139139
- name: Archive test report
140-
uses: actions/upload-artifact@v4
140+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
141141
with:
142142
name: Integration test report
143143
path: client/build/reports/tests/integrationTest
144144

145145
- name: Archive export history integration test report
146146
if: always()
147-
uses: actions/upload-artifact@v4
147+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
148148
with:
149149
name: Export history integration test report
150150
path: exporthistory/build/reports/tests/integrationTest
151151
if-no-files-found: ignore
152152

153153
- name: Upload JAR output
154-
uses: actions/upload-artifact@v4
154+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
155155
with:
156156
name: Package
157157
path: client/build/libs
@@ -166,16 +166,16 @@ jobs:
166166
runs-on: ubuntu-latest
167167

168168
steps:
169-
- uses: actions/checkout@v2
169+
- uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2.8.0
170170

171171
- name: Set up JDK 11
172-
uses: actions/setup-java@v4
172+
uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1
173173
with:
174174
java-version: '11'
175175
distribution: 'microsoft'
176176

177177
- name: Setup Gradle
178-
uses: gradle/gradle-build-action@v2
178+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
179179

180180
- name: Publish to local
181181
run: ./gradlew publishToMavenLocal -PskipSigning
@@ -189,12 +189,12 @@ jobs:
189189
shell: pwsh
190190

191191
- name: End to End Tests with Gradle
192-
uses: gradle/gradle-build-action@v2
192+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
193193
with:
194194
arguments: endToEndTest
195195

196196
- name: Archive test report
197-
uses: actions/upload-artifact@v4
197+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
198198
with:
199199
name: E2E test report
200200
path: endtoendtests/build/reports/tests/endToEndTest
@@ -205,16 +205,16 @@ jobs:
205205
runs-on: ubuntu-latest
206206

207207
steps:
208-
- uses: actions/checkout@v2
208+
- uses: actions/checkout@0717577d45739eb3c851188b29f50ed6c0b2194e # v2.8.0
209209

210210
- name: Set up JDK 11
211-
uses: actions/setup-java@v4
211+
uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1
212212
with:
213213
java-version: '11'
214214
distribution: 'microsoft'
215215

216216
- name: Setup Gradle
217-
uses: gradle/gradle-build-action@v2
217+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
218218

219219
- name: Publish to local
220220
run: ./gradlew publishToMavenLocal -PskipSigning
@@ -228,12 +228,12 @@ jobs:
228228
shell: pwsh
229229

230230
- name: Sample Tests with Gradle
231-
uses: gradle/gradle-build-action@v2
231+
uses: gradle/gradle-build-action@a8f75513eafdebd8141bd1cd4e30fcd194af8dfa # v2.12.0
232232
with:
233233
arguments: sampleTest
234234

235235
- name: Archive test report
236-
uses: actions/upload-artifact@v4
236+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
237237
with:
238238
name: Functions Sample test report
239239
path: samples-azure-functions/build/reports/tests/sampleTest

azdevops-pipeline/build-release-artifacts.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ steps:
2424
jdkArchitectureOption: 'x64'
2525
publishJUnitResults: false
2626
tasks: clean assemble
27+
options: '--init-script init.gradle'
2728
displayName: Assemble durabletask-client and durabletask-azure-functions
2829

2930
# the secring.gpg file is required to sign the artifacts, it's generated from GnuPG, and it's stored in the library of the durabletaskframework ADO
@@ -42,7 +43,7 @@ steps:
4243
jdkVersionOption: '$(jdkVersion)'
4344
jdkArchitectureOption: 'x64'
4445
tasks: publish
45-
options: '-Psigning.keyId=$(gpgSignKey) -Psigning.password=$(gpgSignPassword) -Psigning.secretKeyRingFile=$(gpgSecretFile.secureFilePath)'
46+
options: '--init-script init.gradle -Psigning.keyId=$(gpgSignKey) -Psigning.password=$(gpgSignPassword) -Psigning.secretKeyRingFile=$(gpgSecretFile.secureFilePath)'
4647
displayName: Publish durabletask-client and durabletask-azure-functions
4748

4849
- task: CopyFiles@2

eng/templates/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
jdkArchitectureOption: 'x64'
2525
publishJUnitResults: false
2626
tasks: clean assemble
27+
options: '--init-script init.gradle'
2728
displayName: Assemble durabletask-client and durabletask-azure-functions and durabletask-azuremanaged
2829

2930
# the secring.gpg file is required to sign the artifacts, it's generated from GnuPG, and it's stored in the library of the durabletaskframework ADO
@@ -42,7 +43,7 @@ jobs:
4243
jdkVersionOption: 1.11
4344
jdkArchitectureOption: 'x64'
4445
tasks: publish
45-
options: '-Psigning.keyId=$(gpgSignKey) -Psigning.password=$(gpgSignPassword) -Psigning.secretKeyRingFile=$(gpgSecretFile.secureFilePath)'
46+
options: '--init-script init.gradle -Psigning.keyId=$(gpgSignKey) -Psigning.password=$(gpgSignPassword) -Psigning.secretKeyRingFile=$(gpgSecretFile.secureFilePath)'
4647
displayName: Publish durabletask-client and durabletask-azure-functions and durabletask-azuremanaged
4748

4849
- task: CopyFiles@2

init.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
allprojects {
2+
def azfuncFeedUrl = 'https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/maven/v1'
3+
def azfuncFeedToken = System.getenv('AZURE_ARTIFACTS_ENV_ACCESS_TOKEN') ?: findProperty('vstsMavenAccessToken')
4+
repositories {
5+
maven {
6+
url azfuncFeedUrl
7+
if (azfuncFeedToken) {
8+
credentials {
9+
username 'Azure DevOps Services'
10+
password azfuncFeedToken
11+
}
12+
}
13+
}
14+
}
15+
// Keep only the Azure Artifacts feed (and MavenLocal); remove every other Maven repository so no
16+
// public repository can bypass the feed.
17+
afterEvaluate { proj ->
18+
def isNonFeedMaven = { repo ->
19+
repo instanceof MavenArtifactRepository &&
20+
repo.name != 'MavenLocal' &&
21+
!repo.url.toString().startsWith(azfuncFeedUrl)
22+
}
23+
proj.repositories.findAll(isNonFeedMaven).each { proj.repositories.remove(it) }
24+
proj.buildscript.repositories.findAll(isNonFeedMaven).each { proj.buildscript.repositories.remove(it) }
25+
}
26+
}

settings.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
pluginManagement {
2+
// Resolve plugins from the Azure Artifacts feed when its token is available; otherwise the public portal.
3+
def azfuncFeedToken = System.getenv('AZURE_ARTIFACTS_ENV_ACCESS_TOKEN') ?: providers.gradleProperty('vstsMavenAccessToken').orNull
4+
repositories {
5+
if (azfuncFeedToken) {
6+
maven {
7+
url 'https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/maven/v1'
8+
credentials {
9+
username 'Azure DevOps Services'
10+
password azfuncFeedToken
11+
}
12+
}
13+
} else {
14+
gradlePluginPortal()
15+
}
16+
}
17+
}
18+
119
rootProject.name = 'durabletask-java'
220

321
include ":client"

0 commit comments

Comments
 (0)