diff --git a/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml b/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml index 48b160c36..22edf105f 100644 --- a/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml +++ b/.github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml @@ -74,7 +74,7 @@ body: description: | What do you get from the command "sf plugins"? placeholder: | - Example: code-analyzer 5.0.0-beta.0 + Example: code-analyzer 5.0.0 validations: required: true - type: input diff --git a/.github/workflows/apply-npm-tag-to-version.yml b/.github/workflows/apply-npm-tag-to-version.yml index e5eb974d4..b31110d0b 100644 --- a/.github/workflows/apply-npm-tag-to-version.yml +++ b/.github/workflows/apply-npm-tag-to-version.yml @@ -8,13 +8,14 @@ on: type: choice options: - '@salesforce/plugin-code-analyzer' - - '@salesforce/sfdx-scanner' + # TODO: Remove after April Release + - '@salesforce/sfdx-scanner' tag_name: description: 'Tag Name (ex: latest):' required: true type: string version: - description: 'Version (ex: 4.8.0):' + description: 'Version (ex: 5.2.0):' required: true type: string confirm: diff --git a/.github/workflows/automated-release-tasks.yml b/.github/workflows/automated-release-tasks.yml index 726f0f49b..a747a3396 100644 --- a/.github/workflows/automated-release-tasks.yml +++ b/.github/workflows/automated-release-tasks.yml @@ -31,17 +31,22 @@ jobs: needs: verify-should-run if: ${{ needs.verify-should-run.outputs.should-run == 'true' }} steps: - - name: Invoke v5 beta workflow + - name: Invoke v5 workflow uses: actions/github-script@v6 with: github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }} + # TODO: remove inputs after April Release; will default to minor script: | await github.rest.actions.createWorkflowDispatch({ owner: context.repo.owner, repo: context.repo.repo, workflow_id: 'create-release-branch.yml', - ref: 'dev' + ref: 'dev', + inputs: { + "release-type": "patch" + } }); +# TODO: Remove this after last v4.x release in April create-v4-release-branch: runs-on: macos-latest needs: verify-should-run diff --git a/.github/workflows/create-release-branch.yml b/.github/workflows/create-release-branch.yml index 5f19a5f66..ae75ea78a 100644 --- a/.github/workflows/create-release-branch.yml +++ b/.github/workflows/create-release-branch.yml @@ -1,6 +1,17 @@ name: create-release-branch on: workflow_dispatch: + inputs: + # When the workflow is executed manually, the user can select whether the branch should correspond to a major, + # minor, or patch release. + release-type: + type: choice + description: What kind of release? + options: + - major + - minor + - patch + required: true jobs: create-release-branch: @@ -24,7 +35,15 @@ jobs: # Increment the version as desired locally, without actually committing anything. - name: Locally increment version run: | - npm --no-git-tag-version version prerelease --preid beta + # A workflow dispatch event lets the user specify what release type they want. + if [[ "${{ github.event_name }}" = "workflow_dispatch" ]]; then + RELEASE_TYPE=${{ github.event.inputs.release-type }} + # The regularly scheduled releases are always minor. + else + RELEASE_TYPE=minor + fi + # Increment the version as needed. + npm --no-git-tag-version version $RELEASE_TYPE # The branch protection rule for `release-x.y.z` branches prevents pushing commits directly. To work around this, # we create an interim branch that we _can_ push commits to, and we'll do our version bookkeeping in that branch # instead. diff --git a/.github/workflows/daily-smoke-tests-v4.yml b/.github/workflows/daily-smoke-tests-v4.yml new file mode 100644 index 000000000..284f4d2fa --- /dev/null +++ b/.github/workflows/daily-smoke-tests-v4.yml @@ -0,0 +1,29 @@ +#TODO: remove v4 with April Release +name: daily-smoke-tests-v4 +on: + workflow_dispatch: # As per documentation, the colon is necessary even though no config is required. + schedule: + # Cron syntax is "minute[0-59] hour[0-23] date[1-31] month[1-12] day[0-6]". '*' is 'any value,' and multiple values + # can be specified with comma-separated lists. All times are UTC. + # So this expression means "run at 13:30 UTC every day". This time was chosen because it corresponds to + # 8:30AM CDT, meaning that any issues will be surfaced before the start of business. + - cron: "30 13 * * *" +jobs: + smoke-test: + uses: ./.github/workflows/run-tests.yml + with: + node-matrix: "[{version: 'lts/*', artifact: 'lts'}, {version: 'latest', artifact: 'latest'}]" + v4-smoke-test: + runs-on: macos-latest + steps: + - name: Invoke v4 smoke tests + uses: actions/github-script@v6 + with: + github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'daily-smoke-tests.yml', + ref: 'dev-4' + }); diff --git a/.github/workflows/daily-smoke-tests.yml b/.github/workflows/daily-smoke-tests.yml index 16f0ada10..45b5aa8e0 100644 --- a/.github/workflows/daily-smoke-tests.yml +++ b/.github/workflows/daily-smoke-tests.yml @@ -1,6 +1,6 @@ name: daily-smoke-tests on: - workflow_dispatch: # As per documentation, the colon is necessary even though no config is required. + workflow_dispatch: schedule: # Cron syntax is "minute[0-59] hour[0-23] date[1-31] month[1-12] day[0-6]". '*' is 'any value,' and multiple values # can be specified with comma-separated lists. All times are UTC. @@ -9,20 +9,8 @@ on: - cron: "30 13 * * *" jobs: smoke-test: + # We run the daily smoke tests against 'dev' to validate that the code currently in development is still valid uses: ./.github/workflows/run-tests.yml with: node-matrix: "[{version: 'lts/*', artifact: 'lts'}, {version: 'latest', artifact: 'latest'}]" - v4-smoke-test: - runs-on: macos-latest - steps: - - name: Invoke v4 smoke tests - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }} - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'daily-smoke-tests.yml', - ref: 'dev-4' - }); + branch: dev diff --git a/.github/workflows/publish-to-npm.yml b/.github/workflows/publish-to-npm.yml index 9f530a71d..2954c4ef7 100644 --- a/.github/workflows/publish-to-npm.yml +++ b/.github/workflows/publish-to-npm.yml @@ -53,7 +53,7 @@ jobs: with: ctc: false # We've been told we don't have to care about this until someone makes us care. sign: true - tag: latest-beta-rc # Publish as a release candidate, so we can do our validations against it. + tag: latest-rc # Publish as a release candidate, so we can do our validations against it. githubTag: ${{ github.event.release.tag_name || inputs.tag }} secrets: inherit # Step 3: Run smoke tests against the release candidate. @@ -84,7 +84,7 @@ jobs: python-version: '>=3.10' # Install SF, and the release candidate version. - run: npm install -g @salesforce/cli - - run: sf plugins install @salesforce/plugin-code-analyzer@latest-beta-rc + - run: sf plugins install @salesforce/plugin-code-analyzer@latest-rc # Log the installed plugins for easier debugging. - run: sf plugins # Attempt to run the smoke tests. @@ -105,7 +105,6 @@ jobs: node-version: 'lts/*' - run: | echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc - npm dist-tag add @salesforce/plugin-code-analyzer@${{ github.event.release.tag_name || inputs.tag }} latest-beta npm dist-tag add @salesforce/plugin-code-analyzer@${{ github.event.release.tag_name || inputs.tag }} latest # Step 5: Create a Pull Request for merging `main` into `dev` create-main2dev-pull-request: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index f18485e84..7acb0a21c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -115,7 +115,7 @@ jobs: shell: bash run: | # We need to determine the Tarball's name first. - TARBALL_NAME=$(ls ~/downloads/tarball | grep salesforce-plugin-code-analyzer-5\\.0\\.0-beta\\.[0-9]*\\.tgz) + TARBALL_NAME=$(ls ~/downloads/tarball | grep salesforce-plugin-code-analyzer-.*\\.tgz) # We need to determine the Tarball's location in an installable way. # Get the path to the download folder. Swap out backslashes for forward slashes to ensure Windows compatibility. RAW_TARBALL_PATH=`echo '${{ steps.download.outputs.download-path }}' | tr '\\' '/'` @@ -130,4 +130,3 @@ jobs: with: name: smoke-test-results-${{ runner.os }}-node-${{ matrix.node.artifact }} path: smoke-test-results - diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index 2e1747677..6657b984a 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -6,6 +6,7 @@ on: jobs: # We want to prevent cross-contamination between the 4.x and 5.x pipelines. So we should prevent PRs # based on this flow to merge into `dev-4` or `main-4`. + # TODO: Remove this after the April release, since we won't care after that to maintain v4 verify_target_branch: runs-on: ubuntu-latest steps: diff --git a/messages/shared.md b/messages/shared.md index f5b76e129..efa624740 100644 --- a/messages/shared.md +++ b/messages/shared.md @@ -1,11 +1,3 @@ -# label.command-state - -Beta - -# warning.command-state - -This command is in %s. - # log.give-us-feedback We're continually improving Salesforce Code Analyzer. Tell us what you think! Give feedback at http://sfdc.co/CodeAnalyzerFeedback. diff --git a/src/commands/code-analyzer/config.ts b/src/commands/code-analyzer/config.ts index 43e2a0e04..d7dc16643 100644 --- a/src/commands/code-analyzer/config.ts +++ b/src/commands/code-analyzer/config.ts @@ -17,9 +17,6 @@ export default class ConfigCommand extends SfCommand implements Displayabl public static readonly description = getMessage(BundleName.ConfigCommand, 'command.description'); public static readonly examples = getMessages(BundleName.ConfigCommand, 'command.examples'); - // TODO: Remove when we go GA - public static readonly state = getMessage(BundleName.Shared, 'label.command-state'); - public static readonly flags = { workspace: Flags.string({ summary: getMessage(BundleName.ConfigCommand, 'flags.workspace.summary'), @@ -50,9 +47,6 @@ export default class ConfigCommand extends SfCommand implements Displayabl }; public async run(): Promise { - // TODO: Remove when we go GA - this.warn(getMessage(BundleName.Shared, "warning.command-state", [getMessage(BundleName.Shared, 'label.command-state')])); - const parsedFlags = (await this.parse(ConfigCommand)).flags; const dependencies: ConfigDependencies = this.createDependencies(parsedFlags['output-file']); const action: ConfigAction = ConfigAction.createAction(dependencies); diff --git a/src/commands/code-analyzer/rules.ts b/src/commands/code-analyzer/rules.ts index 18b0bde73..eda15996e 100644 --- a/src/commands/code-analyzer/rules.ts +++ b/src/commands/code-analyzer/rules.ts @@ -18,9 +18,6 @@ export default class RulesCommand extends SfCommand implements Displayable public static readonly description = getMessage(BundleName.RulesCommand, 'command.description'); public static readonly examples = getMessages(BundleName.RulesCommand, 'command.examples'); - // TODO: Remove when we go GA - public static readonly state = getMessage(BundleName.Shared, 'label.command-state'); - public static readonly flags = { workspace: Flags.string({ summary: getMessage(BundleName.RulesCommand, 'flags.workspace.summary'), @@ -57,9 +54,6 @@ export default class RulesCommand extends SfCommand implements Displayable }; public async run(): Promise { - // TODO: Remove when we go GA - this.warn(getMessage(BundleName.Shared, "warning.command-state", [getMessage(BundleName.Shared, 'label.command-state')])); - const parsedFlags = (await this.parse(RulesCommand)).flags; const outputFiles = parsedFlags['output-file'] ? [parsedFlags['output-file']] : []; const view = parsedFlags.view as View | undefined; diff --git a/src/commands/code-analyzer/run.ts b/src/commands/code-analyzer/run.ts index 5d72c93e1..47a460e5e 100644 --- a/src/commands/code-analyzer/run.ts +++ b/src/commands/code-analyzer/run.ts @@ -19,9 +19,6 @@ export default class RunCommand extends SfCommand implements Displayable { public static readonly description = getMessage(BundleName.RunCommand, 'command.description'); public static readonly examples = getMessages(BundleName.RunCommand, 'command.examples'); - // TODO: Remove when we go GA - public static readonly state = getMessage(BundleName.Shared, 'label.command-state'); - public static readonly flags = { // === Flags pertaining to targeting === workspace: Flags.string({ @@ -78,9 +75,6 @@ export default class RunCommand extends SfCommand implements Displayable { }; public async run(): Promise { - // TODO: Remove when we go GA - this.warn(getMessage(BundleName.Shared, "warning.command-state", [getMessage(BundleName.Shared, 'label.command-state')])); - const parsedFlags = (await this.parse(RunCommand)).flags; const dependencies: RunDependencies = this.createDependencies(parsedFlags.view as View|undefined, parsedFlags['output-file']); const action: RunAction = RunAction.createAction(dependencies);