Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/0-code_analyzer_bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/apply-npm-tag-to-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/automated-release-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Copy link
Contributor Author

@randi274 randi274 Mar 31, 2025

Choose a reason for hiding this comment

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

When running this locally, using "patch" as the version helped update the package.json version correctly for me:
Screenshot 2025-03-28 at 4 10 09 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Hey this is great news! We'll do this instead of manually creating it then for this month. Great find.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, for this month we want to run it as patch. Good call.

});
# TODO: Remove this after last v4.x release in April
create-v4-release-branch:
runs-on: macos-latest
needs: verify-should-run
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/create-release-branch.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
name: create-release-branch
on:
workflow_dispatch:
inputs:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

However, I also thought it prudent to add in the manual option back in case we need to re-run (for whatever reason)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we definitely need this now.

# 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:
Expand All @@ -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.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found this on dev-4 👀

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this makes it so the automated monthly execution defaults to minor. It won't cause a problem here because patch is being explicitly passed in, and it's technically also unnecessary in v4 because minor gets explicitly passed in there too.
But it's still a nice thing to have.

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.
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/daily-smoke-tests-v4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#TODO: remove v4 with April Release
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stephen-carter-at-sf I opted to keep this separate for easy deletion. I'm not quite sure why we need the script to invoke the tests, but I updated daily-smoke-tests to just work off of dev.

Copy link
Contributor

Choose a reason for hiding this comment

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

What exactly were you confused about? I'm not quite sure I understand.

Copy link
Contributor

Choose a reason for hiding this comment

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

cron based jobs can only run from dev. So from dev we dispatch the actual v4 script from the dev-4 branch. What you have here is correct.

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'
});
18 changes: 3 additions & 15 deletions .github/workflows/daily-smoke-tests.yml
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Request: Could you add a comment covering the explanation I gave the other day? i.e.,

We run the daily smoke tests against 'dev' to validate that the code currently in development is still valid

or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point to clarify!

5 changes: 2 additions & 3 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Contributor

Choose a reason for hiding this comment

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

I recommend greping for salesforce-plugin-code-analyzer-5\\.[0-9]*\\.[0-9]*\\.tgz.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one I realized we'll need to wait until after we go GA, but we can clean that up then if you'd like 👍

# 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 '\\' '/'`
Expand All @@ -130,4 +130,3 @@ jobs:
with:
name: smoke-test-results-${{ runner.os }}-node-${{ matrix.node.artifact }}
path: smoke-test-results

1 change: 1 addition & 0 deletions .github/workflows/validate-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: You'll also need to remove this job as a Required job for the branch protection rule.

verify_target_branch:
runs-on: ubuntu-latest
steps:
Expand Down
8 changes: 0 additions & 8 deletions messages/shared.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 0 additions & 6 deletions src/commands/code-analyzer/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export default class ConfigCommand extends SfCommand<void> 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'),
Expand Down Expand Up @@ -50,9 +47,6 @@ export default class ConfigCommand extends SfCommand<void> implements Displayabl
};

public async run(): Promise<void> {
// 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);
Expand Down
6 changes: 0 additions & 6 deletions src/commands/code-analyzer/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export default class RulesCommand extends SfCommand<void> 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'),
Expand Down Expand Up @@ -57,9 +54,6 @@ export default class RulesCommand extends SfCommand<void> implements Displayable
};

public async run(): Promise<void> {
// 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;
Expand Down
6 changes: 0 additions & 6 deletions src/commands/code-analyzer/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ export default class RunCommand extends SfCommand<void> 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({
Expand Down Expand Up @@ -78,9 +75,6 @@ export default class RunCommand extends SfCommand<void> implements Displayable {
};

public async run(): Promise<void> {
// 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);
Expand Down