Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into sm/better-project-error
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jun 10, 2024
2 parents d709d24 + 357ab59 commit c718a47
Show file tree
Hide file tree
Showing 190 changed files with 12,851 additions and 12,796 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@

module.exports = {
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license'],
rules: {},
root: true,
};
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ECCN: Open Source
#GUSINFO:Open Source,Open Source Workflow

# For more info on this file syntax:
# https://help.github.com/en/articles/about-code-owners

# These owners will be the default owners for everything in
# the repo.

* @forcedotcom/platform-cli
41 changes: 41 additions & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Bundle
on:
workflow_call:
inputs:
branch:
description: 'Set the branch to bundle core'
required: false
type: string
nodeVersion:
description: version of node to use. It's better to specify latest, lts/* or lts/-1 than to hardode numbers
type: string
default: lts/*
required: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Install esbuild Dependencies
run: |
yarn add -D esbuild@^0.19.5 esbuild-plugin-pino@^2.1.0 npm-dts@^1.3.12 esbuild-plugin-tsc@^0.4.0
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Update for Bundling
run: |
node scripts/updateForBundling.js
- name: Generate Bundle
run: |
yarn build
node scripts/build.js
- name: Post Bundling Update
run: |
node scripts/postBundlingUpdate.js
30 changes: 30 additions & 0 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: create-github-release

on:
push:
branches:
- main
- prerelease/**
tags-ignore:
- '*'
workflow_dispatch:
inputs:
prerelease:
type: string
description: 'Name to use for the prerelease: beta, dev, etc. NOTE: If this is already set in the package.json, it does not need to be passed in here.'

jobs:
release:
uses: salesforcecli/github-workflows/.github/workflows/create-github-release.yml@main
secrets: inherit
with:
prerelease: ${{ inputs.prerelease }}
# If this is a push event, we want to skip the release if there are no semantic commits
# However, if this is a manual release (workflow_dispatch), then we want to disable skip-on-empty
# This helps recover from forgetting to add semantic commits ('fix:', 'feat:', etc.)
skip-on-empty: ${{ github.event_name == 'push' }}
docs:
needs: release
if: github.ref_name == 'main'
uses: salesforcecli/github-workflows/.github/workflows/publishTypedoc.yml@main
secrets: inherit
55 changes: 55 additions & 0 deletions .github/workflows/esbuild-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: esbuild Compilation & npm Publish Workflow

on:
workflow_run:
workflows:
- create-github-release
types:
- completed
workflow_dispatch:
inputs:
branch:
description: 'Set the branch to use for automation tests'
type: string
required: false
default: 'main'
nodeVersion:
description: version of node to use. It's better to specify latest, lts/* or lts/-1 than to hardode numbers
type: string
default: lts/*
required: false

jobs:
build:
runs-on: ubuntu-latest
if: ${{ inputs.branch || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')}}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Install esbuild Dependencies
run: |
yarn add -D esbuild@^0.19.5 esbuild-plugin-pino@^2.1.0 npm-dts@^1.3.12 esbuild-plugin-tsc@^0.4.0
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: Update for Bundling
run: |
node scripts/updateForBundling.js
- name: Generate Bundle
run: |
yarn build
node scripts/build.js
- name: Post Bundling Update
run: |
node scripts/postBundlingUpdate.js
- name: Publish a Package
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 1 addition & 4 deletions .github/workflows/failureNotifications.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
name: failureNotifications

on:
workflow_run:
workflows:
- version, tag and github release
- publish
types:
- completed

jobs:
failure-notify:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Announce Failure
id: slack
uses: slackapi/slack-github-action@v1.21.0
uses: slackapi/slack-github-action@v1.24.0
env:
# for non-CLI-team-owned plugins, you can send this anywhere you like
SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }}
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/manualRelease.yml

This file was deleted.

18 changes: 0 additions & 18 deletions .github/workflows/onPushToMain.yml

This file was deleted.

18 changes: 15 additions & 3 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: publish

on:
release:
types: [released]
types: [published]
# support manual release in case something goes wrong and needs to be repeated or tested
workflow_dispatch:
inputs:
Expand All @@ -11,10 +11,22 @@ on:
type: string
required: true
jobs:
# parses the package.json version and detects prerelease tag (ex: beta from 4.4.4-beta.0)
getDistTag:
outputs:
tag: ${{ steps.distTag.outputs.tag }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name || inputs.tag }}
- uses: salesforcecli/github-workflows/.github/actions/getPreReleaseTag@main
id: distTag

npm:
uses: salesforcecli/github-workflows/.github/workflows/npmPublish.yml@main
needs: [getDistTag]
with:
tag: latest
ctc: true
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
secrets: inherit
44 changes: 44 additions & 0 deletions .github/workflows/perf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# runs some very-large-repo tests (for windows filesystem limits) and commits perf results for comparison
name: perf-tests
on:
push:
branches-ignore: [main, gh-pages]
workflow_dispatch:

# linux will finish ahead of windows, but prevent other branches/commits from hitting simultaneously
# since we're pushing git commits and there would be conflicts
concurrency: perf-test

jobs:
perf-tests:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
with:
ignore-scripts: true
- run: yarn build
- run: npm run test:perf | tee test/perf/output.txt

# Run `github-action-benchmark` action
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@5bbce78ef18edf5b96cb2d23e8d240b485f9dc4a
with:
name: Logger Benchmarks - ${{ matrix.os }}
tool: 'benchmarkjs'
output-file-path: test/perf/output.txt
comment-on-alert: true
# Push and deploy GitHub pages branch automatically
# this has a bug where it creates duplicate commits when summary-always and aut-push are both true
# summary-always: true
comment-always: true
benchmark-data-dir-path: perf-${{ runner.os}}
auto-push: true
github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
70 changes: 43 additions & 27 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,48 +14,64 @@ jobs:
windows-unit-tests:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/unitTestsWindows.yml@main
nuts:
xNuts:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/externalNut.yml@main
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest']
externalProjectGitUrl:
- https://github.com/salesforcecli/plugin-config
- https://github.com/salesforcecli/plugin-alias
- https://github.com/salesforcecli/plugin-apex
- https://github.com/salesforcecli/plugin-auth
- https://github.com/salesforcecli/plugin-community
- https://github.com/salesforcecli/plugin-custom-metadata
- https://github.com/salesforcecli/plugin-data
- https://github.com/salesforcecli/plugin-limits
- https://github.com/salesforcecli/plugin-schema
- https://github.com/salesforcecli/plugin-env
- https://github.com/salesforcecli/plugin-org
- https://github.com/salesforcecli/plugin-login
- https://github.com/salesforcecli/plugin-schema
- https://github.com/salesforcecli/plugin-settings
- https://github.com/salesforcecli/plugin-signups
- https://github.com/salesforcecli/plugin-templates
- https://github.com/salesforcecli/plugin-user
with:
packageName: '@salesforce/core'
externalProjectGitUrl: ${{ matrix.externalProjectGitUrl }}
command: 'yarn test:nuts'
os: ${{ matrix.os }}
useCache: false
postBuildCommands: 'shx rm -rf node_modules/jsforce/typings'
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/sf-plugins-core/node_modules/@salesforce/core'
preSwapCommands: 'yarn upgrade @jsforce/jsforce-node@latest; npx yarn-deduplicate; yarn install'
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/core/node_modules/@jsforce/jsforce-node shx rm -rf node_modules/@salesforce/sf-plugins-core/node_modules/@salesforce/core node_modules/@salesforce/cli-plugins-testkit/node_modules/@salesforce/core node_modules/@salesforce/source-tracking/node_modules/@salesforce/core node_modules/@salesforce/source-deploy-retrieve/node_modules/@salesforce/core node_modules/@salesforce/apex-node/node_modules/@salesforce/core'
secrets: inherit
# hidden until we fix source-testkit to better handle jwt
# deployRetrieveNuts:
# needs: unit-tests
# uses: salesforcecli/github-workflows/.github/workflows/externalNut.yml@main
# strategy:
# fail-fast: false
# matrix:
# os: ['windows-latest-16x', 'ubuntu-latest-16x']
# command:
# - yarn test:nuts:deploy:metadata:manifest
# - yarn test:nuts:deploy:metadata:metadata
# - yarn test:nuts:deploy:metadata:source-dir
# - yarn test:nuts:deploy:metadata:test-level
# - yarn test:nuts:static
# with:
# packageName: '@salesforce/core'
# externalProjectGitUrl: 'https://github.com/salesforcecli/plugin-deploy-retrieve'
# command: ${{ matrix.command }}
# os: ${{ matrix.os }}
# secrets: inherit
pdrNuts:
needs: linux-unit-tests
uses: salesforcecli/github-workflows/.github/workflows/externalNut.yml@main
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'windows-latest']
command:
- 'yarn test:nuts:convert'
- 'yarn test:nuts:deb'
- 'yarn test:nuts:delete'
- 'yarn test:nuts:deploy:metadata:manifest'
- 'yarn test:nuts:deploy:metadata:metadata'
- 'yarn test:nuts:deploy:metadata:metadata-dir'
- 'yarn test:nuts:deploy:metadata:source-dir'
- 'yarn test:nuts:deploy:metadata:test-level'
- 'yarn test:nuts:destructive'
- 'yarn test:nuts:manifest'
- 'yarn test:nuts:retrieve'
- 'yarn test:nuts:specialTypes'
- 'yarn test:nuts:static'
- 'yarn test:nuts:tracking'
with:
packageName: '@salesforce/core'
externalProjectGitUrl: 'https://github.com/salesforcecli/plugin-deploy-retrieve'
preSwapCommands: 'yarn upgrade @jsforce/jsforce-node@latest; npx yarn-deduplicate; yarn install'
command: ${{ matrix.command }}
os: ${{ matrix.os }}
preExternalBuildCommands: 'shx rm -rf node_modules/@salesforce/core/node_modules/@jsforce/jsforce-node shx rm -rf node_modules/@salesforce/sf-plugins-core/node_modules/@salesforce/core node_modules/@salesforce/cli-plugins-testkit/node_modules/@salesforce/core node_modules/@salesforce/source-tracking/node_modules/@salesforce/core node_modules/@salesforce/source-deploy-retrieve/node_modules/@salesforce/core'
secrets:
TESTKIT_AUTH_URL: ${{ secrets.TESTKIT_AUTH_URL }}
Loading

2 comments on commit c718a47

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: c718a47 Previous: 4e697cd Ratio
Child logger creation 466722 ops/sec (±1.70%) 469254 ops/sec (±0.57%) 1.01
Logging a string on root logger 800875 ops/sec (±6.47%) 831676 ops/sec (±8.24%) 1.04
Logging an object on root logger 633821 ops/sec (±6.44%) 624083 ops/sec (±8.95%) 0.98
Logging an object with a message on root logger 5688 ops/sec (±216.73%) 3277 ops/sec (±234.93%) 0.58
Logging an object with a redacted prop on root logger 465532 ops/sec (±8.87%) 428759 ops/sec (±9.65%) 0.92
Logging a nested 3-level object on root logger 354677 ops/sec (±7.84%) 390398 ops/sec (±8.03%) 1.10

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: c718a47 Previous: 4e697cd Ratio
Child logger creation 313947 ops/sec (±3.60%) 329984 ops/sec (±0.78%) 1.05
Logging a string on root logger 718456 ops/sec (±7.47%) 801521 ops/sec (±5.09%) 1.12
Logging an object on root logger 566318 ops/sec (±7.69%) 565751 ops/sec (±9.07%) 1.00
Logging an object with a message on root logger 10898 ops/sec (±190.01%) 6053 ops/sec (±205.20%) 0.56
Logging an object with a redacted prop on root logger 439354 ops/sec (±11.93%) 421431 ops/sec (±11.19%) 0.96
Logging a nested 3-level object on root logger 331882 ops/sec (±5.25%) 327142 ops/sec (±5.44%) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.