Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmos pipelines #16

Merged
merged 30 commits into from
Aug 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f336771
resolve merge conflict - tsconfig.json
HarshaNalluru Aug 20, 2019
5bb7d33
add cosmos in rush.json
HarshaNalluru Aug 20, 2019
1f638f4
update dependencies - sync-versions
HarshaNalluru Aug 20, 2019
0b6c87e
add script "extract-api"
HarshaNalluru Aug 20, 2019
a83e323
delete .prettierrc
HarshaNalluru Aug 20, 2019
7c626c9
update package.json script commands
HarshaNalluru Aug 20, 2019
6bab6ab
npm run bundle command
HarshaNalluru Aug 20, 2019
b5e300d
Fix typo in samples/package.json
HarshaNalluru Aug 20, 2019
28448f8
npm run clean command
HarshaNalluru Aug 20, 2019
1a191d4
remove unrelated file .gitattributes
HarshaNalluru Aug 20, 2019
866bf2a
Update package.json repo links
HarshaNalluru Aug 20, 2019
93fb2cc
add ci.yml from cosmos v2
HarshaNalluru Aug 20, 2019
2c11347
Node 6 to Node 8 - integration step
HarshaNalluru Aug 20, 2019
b2cce12
azure-cosmos-js -> azure-sdk-for-js
HarshaNalluru Aug 20, 2019
6c52c4a
Update License document
HarshaNalluru Aug 20, 2019
6ddd5b7
update tool chain from npm to rush
HarshaNalluru Aug 20, 2019
1f9d6fe
resolve merge conflicts with upstream/master
HarshaNalluru Aug 20, 2019
1b25b15
add package name
HarshaNalluru Aug 20, 2019
776a276
delete package-lock.json
HarshaNalluru Aug 20, 2019
9cbda2c
add cosmos-additional-steps.yml file
HarshaNalluru Aug 21, 2019
ce087b8
add PostIntegrationSteps variable
HarshaNalluru Aug 21, 2019
094cacd
merge upstream/master - resolve conflicts
HarshaNalluru Aug 21, 2019
cec7218
condition: succeededOrFailed() for additional steps
HarshaNalluru Aug 21, 2019
6d814a8
add parameters PackageName and PackagePath
HarshaNalluru Aug 21, 2019
6ec59b6
Smaller Matrix for Unit tests as per Daniel's idea
HarshaNalluru Aug 21, 2019
2feed5a
parameters - fix typo
HarshaNalluru Aug 21, 2019
78a13c1
merge upstream/master -> resolve merge conflicts
HarshaNalluru Aug 23, 2019
72889fe
regenerate pnpm-lock file
HarshaNalluru Aug 23, 2019
c5ff5ed
test:consumer -> test-consumer
HarshaNalluru Aug 23, 2019
3879972
remove matrix for unit-tests
HarshaNalluru Aug 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,20 @@ If you want to get back to a completely clean state, you can instead run `rush r

Generally speaking, the following commands are roughly equivalent:

| NPM command | Rush command | Rush command effect |
| ------------------------------------ | ------------------------------------ | ---------------------------------------------------------------- |
| `npm install` | `rush update` | Install dependencies for all projects in the Rush workspace |
| `npm install --save[-dev] <package>` | `rush add -p <package> --caret [--dev]` | Add or update a dependency in the current project |
| `npm build` | `rush [re]build` | Build all projects in the Rush workspace |
| | `rush [re]build -t <package>` | Build named project and any projects it depends on |
| | `rushx build` | Build the current project only |
| `npm test` | `rush test` | Run dev tests in all projects in the Rush workspace |
| | `rush test -t <packagename>` | Run dev tests in named project and any projects it depends on |
| | `rushx test` | Run dev tests in the current project only |
| `npm run <scriptname>` | `rush <scriptname>` | Run named script in all projects in the Rush workspace |
| | `rush <scriptname> -t <packagename>` | Run named script in named project and any projects it depends on |
| | `rushx <scriptname>` | Run named script in the current project only |
| `npx <command>` | `node_modules/.bin/<command>` | Run named command provided by installed dependency package |
| NPM command | Rush command | Rush command effect |
| ------------------------------------ | --------------------------------------- | ---------------------------------------------------------------- |
| `npm install` | `rush update` | Install dependencies for all projects in the Rush workspace |
| `npm install --save[-dev] <package>` | `rush add -p <package> --caret [--dev]` | Add or update a dependency in the current project |
| `npm build` | `rush [re]build` | Build all projects in the Rush workspace |
| | `rush [re]build -t <package>` | Build named project and any projects it depends on |
| | `rushx build` | Build the current project only |
| `npm test` | `rush test` | Run dev tests in all projects in the Rush workspace |
| | `rush test -t <packagename>` | Run dev tests in named project and any projects it depends on |
| | `rushx test` | Run dev tests in the current project only |
| `npm run <scriptname>` | `rush <scriptname>` | Run named script in all projects in the Rush workspace |
| | `rush <scriptname> -t <packagename>` | Run named script in named project and any projects it depends on |
| | `rushx <scriptname>` | Run named script in the current project only |
| `npx <command>` | `node_modules/.bin/<command>` | Run named command provided by installed dependency package |

## Onboarding a new library

Expand Down
13 changes: 13 additions & 0 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
"ignoreMissingScript": false,
"allowWarningsInSuccessfulBuild": true
},
{
"commandKind": "bulk",
"name": "build:samples",
"summary": "Build the samples only in projects",
"enableParallelism": true,
"allowWarningsInSuccessfulBuild": true
},
{
"commandKind": "bulk",
"name": "build:test",
Expand Down Expand Up @@ -100,6 +107,12 @@
"summary": "Execute browser dev tests defined in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "test-consumer",
"summary": "Execute consumer tests defined in projects",
"enableParallelism": true
},
{
"commandKind": "bulk",
"name": "test:node",
Expand Down
59 changes: 31 additions & 28 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
parameters:
Matrix:
Linux_Node8:
OSVmImage: "ubuntu-16.04"
NodeVersion: "8.x"
Linux_Node10:
OSVmImage: "ubuntu-16.04"
NodeVersion: "10.x"
Linux_Node12:
OSVmImage: "ubuntu-16.04"
NodeVersion: "12.x"
macOS_Node8:
OSVmImage: "macOS-10.13"
NodeVersion: "8.x"
macOS_Node10:
OSVmImage: "macOS-10.13"
NodeVersion: "10.x"
macOS_Node12:
OSVmImage: "macOS-10.13"
NodeVersion: "12.x"
Windows_Node8:
OSVmImage: "vs2017-win2016"
NodeVersion: "8.x"
Windows_Node10:
OSVmImage: "vs2017-win2016"
NodeVersion: "10.x"
Windows_Node12:
OSVmImage: "vs2017-win2016"
NodeVersion: "12.x"

jobs:
- job: "Build"
variables:
Expand Down Expand Up @@ -119,34 +149,7 @@ jobs:
- job: "UnitTest"

strategy:
matrix:
Linux_Node8:
OSVmImage: "ubuntu-16.04"
NodeVersion: "8.x"
Linux_Node10:
OSVmImage: "ubuntu-16.04"
NodeVersion: "10.x"
Linux_Node12:
OSVmImage: "ubuntu-16.04"
NodeVersion: "12.x"
macOS_Node8:
OSVmImage: "macOS-10.13"
NodeVersion: "8.x"
macOS_Node10:
OSVmImage: "macOS-10.13"
NodeVersion: "10.x"
macOS_Node12:
OSVmImage: "macOS-10.13"
NodeVersion: "12.x"
Windows_Node8:
OSVmImage: "vs2017-win2016"
NodeVersion: "8.x"
Windows_Node10:
OSVmImage: "vs2017-win2016"
NodeVersion: "10.x"
Windows_Node12:
OSVmImage: "vs2017-win2016"
NodeVersion: "12.x"
matrix: ${{parameters.Matrix}}

pool:
vmImage: "$(OSVmImage)"
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ parameters:
PackageName: "" # For Rush toolchain only
PackagePath: "" # For NPM toolchain only
PreIntegrationSteps: ""
PostIntegrationSteps: ""
EnvVars: []
MaxParallel: 0
Matrix:
Expand Down Expand Up @@ -58,6 +59,7 @@ jobs:
PackageName: ${{parameters.PackageName}}
PackagePath: ${{parameters.PackagePath}}
PreIntegrationSteps: ${{parameters.PreIntegrationSteps}}
PostIntegrationSteps: ${{parameters.PostIntegrationSteps}}
TestType: $(TestType)
EnvVars: ${{parameters.EnvVars}}

Expand Down
20 changes: 20 additions & 0 deletions eng/pipelines/templates/steps/cosmos-additional-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
parameters:
PackagePath: "sdk/cosmosdb/cosmos/"
PackageName: "@azure/cosmos"

steps:
- script: |
node common/scripts/install-run-rush.js test-consumer -t "${{parameters.PackageName}}" --verbose
condition: succeededOrFailed()
displayName: "TypeScript Consumer Tests - Cosmos"

- script: |
node common/scripts/install-run-rush.js build:samples -t "${{parameters.PackageName}}" --verbose
condition: succeededOrFailed()
displayName: "Typecheck Samples - Cosmos"

- script: |
npm run execute:samples
condition: succeededOrFailed()
displayName: "Run Samples - Cosmos"
workingDirectory: "${{parameters.PackagePath}}"
5 changes: 4 additions & 1 deletion eng/pipelines/templates/steps/integration-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ steps:
workingDirectory: "${{parameters.PackagePath}}"

- ${{if ne(parameters.PreIntegrationSteps, '')}}:
- template: ../steps/${{parameters.PreIntegrationSteps}}.yml
- template: ../steps/${{parameters.PreIntegrationSteps}}.yml

- script: |
npm run integration-test:${{parameters.TestType}}
displayName: "Integration test libraries"
workingDirectory: "${{parameters.PackagePath}}"
env: ${{parameters.EnvVars}}

- ${{if ne(parameters.PostIntegrationSteps, '')}}:
- template: ../steps/${{parameters.PostIntegrationSteps}}.yml
5 changes: 4 additions & 1 deletion eng/pipelines/templates/steps/integration-rush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ steps:
displayName: "Build test assets"

- ${{if ne(parameters.PreIntegrationSteps, '')}}:
- template: ../steps/${{parameters.PreIntegrationSteps}}.yml
- template: ../steps/${{parameters.PreIntegrationSteps}}.yml

- script: |
node common/scripts/install-run-rush.js integration-test:${{parameters.TestType}} -t "${{parameters.PackageName}}" --verbose
displayName: "Integration test libraries"
env: ${{parameters.EnvVars}}

- ${{if ne(parameters.PostIntegrationSteps, '')}}:
- template: ../steps/${{parameters.PostIntegrationSteps}}.yml
44 changes: 44 additions & 0 deletions sdk/cosmosdb/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# DO NOT EDIT THIS FILE
# This file is generated automatically and any changes will be lost.

trigger:
branches:
include:
- master
- feature/*
paths:
include:
- sdk/cosmosdb/

pr:
branches:
include:
- master
- feature/*
paths:
include:
- sdk/cosmosdb/

jobs:
- template: ../../eng/pipelines/templates/jobs/archetype-sdk-client.yml
parameters:
# Unit-tests are being skipped. So, matrix is not needed.
Matrix: {}
ServiceDirectory: cosmosdb

- template: ../../eng/pipelines/templates/jobs/archetype-sdk-integration.yml
parameters:
PackagePath: "sdk/cosmosdb/cosmos/"
PackageName: "@azure/cosmos"
Toolchain: rush
Matrix:
Windows_Node8:
OSVmImage: "vs2017-win2016"
NodeVersion: "8.x"
TestType: "node"
PreIntegrationSteps: cosmos-integration-public
PostIntegrationSteps: cosmos-additional-steps
EnvVars:
ACCOUNT_HOST: $(CosmosDbEmulator.Endpoint)
MOCHA_TIMEOUT: 100000
NODE_TLS_REJECT_UNAUTHORIZED: 0
1 change: 1 addition & 0 deletions sdk/cosmosdb/cosmos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm temp types *.tgz *.html *.log *.tsbuildinfo test/**/*.{js,js.map,d.ts}",
"docs": "typedoc --tsconfig ./src/tsconfig.json --excludePrivate --mode file --out ./dist/docs ./src",
"execute:samples": "cd samples && npm run all-samples",
"extract-api": "npm run build:src && api-extractor run --local",
"format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
Expand Down
3 changes: 2 additions & 1 deletion sdk/cosmosdb/cosmos/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"ItemManagement": "npx ts-node ./ItemManagement",
"DatabaseManagement": "npx ts-node ./DatabaseManagement",
"IndexManagement": "npx ts-node ./IndexManagement",
"ChangeFeed": "npx ts-node ./ChangeFeed"
"ChangeFeed": "npx ts-node ./ChangeFeed",
"all-samples": "npm run ContainerManagement && npm run UserManagement && npm run ServerSideScripts && npm run ItemManagement && npm run DatabaseManagement && npm run IndexManagement && npm run ChangeFeed"
}
}