Skip to content

Commit

Permalink
Merge pull request facebook#1067 from dannyvv/pr/Backport
Browse files Browse the repository at this point in the history
[0.66] Backport adding compliance jobs
  • Loading branch information
dannyvv authored Mar 4, 2022
2 parents c9b8f9d + 132475d commit 9994b28
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .ado/android-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)
githubApiToken: $(githubAuthToken)

# In RN64 "clean" task tries to run the build again. It is reproing in 0.64-stable branch but fixed in 0.65-stable.
# I can't zero on the exact cause .. but turns out the issue is with rntester clean task.
Expand Down
44 changes: 36 additions & 8 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# It is expected that a `latestStableBranch` variable is set in the pipeline's settings:
# https://dev.azure.com/ms/react-native/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=221
# https://dev.azure.com/office/ISS/_apps/hub/ms.vss-build-web.ci-designer-hub?pipelineId=18541

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

variables:
- template: variables/mac.yml
- group: React-native-macos Secrets
- group: InfoSec-SecurityResults
- name: tags
value: production,externalfacing

jobs:
- job: RNGithubNpmJSPublish
displayName: React-Native GitHub Publish to npmjs.org
pool:
vmImage: $(VmImage)
variables:
- name: BUILDSECMON_OPT_IN
value: true
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
dependsOn:
- Compliance
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # whether to fetch clean each time
Expand Down Expand Up @@ -100,17 +109,18 @@ jobs:
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)
githubApiToken: $(githubAuthToken)
condition: and(succeeded(), ne(variables['Build.SourceBranchName'], 'main'))


- job: RNMacOSInitNpmJSPublish
displayName: react-native-macos-init Publish to npmjs.org
pool:
vmImage: vs2017-win2016
pool: OE-OfficePublic
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
condition: eq(variables['Build.SourceBranchName'], 'main')
dependsOn:
- Compliance
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # whether to fetch clean each time
Expand All @@ -135,6 +145,11 @@ jobs:
cd packages/react-native-macos-init
yarn build
- task: CmdLine@2
displayName: Code tested in other pipeline [test]
inputs:
script: echo "This code is tested as part of an integration test. See the 'Verify react-native-macos-init' task."

- task: CmdLine@2
displayName: "Publish react-native-macos-init to npmjs.org"
inputs:
Expand All @@ -143,10 +158,11 @@ jobs:
- job: RNGithubOfficePublish
displayName: React-Native GitHub Publish to Office
pool:
vmImage: ubuntu-18.04
pool: Azure-Pipelines-EO-Ubuntu18.04-Office
timeoutInMinutes: 90 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
dependsOn:
- Compliance
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # whether to fetch clean each time
Expand Down Expand Up @@ -197,10 +213,22 @@ jobs:
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)
githubApiToken: $(githubAuthToken)

- task: PublishBuildArtifacts@1
displayName: 'Publish final artifacts'
inputs:
PathtoPublish: '$(Build.StagingDirectory)/final'
ArtifactName: 'ReactNative-Final'
ArtifactName: 'ReactNative-Final'

- job: Compliance
displayName: React-Native GitHub Compliance pipeline
pool: OE-OfficePublic
timeoutInMinutes: 15 # how long to run the job before automatically cancelling
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: true # whether to fetch clean each time
fetchDepth: 10 # the depth of commits to ask Git to fetch
lfs: false # whether to download Git-LFS files
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: true # set to 'true' to leave the OAuth token in the Git config after the initial fetch
2 changes: 1 addition & 1 deletion .ado/templates/apple-job-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
displayName: 'yarn install'

- task: CmdLine@2
displayName: yarn test-ci
displayName: yarn test-ci [test]
inputs:
script: 'yarn test-ci'

Expand Down
2 changes: 1 addition & 1 deletion .ado/templates/react-native-macos-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ steps:
workingDirectory: $(Agent.BuildDirectory)/testcli

- task: CmdLine@2
displayName: Run macos
displayName: Run macos [test]
inputs:
script: npx react-native run-macos
workingDirectory: $(Agent.BuildDirectory)/testcli
2 changes: 1 addition & 1 deletion .ado/variables/mac.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
variables:
VmImage: macOS-10.15
slice_name: 'Xcode_12_4'
xcode_version: '/Applications/Xcode_12.4.app'
xcode_version: '/Applications/Xcode_12.4.app'
21 changes: 21 additions & 0 deletions .config/CredScanSuppressions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"tool": "Credential Scanner",
"suppressions": [
{
"file": "keystores/debug.keystore",
"_justification": "Debug key needed for android. Does not contain a particular secret"
},
{
"file": "template/android/app/debug.keystore",
"_justification": "Debug key needed for android. Does not contain a particular secret"
},
{
"file": "packages/rn-tester/android/app/gradle.properties",
"_justification": "Debug key needed for android. Does not contain a particular secret"
},
{
"file": "packages/rn-tester/android/app/my-release-key.keystore",
"_justification": "Debug key needed for android. Does not contain a particular secret"
}
]
}
22 changes: 22 additions & 0 deletions GuardianCustomConfiguration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"Enabled": true,
"Tools": {
"CredScan": {
"Enabled": true,
"Inputs": {
"SuppressionsPath": ".config\\CredScanSuppressions.json"
}
},
"ESLint": {
"Enabled": true,
"Inputs": {
"Configuration": "required",
"Parser": "@typescript-eslint/parser",
"ParserOptions": "",
"EnableExclusions": true,
"ExclusionPatterns": "*.js",
"_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."
}
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"eslint-plugin-jest": "22.4.1",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "2.6.2",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "3.10.0",
"eslint-plugin-relay": "1.8.1",
Expand Down Expand Up @@ -211,4 +211,4 @@
"beachball": {
"shouldPublish": false
}
}
}
2 changes: 1 addition & 1 deletion repo-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"eslint-plugin-jest": "22.4.1",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-prettier": "2.6.2",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react": "7.28.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "3.10.0",
"eslint-plugin-relay": "1.8.1",
Expand Down
61 changes: 40 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ array-filter@~0.0.0:
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw=

array-includes@^3.0.3, array-includes@^3.1.1, array-includes@^3.1.3:
array-includes@^3.0.3, array-includes@^3.1.1, array-includes@^3.1.3, array-includes@^3.1.4:
version "3.1.4"
resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.4.tgz#f5b493162c760f3539631f005ba2bb46acb45ba9"
integrity sha512-ZTNSQkmWumEbiHO2GF4GmWxYVTiQyJy2XOTa15sdQSrvKn7l+180egQMqlrMOUMCyLMD7pmyQe4mMDUT6Behrw==
Expand Down Expand Up @@ -1832,7 +1832,7 @@ array-unique@^0.3.2:
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=

array.prototype.flatmap@^1.2.3:
array.prototype.flatmap@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.5.tgz#908dc82d8a406930fdf38598d51e7411d18d4446"
integrity sha512-08u6rVyi1Lj7oqWbS9nUxliETrtIROT4XGTA4D/LWGten6E3ocm7cy9SIrmNHOL5XVbVuckUp3X6Xyg8/zpvHA==
Expand Down Expand Up @@ -3428,22 +3428,25 @@ eslint-plugin-react-native@3.10.0:
"@babel/traverse" "^7.7.4"
eslint-plugin-react-native-globals "^0.1.1"

eslint-plugin-react@7.21.5:
version "7.21.5"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.21.5.tgz#50b21a412b9574bfe05b21db176e8b7b3b15bff3"
integrity sha512-8MaEggC2et0wSF6bUeywF7qQ46ER81irOdWS4QWxnnlAEsnzeBevk1sWh7fhpCghPpXb+8Ks7hvaft6L/xsR6g==
eslint-plugin-react@7.28.0:
version "7.28.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.28.0.tgz#8f3ff450677571a659ce76efc6d80b6a525adbdf"
integrity sha512-IOlFIRHzWfEQQKcAD4iyYDndHwTQiCMcJVJjxempf203jnNLUnW34AXLrV33+nEXoifJE2ZEGmcjKPL8957eSw==
dependencies:
array-includes "^3.1.1"
array.prototype.flatmap "^1.2.3"
array-includes "^3.1.4"
array.prototype.flatmap "^1.2.5"
doctrine "^2.1.0"
has "^1.0.3"
estraverse "^5.3.0"
jsx-ast-utils "^2.4.1 || ^3.0.0"
object.entries "^1.1.2"
object.fromentries "^2.0.2"
object.values "^1.1.1"
minimatch "^3.0.4"
object.entries "^1.1.5"
object.fromentries "^2.0.5"
object.hasown "^1.1.0"
object.values "^1.1.5"
prop-types "^15.7.2"
resolve "^1.18.1"
string.prototype.matchall "^4.0.2"
resolve "^2.0.0-next.3"
semver "^6.3.0"
string.prototype.matchall "^4.0.6"

eslint-plugin-relay@1.8.1:
version "1.8.1"
Expand Down Expand Up @@ -3565,7 +3568,7 @@ estraverse@^4.1.1:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d"
integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==

estraverse@^5.1.0, estraverse@^5.2.0:
estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
Expand Down Expand Up @@ -4593,7 +4596,7 @@ is-ci@^2.0.0:
dependencies:
ci-info "^2.0.0"

is-core-module@^2.8.0, is-core-module@^2.8.1:
is-core-module@^2.2.0, is-core-module@^2.8.0, is-core-module@^2.8.1:
version "2.8.1"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211"
integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==
Expand Down Expand Up @@ -6605,7 +6608,7 @@ object.defaults@^1.0.0:
for-own "^1.0.0"
isobject "^3.0.0"

object.entries@^1.1.2:
object.entries@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861"
integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==
Expand All @@ -6614,7 +6617,7 @@ object.entries@^1.1.2:
define-properties "^1.1.3"
es-abstract "^1.19.1"

object.fromentries@^2.0.2:
object.fromentries@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251"
integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==
Expand All @@ -6623,6 +6626,14 @@ object.fromentries@^2.0.2:
define-properties "^1.1.3"
es-abstract "^1.19.1"

object.hasown@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.0.tgz#7232ed266f34d197d15cac5880232f7a4790afe5"
integrity sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==
dependencies:
define-properties "^1.1.3"
es-abstract "^1.19.1"

object.pick@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
Expand All @@ -6638,7 +6649,7 @@ object.reduce@^1.0.0:
for-own "^1.0.0"
make-iterator "^1.0.0"

object.values@^1.1.1:
object.values@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac"
integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==
Expand Down Expand Up @@ -6902,7 +6913,7 @@ path-key@^3.0.0, path-key@^3.1.0:
resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==

path-parse@^1.0.7:
path-parse@^1.0.6, path-parse@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
Expand Down Expand Up @@ -7457,6 +7468,14 @@ resolve@^1.8.1:
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"

resolve@^2.0.0-next.3:
version "2.0.0-next.3"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.3.tgz#d41016293d4a8586a39ca5d9b5f15cbea1f55e46"
integrity sha512-W8LucSynKUIDu9ylraa7ueVZ7hc0uAgJBxVsQSKOXOyle8a93qXhcz+XAXZ8bIq2d6i4Ehddn6Evt+0/UwKk6Q==
dependencies:
is-core-module "^2.2.0"
path-parse "^1.0.6"

restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
Expand Down Expand Up @@ -8085,7 +8104,7 @@ string-width@^4.1.0, string-width@^4.2.0:
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

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

0 comments on commit 9994b28

Please sign in to comment.