Skip to content

Conversation

@randi274
Copy link
Contributor

This PR:

  • Updates any lingering sfdx-scanner references with the repository rename to code-analyzer
  • Updates the README for latest functionality
  • Adds additional issue templates for the VS Code Extensions and the Run Github Action to use

attributes:
label: Bug Description
description: Provide a clear and concise description of what the bug is and include the exact command that you ran.
description: Provide a clear and concise description of what the bug is.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The exact command is asked for later, so thought this could be shortened

package.json Outdated
{
"name": "@salesforce/plugin-code-analyzer",
"description": "Static code scanner that applies quality and security rules to Apex code, and provides feedback.",
"description": "Static code scanner that applies quality and security rules to Salesforce code and provides feedback.",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we scan more than just Apex, I wanted to open up this description. However, I wasn't sure we'd be ok locking so closely to Salesforce since code-analyzer is not entirely platform specific. Happy to update this as we need! Maybe @jshackell-sfdc can weigh in here as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I agree with your change. I would go even further and remove the word "Static" even.

Let's see if @jshackell-sfdc doesn't already have a better short description that we could put here instead.

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 liked the notion of matching what we have in the readme as well, so I made these match!

@randi274 randi274 force-pushed the randi/W-18505636-ga-updates branch from ce27483 to 905b0fc Compare May 21, 2025 20:09
@@ -1,7 +1,6 @@
name: Report a Bug with a scanner command (v4)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you updated the 0-code_analyzer_bug.yml to have

name: Report a Bug with the sf CLI `code-analyzer` commands

then shouldn't this 1_scanner_bug.yml be something like:

name: Report a Bug with the sf CLI `scanner` (v4) commands

@@ -0,0 +1,142 @@
name: Report a Bug with the Salesforce Code Analyzer VS Code Extension
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add some quotes like maybe:

name: Report a Bug with the "Salesforce Code Analyzer" VS Code Extension

@@ -0,0 +1,122 @@
name: Report a Bug with the Run Salesforce Code Analyzer Github Action
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto about quotes... maybe:

name Report a Bug with the "Run Salesforce Code Analyzer" GitHub Action

Also note that GitHub should have a capital H.

Comment on lines 87 to 92
label: Scanner Plugin Version
description: |
If you are using V4, what do you get from typing the command "sf plugins" in the terminal?
placeholder: |
Example: @salesforce/sfdx-scanner/4.10.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's assume that folks have moved to v5 and instead let's just ask about their code-analyzer version just like we do on the code-analyzer cli issue page and all its requirements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With this one, I was thinking it would likely be part of the troubleshooting steps of "are you using v4", because if they are, we would direct them to using v5 and hopefully resolve the issue 🤞

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand.. but where is the code-analyzer version when they are using code-analyzer and not scanner?

README.md Outdated
* how to install Code Analyzer
* what is included in the Code Analyzer command reference
* the structure of Code Analyzer architecture
* what rules are included from code-scanning engines such as PMD and ESLint
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need the word "code-scanning" here. It isn't a term we normally use. So let's just say "... from engines ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed "code-scanning felt funky - I was looking for something that might help explain what an "engine" means for someone who hasn't worked with Code Analyzer before. I'll take another stab at this one and ask @jshackell-sfdc!

package.json Outdated
{
"name": "@salesforce/plugin-code-analyzer",
"description": "Static code scanner that applies quality and security rules to Apex code, and provides feedback.",
"description": "Static code scanner that applies quality and security rules to Salesforce code and provides feedback.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I agree with your change. I would go even further and remove the word "Static" even.

Let's see if @jshackell-sfdc doesn't already have a better short description that we could put here instead.

@randi274 randi274 force-pushed the randi/W-18505636-ga-updates branch from 89f4d84 to 5378b48 Compare May 23, 2025 19:51
@randi274 randi274 force-pushed the randi/W-18505636-ga-updates branch from 5378b48 to 64220e8 Compare May 27, 2025 14:02
label: Have you tried to resolve this issue yourself first?
description: |
Oftentimes, you can resolve `code-analyzer` issues on your own. Follow these steps:
You can often resolve "code-analyzer" issues on your own. Follow these steps:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm wrong here but I think we actually do want the ticks so "code-analyzer" renders as code?

attributes:
label: Steps To Reproduce
description: List out the steps that you used to reproduce the bug behavior. Be as specific and clear as possible.
description: List the steps that you used to reproduce the bug behavior. Be as specific and clear as possible.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably also instruct them to make sure that the STRs are runnable on another machine. E.g., attach any files that might be necessary for us to scan against to reproduce the problem, etc.
It's irksome when they just give the steps they do on their local machine without any way for us to recreate their setup.

attributes:
label: Steps To Reproduce
description: List out the steps that you used to reproduce the bug behavior. Be as specific and clear as possible.
description: List the steps that you used to reproduce the bug behavior. Be as specific and clear as possible.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as other file.

attributes:
label: Have you tried to resolve this issue yourself first?
description: |
You can often resolve "vscode-extension" issues on your own. Follow these steps:
Copy link
Contributor

Choose a reason for hiding this comment

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

"vscode-extension" feels wrong, but I'm not intuitively sure what should go here. Should it be the name of the actual pacakge the VSCode extension is released as, maybe?

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'll go with a generic! that's what I did for the gha

1. Read the error message.
2. Read the [Salesforce Code Analyzer VS Code Extension](https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/guide/analyze-vscode.html) documentation.
3. Double-check the VS Code extension feature you used. Make sure that items like file names, method names, and category names are correctly spelled and cased.
4. Verify that you can't reproduce the issue using the appropriate Salesforce CLI command directly.
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll want to include instructions for how they can set the logger to include the actual command that was run, right? (i.e., turning the debug settings to DEBUG, etc?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jfeingold35 can you add a suggestion for how to phrase this? I can remember how to update that setting (and haven't used it with other extensions before).

Copy link
Contributor

Choose a reason for hiding this comment

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

Use the "Developer: Set Log Level" command from the Command Palette to set the log levels to 'DEBUG', and then the "Output" panel will indicate what the underlying code-analyzer command for the given VSCode command was.

- type: textarea
attributes:
label: Steps To Reproduce
description: List the steps that you used to reproduce the bug behavior. Be as specific and clear as possible.
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as elsewhere.

- type: textarea
attributes:
label: Steps To Reproduce
description: List the steps that you used to reproduce the bug behavior. Be as specific and clear as possible.
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment elsewhere.

Comment on lines 75 to 94
- type: dropdown
attributes:
label: Code Analyzer Version
description: "Are you using Code Analyzer v4? (Is the setting 'Code Analyzer: Use v4 (Deprecated)' checked?)"
options:
- "Yes"
- "No"
- "Not sure"
default: 0
validations:
required: true
- type: input
attributes:
label: Scanner Plugin Version
description: |
If you are using Code Analyzer v4, what do you get when you run the "sf plugins" command in the terminal?
placeholder: |
Example: @salesforce/sfdx-scanner 4.12.0 (4.12.0)
validations:
required: false
Copy link
Contributor

Choose a reason for hiding this comment

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

I see you have "Code Analyzer Version" but the question is about v4 use or not. We need to actually get the Code Analyzer Version from the user and relabel the drop down about v4 use or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, let me clarify this section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this - hopefully this reads better now!

@@ -1,38 +1,37 @@
name: Report a Bug with a code-analyzer command
description: Report an issue with a code-analyzer command.
name: Report a Bug With the "code-analyzer" (v5) CLI Commands
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you double check with @jshackell-sfdc on whether the word "with" should be capitalized here. I thought it fit into the same category as the words "a" and "the".

If not, then we should update all of our issues files to not capitalize "with".

@@ -0,0 +1,123 @@
name: Report a Bug with the "Run Salesforce Code Analyzer" GitHub Action
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that this has a lower case "with" - which I like. So we should make them all consistent.

@randi274 randi274 merged commit f800322 into dev May 27, 2025
10 checks passed
@randi274 randi274 deleted the randi/W-18505636-ga-updates branch October 29, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants