You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhancements for vscode-sfdx-hardis UI & refactor & doc generation (#1333)
* Enhanced logs v0
* commands placeholders
* Enhances logging and command execution visibility
Improves real-time feedback in the application by sending
command execution start and end events, as well as log lines,
to a WebSocket client. This enhances the user experience by
providing more detailed and timely information about command
progress and output. Also ensures ANSI codes are stripped to prevent
errors with the WebSocket.
* enhance messages
* Refactors WebSocket client message sending
Replaces generic `sendMessage` calls with specific methods for each event type.
This improves code clarity and maintainability by providing a more
structured way to send messages to the WebSocket client. It also adds a new
message type for sending report file information.
* Sends WebSocket close message on abort
Ensures that a 'closeClient' message is sent over the WebSocket
when a user aborts the script using the "exitNow" option in prompts.
This informs the client that the process was intentionally stopped
by the user.
Also, exposes methods for sending close messages and terminating the
WebSocket connection from outside.
* Adds command documentation URL to initClient event
Enhances the WebSocket initialization process by including a command-specific documentation URL.
This allows the client to navigate directly to the relevant documentation
for the command being executed, improving user experience and discoverability.
* Adds UX logging to several Hardis commands
Enhances user experience by adding more verbose logging
during key steps within the Hardis project documentation
generation and work creation commands.
* Adds UI configuration to commands
Adds the ability for commands to define a UI configuration that can be used by the client.
This allows the client to hide commands from the UI.
The UI configuration is dynamically imported from the command class.
* Enhances Hardis command UX and logging
Improves the user experience and debugging capabilities of several Hardis commands by:
- Moving `uiConfig` property to the bottom of the class for better readability.
- Adding a summary section to the audit trail command output.
- Adjusting log levels for clarity and reducing verbosity.
- Ensuring web socket client logs are not obfuscated.
* Improves audit trail diagnosis and logging
Enhances the audit trail diagnosis command by refining the summary output and improving the verbosity and clarity of logs.
- Consolidates suspect record details and related user/action information into a single, well-formatted log message.
- Updates the custom settings analysis message to reflect actual processing.
- Improves SOQL query logging by displaying chunk information only when multiple chunks are used.
* Enhances logging and websocket integration
Improves logging clarity and integrates websocket messages for Apex coverage reports and command execution.
- Replaces console logs with uxLog for better handling of output streams.
- Adds websocket messages to indicate the start/end of command executions (excluding hardis commands to avoid loops).
- Implements websocket message sending for Apex coverage reports.
- Removes instance URL from SOQL query logs.
* Improves UX by toning down log messages
Updates log messages to use grey color instead of cyan. This change aims to improve the user experience by reducing the visual prominence of log messages, making them less distracting and easier to scan.
Also, improves UX on `sf hardis:work:save` command.
* Refactors merge request summary output
Improves the clarity and readability of the merge request summary displayed to the user.
Replaces the previous multi-line string with individual log statements for repository URL, source branch, and target branch.
* Removes ticketing system guidance
Removes specific guidance related to adding ticketing system URLs in merge request descriptions.
This simplifies the message and focuses on the essential information:
- Avoiding branch reuse
- Using the new task menu
- Linking to the merge request documentation
* Improves command execution and UI feedback
Enhances command execution by adding a flag to prevent opening new tabs for specific commands and improves the display of pull command results.
Adjusts log levels for better clarity and provides more informative messages during source cleaning and pulling processes.
* Enhances user experience and CI/CD setup
Improves the user experience by adding more descriptive messages, color-coding, and providing guidance for setting up CI/CD variables.
Specifically, makes it more clear what variables needs to be configured and where the user needs to read more about the authentication process.
Updates org selection to provide clear and relevant information to the user and fix ordering.
* Enhances org selection prompts
Improves the user experience by defaulting the org selection prompts to the target org, when available. This change affects several commands, providing a more seamless workflow.
* Enhances project configuration for CI/CD
Improves the project configuration process by adding support for specifying target git branches for merges, enabling more automated CI/CD deployments.
It now prompts the user to select the git branch and its merge targets, storing them in a configuration file for future use.
* Improves org selection and sandbox handling
Enhances the user experience when selecting Salesforce orgs and handling sandboxes.
- Sorts org lists by instance URL for consistency.
- Persists the sandbox selection across branch switches.
- Displays the org username when configuring authentication.
* Sends refresh pipeline message after auth config
The pipeline needs to be refreshed after configuring authentication
to ensure the changes are applied. This change sends a WebSocket
message to trigger the refresh.
* improve descriptions of commands
* Adds descriptions to commands for better help
Adds comprehensive descriptions to all commands, including command behavior and technical explanations, for better help messages.
* Updates dependencies in yarn.lock
Updates `@oclif/plugin-command-snapshot` and `tmp` dependencies
in `yarn.lock` to their latest versions.
This ensures that the project uses the most recent versions of
these packages, potentially including bug fixes and performance
improvements.
* changelog
* build
* Adds "subfolders" to cspell dictionary
Adds "subfolders" to the cspell dictionary to prevent it from being flagged as a misspelling in documentation and code.
* Adds tmp package as a resolution
Adds the `tmp` package as a resolution to align versions and avoid potential dependency conflicts.
This change ensures that a specific version of `tmp` is used across the project, resolving potential issues related to different versions of the package being installed.
* [Mega-Linter] Apply linters fixes :)
* fix connected app name
* cancel command + log enhancements
* fix lint commands
* fixes
* fix command finalization
* improve logs
* improve logging
* cspell
* log
* logs
---------
Co-authored-by: nvuillam <[email protected]>
This command facilitates secure and automated logins to Salesforce organizations within continuous integration and continuous delivery pipelines. It leverages pre-configured authentication details, ensuring that CI/CD processes can interact with Salesforce without manual intervention.
13
12
14
-
If you have a technical org (for example to call Agentforce from another org, you can define variable SFDX_AUTH_URL_TECHNICAL_ORG and it will authenticate it with alias TECHNICAL_ORG)
13
+
Key aspects:
15
14
16
-
You can get SFDX_AUTH_URL_TECHNICAL_ORG value by running the command: `sf org display --verbose --json` and copy the value of the field `sfdxAuthUrl` in the output.
15
+
-**Configuration-Driven:** It relies on authentication variables and files set up by dedicated configuration commands:
16
+
- For CI/CD repositories: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)
17
+
- For Monitoring repositories: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)
18
+
-**Technical Org Support:** Supports authentication to a 'technical org' (e.g., for calling Agentforce from another org) by utilizing the `SFDX_AUTH_URL_TECHNICAL_ORG` environment variable. If this variable is set, the command authenticates to this org with the alias `TECHNICAL_ORG`.
19
+
20
+
To obtain the `SFDX_AUTH_URL_TECHNICAL_ORG` value, you can run `sf org display --verbose --json` and copy the `sfdxAuthUrl` field from the output.
21
+
22
+
## Technical explanations
23
+
24
+
The command's technical flow involves:
25
+
26
+
-**Flag Parsing:** It parses command-line flags such as `instanceurl`, `devhub`, `scratchorg`, and `debug` to determine the authentication context.
27
+
-**Authentication Hook:** It triggers an internal authentication hook (`this.config.runHook('auth', ...`)) which is responsible for executing the actual authentication logic based on the provided flags (e.g., whether it's a Dev Hub or a scratch org).
28
+
-**Environment Variable Check:** It checks for the presence of `SFDX_AUTH_URL_TECHNICAL_ORG` or `TECHNICAL_ORG_ALIAS` environment variables.
29
+
-**`authOrg` Utility:** If a technical org is configured, it calls the `authOrg` utility function to perform the authentication for that specific org, ensuring it's connected and available for subsequent operations.
30
+
-**Salesforce CLI Integration:** It integrates with the Salesforce CLI's authentication mechanisms to establish and manage org connections.
17
31
18
32
19
33
## Parameters
@@ -32,7 +46,7 @@ You can get SFDX_AUTH_URL_TECHNICAL_ORG value by running the command: `sf org di
Copy file name to clipboardExpand all lines: docs/hardis/cache/clear.md
+19-2Lines changed: 19 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,24 @@
3
3
4
4
## Description
5
5
6
-
Clear cache generated by sfdx-hardis
6
+
7
+
## Command Behavior
8
+
9
+
**Clears the local cache generated by the sfdx-hardis plugin.**
10
+
11
+
This command is designed to remove temporary files, stored configurations, and other cached data that sfdx-hardis uses to optimize its operations. Clearing the cache can be beneficial for:
12
+
13
+
-**Troubleshooting:** Resolving unexpected behavior or inconsistencies.
14
+
-**Disk Space Management:** Freeing up storage on your local machine.
15
+
-**Ensuring Fresh Data:** Guaranteeing that the plugin operates with the most current data and configurations.
16
+
17
+
## Technical explanations
18
+
19
+
The command's technical implementation is straightforward:
20
+
21
+
-**Direct Function Call:** It directly invokes the `clearCache()` function, which is imported from uri../../../common/cache/index.jsuri.
22
+
-**Cache Management Logic:** The uriclearCache()` function encapsulates the logic for identifying and removing the specific files and directories that constitute the sfdx-hardis cache.
23
+
7
24
8
25
## Parameters
9
26
@@ -18,7 +35,7 @@ Clear cache generated by sfdx-hardis
Copy file name to clipboardExpand all lines: docs/hardis/config/get.md
+21-2Lines changed: 21 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,26 @@
3
3
4
4
## Description
5
5
6
-
Returns sfdx-hardis project config for a given level
6
+
7
+
## Command Behavior
8
+
9
+
**Retrieves and displays the sfdx-hardis configuration for a specified level.**
10
+
11
+
This command allows you to inspect the configuration that is currently in effect for your project, which is useful for debugging and understanding how sfdx-hardis will behave.
12
+
13
+
-**Configuration levels:** It can retrieve configuration from three different levels:
14
+
-**Project:** The configuration defined in the project's `.sfdx-hardis.yml` file.
15
+
-**Branch:** The configuration defined in a branch-specific configuration file (e.g., `.sfdx-hardis.production.yml`).
16
+
-**User:** The global user-level configuration.
17
+
18
+
## Technical explanations
19
+
20
+
The command's logic is straightforward:
21
+
22
+
-**`getConfig` function:** It calls the `getConfig` utility function, passing the desired configuration level as an argument.
23
+
-**Configuration loading:** The `getConfig` function is responsible for finding the appropriate configuration file, reading its contents, and parsing it as YAML or JSON.
24
+
-**Output:** The retrieved configuration is then displayed to the user as a JSON string.
25
+
7
26
8
27
## Parameters
9
28
@@ -19,7 +38,7 @@ Returns sfdx-hardis project config for a given level
0 commit comments