Skip to content

Commit ed09ae7

Browse files
authored
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]>
1 parent 3235e71 commit ed09ae7

File tree

278 files changed

+6933
-2188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

278 files changed

+6933
-2188
lines changed

.github/linters/.cspell.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
"Couldn",
7373
"Cyclomatic",
7474
"DDHG",
75+
"Dflt",
7576
"DYSA",
7677
"Dandb",
7778
"Dataspace",
@@ -413,6 +414,7 @@
413414
"datacategorygroup",
414415
"datacategorygroups",
415416
"datadotcom",
417+
"dataflows",
416418
"deactivateduser",
417419
"deepseek",
418420
"defaultdevhubusername",
@@ -451,6 +453,7 @@
451453
"eatre",
452454
"ects",
453455
"effectuer",
456+
"ehthumbs",
454457
"elementsignored",
455458
"elgohr",
456459
"emailservices",
@@ -463,7 +466,6 @@
463466
"errorprone",
464467
"eslintcache",
465468
"espace",
466-
"ehthumbs",
467469
"eventtype",
468470
"everytime",
469471
"exceljs",
@@ -473,6 +475,7 @@
473475
"exemple",
474476
"expcloud",
475477
"explainability",
478+
"exttt",
476479
"failiferror",
477480
"farmhash",
478481
"fflib",
@@ -969,6 +972,7 @@
969972
"staticresources",
970973
"stefanzweifel",
971974
"subflows",
975+
"subfolders",
972976
"suivant",
973977
"suivante",
974978
"superfences",
@@ -1024,13 +1028,15 @@
10241028
"unparse",
10251029
"unrstanding",
10261030
"unstage",
1031+
"unstaging",
10271032
"unusedlicenses",
10281033
"unusedmetadata",
10291034
"unusedmetadatas",
10301035
"unusedusers",
10311036
"updatedall",
10321037
"updateddatedexchrate",
10331038
"updatedfile",
1039+
"uriclear",
10341040
"urlonly",
10351041
"usagestop",
10361042
"usedonly",
@@ -1076,6 +1082,7 @@
10761082
"xunit",
10771083
"yamioliva",
10781084
"yamllint",
1085+
"yourinstanceurl",
10791086
"zipfile",
10801087
"\u00c9xito",
10811088
"\u00e9l\u00e9ments",

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
Note: Can be used with `sfdx plugins:install sfdx-hardis@beta` and docker image `hardisgroupcom/sfdx-hardis@beta`
66

7+
## [6.0.0] 2025-09-08
8+
9+
- Implement advanced websocket messaging for vscode sfdx-hardis LWC UI
10+
- Refactor logging within commands for better display on vscode sfdx-hardis LWC UI
11+
- Generate commands documentation with AI
12+
- Refactor [hardis:org:configure:auth](https://sfdx-hardis.cloudity.com/hardis/org/configure/auth/) for better UX
13+
- Enhance org selection prompt
14+
715
## [5.45.0] 2025-07-22
816

917
- Generate ubuntu-based Docker images

GEMINI.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Gemini Instructions
2+
3+
For all development, coding standards, and project guidelines, please refer to the main Copilot instructions:
4+
5+
[.github/copilot-instructions.md](../.github/copilot-instructions.md)
6+
7+
All requirements, best practices, and conventions for this project are defined in that file. No additional Gemini-specific instructions are provided.

docs/hardis/auth/login.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,30 @@
44
## Description
55

66

7-
Logins to a Salesforce org from CI/CD workflows.
7+
## Command Behavior
88

9-
Will use the variables and files defined by configuration commands:
9+
**Authenticates to a Salesforce org, primarily designed for CI/CD workflows.**
1010

11-
- CI/CD repos: [Configure Org CI Authentication](https://sfdx-hardis.cloudity.com/hardis/project/configure/auth/)
12-
- Monitoring repos: [Configure Org Monitoring](https://sfdx-hardis.cloudity.com/hardis/org/configure/monitoring/)
11+
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.
1312

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:
1514

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.
1731

1832

1933
## Parameters
@@ -32,7 +46,7 @@ You can get SFDX_AUTH_URL_TECHNICAL_ORG value by running the command: `sf org di
3246
## Examples
3347

3448
```shell
35-
sf hardis:auth:login
49+
$ sf hardis:auth:login
3650
```
3751

3852
```shell

docs/hardis/cache/clear.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,24 @@
33

44
## Description
55

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+
724

825
## Parameters
926

@@ -18,7 +35,7 @@ Clear cache generated by sfdx-hardis
1835
## Examples
1936

2037
```shell
21-
sf hardis:cache:clear
38+
$ sf hardis:cache:clear
2239
```
2340

2441

docs/hardis/config/get.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,26 @@
33

44
## Description
55

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+
726

827
## Parameters
928

@@ -19,7 +38,7 @@ Returns sfdx-hardis project config for a given level
1938
## Examples
2039

2140
```shell
22-
sf hardis:project:deploy:sources:metadata
41+
$ sf hardis:project:deploy:sources:metadata
2342
```
2443

2544

docs/hardis/deploy/quick.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ commandsPostDeploy:
5252
5353
## Parameters
5454
55-
| Name | Type | Description | Default | Required | Options |
56-
|:-------------------------|:-------:|:-----------------------|:----------------------------------------:|:--------:|:-------:|
57-
| --job-id<br/>-i | option | job-id | | | |
58-
| --use-most-recent<br/>-r | boolean | use-most-recent | | | |
59-
| api-version<br/>-a | option | api-version | | | |
60-
| async | boolean | async | | | |
61-
| debug | boolean | debug | | | |
62-
| flags-dir | option | undefined | | | |
63-
| json | boolean | Format output as json. | | | |
64-
| target-org<br/>-o | option | undefined | <[email protected]> | | |
65-
| tests | option | tests | | | |
66-
| wait<br/>-w | option | wait | 33 | | |
55+
| Name | Type | Description | Default | Required | Options |
56+
|:-------------------------|:-------:|:-----------------------|:--------------------------------------:|:--------:|:-------:|
57+
| --job-id<br/>-i | option | job-id | | | |
58+
| --use-most-recent<br/>-r | boolean | use-most-recent | | | |
59+
| api-version<br/>-a | option | api-version | | | |
60+
| async | boolean | async | | | |
61+
| debug | boolean | debug | | | |
62+
| flags-dir | option | undefined | | | |
63+
| json | boolean | Format output as json. | | | |
64+
| target-org<br/>-o | option | undefined | [email protected] | | |
65+
| tests | option | tests | | | |
66+
| wait<br/>-w | option | wait | 33 | | |
6767
6868
## Examples
6969

docs/hardis/deploy/start.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -52,32 +52,32 @@ commandsPostDeploy:
5252
5353
## Parameters
5454
55-
| Name | Type | Description | Default | Required | Options |
56-
|:-------------------------|:-------:|:-------------------------|:----------------------------------------:|:--------:|:-------:|
57-
| api-version<br/>-a | option | api-version | | | |
58-
| async | boolean | async | | | |
59-
| coverage-formatters | option | coverage-formatters | | | |
60-
| debug | boolean | debug | | | |
61-
| dry-run | boolean | dry-run | | | |
62-
| flags-dir | option | undefined | | | |
63-
| ignore-conflicts<br/>-c | boolean | ignore-conflicts | | | |
64-
| ignore-errors<br/>-r | boolean | ignore-errors | | | |
65-
| ignore-warnings<br/>-g | boolean | ignore-warnings | | | |
66-
| json | boolean | Format output as json. | | | |
67-
| junit | boolean | junit | | | |
68-
| manifest<br/>-x | option | manifest | | | |
69-
| metadata<br/>-m | option | metadata | | | |
70-
| metadata-dir | option | metadata-dir | | | |
71-
| post-destructive-changes | option | post-destructive-changes | | | |
72-
| pre-destructive-changes | option | pre-destructive-changes | | | |
73-
| purge-on-delete | boolean | purge-on-delete | | | |
74-
| results-dir | option | results-dir | | | |
75-
| single-package | boolean | single-package | | | |
76-
| source-dir<br/>-d | option | source-dir | | | |
77-
| target-org<br/>-o | option | undefined | <[email protected]> | | |
78-
| test-level | option | test-level | | | |
79-
| tests | option | tests | | | |
80-
| wait<br/>-w | option | wait | 33 | | |
55+
| Name | Type | Description | Default | Required | Options |
56+
|:-------------------------|:-------:|:-------------------------|:--------------------------------------:|:--------:|:-------:|
57+
| api-version<br/>-a | option | api-version | | | |
58+
| async | boolean | async | | | |
59+
| coverage-formatters | option | coverage-formatters | | | |
60+
| debug | boolean | debug | | | |
61+
| dry-run | boolean | dry-run | | | |
62+
| flags-dir | option | undefined | | | |
63+
| ignore-conflicts<br/>-c | boolean | ignore-conflicts | | | |
64+
| ignore-errors<br/>-r | boolean | ignore-errors | | | |
65+
| ignore-warnings<br/>-g | boolean | ignore-warnings | | | |
66+
| json | boolean | Format output as json. | | | |
67+
| junit | boolean | junit | | | |
68+
| manifest<br/>-x | option | manifest | | | |
69+
| metadata<br/>-m | option | metadata | | | |
70+
| metadata-dir | option | metadata-dir | | | |
71+
| post-destructive-changes | option | post-destructive-changes | | | |
72+
| pre-destructive-changes | option | pre-destructive-changes | | | |
73+
| purge-on-delete | boolean | purge-on-delete | | | |
74+
| results-dir | option | results-dir | | | |
75+
| single-package | boolean | single-package | | | |
76+
| source-dir<br/>-d | option | source-dir | | | |
77+
| target-org<br/>-o | option | undefined | [email protected] | | |
78+
| test-level | option | test-level | | | |
79+
| tests | option | tests | | | |
80+
| wait<br/>-w | option | wait | 33 | | |
8181
8282
## Examples
8383

0 commit comments

Comments
 (0)