Skip to content

Commit 8b144f7

Browse files
committed
Add compliance jobs
1 parent ace1fe9 commit 8b144f7

9 files changed

+124
-32
lines changed

.ado/android-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
8080
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
8181
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
82-
githubApiToken: $(githubApiToken)
82+
githubApiToken: $(githubAuthToken)
8383

8484
# In RN64 "clean" task tries to run the build again. It is reproing in 0.64-stable branch but fixed in 0.65-stable.
8585
# I can't zero on the exact cause .. but turns out the issue is with rntester clean task.

.ado/publish.yml

+35-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# It is expected that a `latestStableBranch` variable is set in the pipeline's settings:
2-
# https://dev.azure.com/ms/react-native/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=221
2+
# https://dev.azure.com/office/ISS/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=18541
33

44
# This file defines the build steps to publish a release
55
name: $(Date:yyyyMMdd).$(Rev:.r)
@@ -18,14 +18,23 @@ pr: none
1818

1919
variables:
2020
- template: variables/vars.yml
21+
- group: React-native-macos Secrets
22+
- group: InfoSec-SecurityResults
23+
- name: tags
24+
value: production,externalfacing
2125

2226
jobs:
2327
- job: RNGithubNpmJSPublish
2428
displayName: React-Native GitHub Publish to npmjs.org
2529
pool:
2630
vmImage: $(VmImageApple)
31+
variables:
32+
- name: BUILDSECMON_OPT_IN
33+
value: true
2734
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
2835
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
36+
dependsOn:
37+
- Compliance
2938
steps:
3039
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
3140
clean: true # whether to fetch clean each time
@@ -111,16 +120,18 @@ jobs:
111120
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
112121
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
113122
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
114-
githubApiToken: $(githubApiToken)
123+
githubApiToken: $(githubAuthToken)
115124
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))
116125

117126

118127
- job: RNMacOSInitNpmJSPublish
119128
displayName: react-native-macos-init Publish to npmjs.org
120-
pool: $(PoolUbuntu)
129+
pool: Azure-Pipelines-EO-Ubuntu20.04-Office
121130
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
122131
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
123132
condition: eq(variables['Build.SourceBranchName'], 'main')
133+
dependsOn:
134+
- Compliance
124135
steps:
125136
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
126137
clean: true # whether to fetch clean each time
@@ -145,6 +156,11 @@ jobs:
145156
cd packages/react-native-macos-init
146157
yarn build
147158
159+
- task: CmdLine@2
160+
displayName: Code tested in other pipeline [test]
161+
inputs:
162+
script: echo "This code is tested as part of an integration test. See the 'Verify react-native-macos-init' task."
163+
148164
- task: CmdLine@2
149165
displayName: "Publish react-native-macos-init to npmjs.org"
150166
inputs:
@@ -165,9 +181,11 @@ jobs:
165181

166182
- job: RNGithubOfficePublish
167183
displayName: React-Native GitHub Publish to Office
168-
pool: $(PoolUbuntu)
184+
pool: Azure-Pipelines-EO-Ubuntu20.04-Office
169185
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
170186
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
187+
dependsOn:
188+
- Compliance
171189
steps:
172190
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
173191
clean: true # whether to fetch clean each time
@@ -218,7 +236,7 @@ jobs:
218236
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
219237
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
220238
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
221-
githubApiToken: $(githubApiToken)
239+
githubApiToken: $(githubAuthToken)
222240

223241
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
224242
displayName: 📒 Generate Manifest
@@ -230,3 +248,15 @@ jobs:
230248
inputs:
231249
PathtoPublish: '$(Build.StagingDirectory)/final'
232250
ArtifactName: 'ReactNative-Final'
251+
252+
- job: Compliance
253+
displayName: React-Native GitHub Compliance pipeline
254+
pool: OE-OfficePublic
255+
timeoutInMinutes: 15 # how long to run the job before automatically cancelling
256+
steps:
257+
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
258+
clean: true # whether to fetch clean each time
259+
fetchDepth: 10 # the depth of commits to ask Git to fetch
260+
lfs: false # whether to download Git-LFS files
261+
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
262+
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch

.ado/templates/apple-job-javascript.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ steps:
1616
displayName: 'yarn install'
1717

1818
- task: CmdLine@2
19-
displayName: yarn test-ci
19+
displayName: yarn test-ci [test]
2020
inputs:
2121
script: 'yarn test-ci'
2222

.ado/templates/react-native-macos-init.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ steps:
9999
workingDirectory: $(Agent.BuildDirectory)/testcli
100100

101101
- task: CmdLine@2
102-
displayName: Run macos
102+
displayName: Run macos [test]
103103
inputs:
104104
script: npx react-native run-macos
105105
workingDirectory: $(Agent.BuildDirectory)/testcli

.config/CredScanSuppressions.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"tool": "Credential Scanner",
3+
"suppressions": [
4+
{
5+
"file": "keystores/debug.keystore",
6+
"_justification": "Debug key needed for android. Does not contain a particular secret"
7+
},
8+
{
9+
"file": "template/android/app/debug.keystore",
10+
"_justification": "Debug key needed for android. Does not contain a particular secret"
11+
},
12+
{
13+
"file": "packages/rn-tester/android/app/gradle.properties",
14+
"_justification": "Debug key needed for android. Does not contain a particular secret"
15+
},
16+
{
17+
"file": "packages/rn-tester/android/app/my-release-key.keystore",
18+
"_justification": "Debug key needed for android. Does not contain a particular secret"
19+
}
20+
]
21+
}

GuardianCustomConfiguration.json

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"Enabled": true,
3+
"Tools": {
4+
"CredScan": {
5+
"Enabled": true,
6+
"Inputs": {
7+
"SuppressionsPath": ".config\\CredScanSuppressions.json"
8+
}
9+
},
10+
"ESLint": {
11+
"Enabled": true,
12+
"Inputs": {
13+
"Configuration": "required",
14+
"Parser": "@typescript-eslint/parser",
15+
"ParserOptions": "",
16+
"EnableExclusions": true,
17+
"ExclusionPatterns": "*.js",
18+
"_justification": "js files in this repo are flow files. the built-in eslint does not support this. Adding a separate step to run the sdl rules for flow files."
19+
}
20+
}
21+
}
22+
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
"eslint-plugin-jest": "22.4.1",
150150
"eslint-plugin-jsx-a11y": "6.2.1",
151151
"eslint-plugin-prettier": "2.6.2",
152-
"eslint-plugin-react": "7.21.5",
152+
"eslint-plugin-react": "7.28.0",
153153
"eslint-plugin-react-hooks": "^4.2.0",
154154
"eslint-plugin-react-native": "3.10.0",
155155
"eslint-plugin-relay": "1.8.1",
@@ -209,4 +209,4 @@
209209
"beachball": {
210210
"shouldPublish": false
211211
}
212-
}
212+
}

repo-config/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"eslint-plugin-jest": "22.4.1",
3333
"eslint-plugin-jsx-a11y": "6.2.1",
3434
"eslint-plugin-prettier": "2.6.2",
35-
"eslint-plugin-react": "7.21.5",
35+
"eslint-plugin-react": "7.28.0",
3636
"eslint-plugin-react-hooks": "^4.2.0",
3737
"eslint-plugin-react-native": "3.10.0",
3838
"eslint-plugin-relay": "1.8.1",

yarn.lock

+40-21
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ array-filter@~0.0.0:
17811781
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
17821782
integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw=
17831783

1784-
array-includes@^3.0.3, array-includes@^3.1.1, array-includes@^3.1.3:
1784+
array-includes@^3.0.3, array-includes@^3.1.1, array-includes@^3.1.3, array-includes@^3.1.4:
17851785
version "3.1.4"
17861786
resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9"
17871787
integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==
@@ -1832,7 +1832,7 @@ array-unique@^0.3.2:
18321832
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
18331833
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=
18341834

1835-
array.prototype.flatmap@^1.2.3:
1835+
array.prototype.flatmap@^1.2.5:
18361836
version "1.2.5"
18371837
resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446"
18381838
integrity sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA==
@@ -3428,22 +3428,25 @@ [email protected]:
34283428
"@babel/traverse" "^7.7.4"
34293429
eslint-plugin-react-native-globals "^0.1.1"
34303430

3431-
eslint-plugin-react@7.21.5:
3432-
version "7.21.5"
3433-
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz#50b21a412b9574bfe05b21db176e8b7b3b15bff3"
3434-
integrity sha512-8MaEggC2et0wSF6bUeywF7qQ46ER81irOdWS4QWxnnlAEsnzeBevk1sWh7fhpCghPpXb+8Ks7hvaft6L/xsR6g==
3431+
eslint-plugin-react@7.28.0:
3432+
version "7.28.0"
3433+
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf"
3434+
integrity sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw==
34353435
dependencies:
3436-
array-includes "^3.1.1"
3437-
array.prototype.flatmap "^1.2.3"
3436+
array-includes "^3.1.4"
3437+
array.prototype.flatmap "^1.2.5"
34383438
doctrine "^2.1.0"
3439-
has "^1.0.3"
3439+
estraverse "^5.3.0"
34403440
jsx-ast-utils "^2.4.1 || ^3.0.0"
3441-
object.entries "^1.1.2"
3442-
object.fromentries "^2.0.2"
3443-
object.values "^1.1.1"
3441+
minimatch "^3.0.4"
3442+
object.entries "^1.1.5"
3443+
object.fromentries "^2.0.5"
3444+
object.hasown "^1.1.0"
3445+
object.values "^1.1.5"
34443446
prop-types "^15.7.2"
3445-
resolve "^1.18.1"
3446-
string.prototype.matchall "^4.0.2"
3447+
resolve "^2.0.0-next.3"
3448+
semver "^6.3.0"
3449+
string.prototype.matchall "^4.0.6"
34473450

34483451
34493452
version "1.8.1"
@@ -3565,7 +3568,7 @@ estraverse@^4.1.1:
35653568
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
35663569
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==
35673570

3568-
estraverse@^5.1.0, estraverse@^5.2.0:
3571+
estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0:
35693572
version "5.3.0"
35703573
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
35713574
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
@@ -4598,7 +4601,7 @@ is-ci@^2.0.0:
45984601
dependencies:
45994602
ci-info "^2.0.0"
46004603

4601-
is-core-module@^2.8.0, is-core-module@^2.8.1:
4604+
is-core-module@^2.2.0, is-core-module@^2.8.0, is-core-module@^2.8.1:
46024605
version "2.8.1"
46034606
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211"
46044607
integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==
@@ -6610,7 +6613,7 @@ object.defaults@^1.0.0:
66106613
for-own "^1.0.0"
66116614
isobject "^3.0.0"
66126615

6613-
object.entries@^1.1.2:
6616+
object.entries@^1.1.5:
66146617
version "1.1.5"
66156618
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861"
66166619
integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==
@@ -6619,7 +6622,7 @@ object.entries@^1.1.2:
66196622
define-properties "^1.1.3"
66206623
es-abstract "^1.19.1"
66216624

6622-
object.fromentries@^2.0.2:
6625+
object.fromentries@^2.0.5:
66236626
version "2.0.5"
66246627
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251"
66256628
integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==
@@ -6628,6 +6631,14 @@ object.fromentries@^2.0.2:
66286631
define-properties "^1.1.3"
66296632
es-abstract "^1.19.1"
66306633

6634+
object.hasown@^1.1.0:
6635+
version "1.1.0"
6636+
resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.0.tgz#7232ed266f34d197d15cac5880232f7a4790afe5"
6637+
integrity sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==
6638+
dependencies:
6639+
define-properties "^1.1.3"
6640+
es-abstract "^1.19.1"
6641+
66316642
object.pick@^1.3.0:
66326643
version "1.3.0"
66336644
resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
@@ -6643,7 +6654,7 @@ object.reduce@^1.0.0:
66436654
for-own "^1.0.0"
66446655
make-iterator "^1.0.0"
66456656

6646-
object.values@^1.1.1:
6657+
object.values@^1.1.5:
66476658
version "1.1.5"
66486659
resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac"
66496660
integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==
@@ -6907,7 +6918,7 @@ path-key@^3.0.0, path-key@^3.1.0:
69076918
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
69086919
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
69096920

6910-
path-parse@^1.0.7:
6921+
path-parse@^1.0.6, path-parse@^1.0.7:
69116922
version "1.0.7"
69126923
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
69136924
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
@@ -7462,6 +7473,14 @@ resolve@^1.8.1:
74627473
path-parse "^1.0.7"
74637474
supports-preserve-symlinks-flag "^1.0.0"
74647475

7476+
resolve@^2.0.0-next.3:
7477+
version "2.0.0-next.3"
7478+
resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46"
7479+
integrity sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==
7480+
dependencies:
7481+
is-core-module "^2.2.0"
7482+
path-parse "^1.0.6"
7483+
74657484
restore-cursor@^2.0.0:
74667485
version "2.0.0"
74677486
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
@@ -8090,7 +8109,7 @@ string-width@^4.1.0, string-width@^4.2.0:
80908109
is-fullwidth-code-point "^3.0.0"
80918110
strip-ansi "^6.0.1"
80928111

8093-
string.prototype.matchall@^4.0.2:
8112+
string.prototype.matchall@^4.0.6:
80948113
version "4.0.6"
80958114
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.6.tgz#5abb5dabc94c7b0ea2380f65ba610b3a544b15fa"
80968115
integrity sha512-6WgDX8HmQqvEd7J+G6VtAahhsQIssiZ8zl7zKh1VDMFyL3hRTJP4FTNA3RbIp2TOQ9AYNDcc7e3fH0Qbup+DBg==

0 commit comments

Comments
 (0)