Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📢 sfdx-hardis v5 has been released ! #795

Open
nvuillam opened this issue Sep 23, 2024 · 9 comments
Open

📢 sfdx-hardis v5 has been released ! #795

nvuillam opened this issue Sep 23, 2024 · 9 comments

Comments

@nvuillam
Copy link
Member

See release notes !

https://github.com/hardisgroupcom/sfdx-hardis/releases/tag/v5.0.1

If you see any issue, please create them and post a comment here :)

@nvuillam nvuillam pinned this issue Sep 23, 2024
@alesremta-ext43767
Copy link

Hi @nvuillam . I noticed a problem with purging flows.. and then noticed it may be with all commands? #800

maybe/hopefully it's just me

@alesremta-ext43767
Copy link

I also have a question about the new attribute for org:purge:flow delete-flow-interviews. It seems to have the same short-hand name -f as allowpurgefailure? Can I run with the delete interviews options without a prompt?

@nvuillam
Copy link
Member Author

nvuillam commented Sep 25, 2024

It seems to have the same short-hand name -f as allowpurgefailure

@alesremta-ext43767 Good catch, it is a bug... that I just solved in v5.0.6 :)

Can I run with the delete interviews options without a prompt?

You could not because I forgot to handle it, but with v5.0.6 you can, please can you confirm ?

sf hardis:org:purge:flow --no-prompt --delete-flow-interviews

@alesremta-ext43767
Copy link

alesremta-ext43767 commented Sep 25, 2024

You could not because I forgot to handle it, but with v5.0.6 you can, please can you confirm ?

Not yet @nvuillam, still having issues with #800
with the skipauth I can of course run this :-) seems to work, but also seems to delete the Flow Interviews even if I don't include the --delete-flow-interviews attribute

@nvuillam
Copy link
Member Author

Probably a remaining tiny bug ^^ I'll check :)

@nvuillam
Copy link
Member Author

@alesremta-ext43767 according to the code, it will delete prompts interview:

  • if you are in CI and --delete-flow-interviews is sent
  • if you are not in CI, and either --delete-flow-interviews is sent, or if the user accepts the prompt

Such behaviour such ok to me... do you confirm ? :)

@alesremta-ext43767
Copy link

Such behaviour such ok to me... do you confirm ? :)

It's not quite right in my case I think @nvuillam. I am in CI mode (no prompt) but did not specify to delete Flow Interviews, but it did anyway.

XXXXXXXX-core % sf hardis:org:purge:flow --no-prompt --skipauth --targetusername automation
Warning: The "--targetusername" flag has been deprecated. Use "--target-org | -o" instead.
[sfdx-hardis][command] sf data query  --query "SELECT Id,MasterLabel,VersionNumber,Status,Description,Definition.DeveloperName FROM Flow WHERE ManageableState IN ('deprecatedEditable','installedEditable','unmanaged') AND Status IN ('Obsolete') ORDER BY Definition.DeveloperName,VersionNumber" --target-org [email protected] --use-tooling-api --json
[sfdx-hardis] Found 1 records:
ID                 MASTERLABEL   VERSIONNUMBER DEFINITIONDEVNAME STATUS   DESCRIPTION
301RR00000OX3vJYAT Create a Case 7             Create_a_Case     Obsolete            
[sfdx-hardis] [ToolingApi] Delete 1 records on Flow: ["301RR00000OX3vJYAT"]
[sfdx-hardis] [ToolingApi] jsforce error while calling Tooling API. Fallback to to unitary delete (longer but should work !)
[sfdx-hardis] The requested resource does not exist
✖ [sfdx-hardis][command] sf data:delete:record --sobject Flow --record-id 301RR00000OX3vJYAT --target-org [email protected] --use-tooling-api --json
[sfdx-hardis] Unable to perform deletion request: {"Id":"301RR00000OX3vJYAT","success":false,"error":"{\"status\":1,\"errorMessage\":\"[sfdx-hardis][ERROR] Error processing command\\n${\\n  \\\"name\\\": \\\"DEPENDENCY_EXISTS\\\",\\n  \\\"message\\\": \\\"This flow version is referenced elsewhere in Salesforce. Remove the usage and try again. : Flow Interview - 0FoRR000005oSMS. This flow version is referenced elsewhere in Salesforce. Remove the usage and try again. : Flow Interview - 0FoRR000005oSMS.\\\",\\n  \\\"exitCode\\\": 1,\\n  \\\"context\\\": \\\"Delete\\\",\\n  \\\"stack\\\": \\\"DEPENDENCY_EXISTS: This flow version is referenced elsewhere in Salesforce. Remove the usage and try again. : Flow Interview - 0FoRR000005oSMS. This flow version is referenced elsewhere in Salesforce. Remove the usage and try again. : Flow Interview - 0FoRR000005oSMS.\\\\n    at SfCommandError.from (file:///opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/SfCommandError.js:39:16)\\\\n    at Delete.catch (file:///opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/sfCommand.js:316:47)\\\\n    at Delete._run (/opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:305:29)\\\\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\\\\n    at async Config.runCommand (/opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:424:25)\\\\n    at async run (/opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:95:16)\\\\n    at async file:///opt/homebrew/lib/node_modules/@salesforce/cli/bin/run.js:15:1\\\",\\n  \\\"cause\\\": \\\"undefined\\\",\\n  \\\"warnings\\\": [],\\n  \\\"code\\\": \\\"DEPENDENCY_EXISTS\\\",\\n  \\\"status\\\": 1,\\n  \\\"commandName\\\": \\\"Delete\\\"\\n}\\n\\n\",\"error\":{\"code\":1,\"killed\":false,\"signal\":null,\"cmd\":\"sf data:delete:record --sobject Flow --record-id 301RR00000OX3vJYAT --target-org [email protected] --use-tooling-api --json\",\"stdout\":\"{\\n  \\\"name\\\": \\\"DEPENDENCY_EXISTS\\\",\\n  \\\"message\\\": \\\"This flow version is referenced elsewhere in Salesforce. Remove the usage and try again. : Flow Interview - 0FoRR000005oSMS. This flow version is referenced elsewhere in Salesforce. Remove the usage and try again. : Flow Interview - 0FoRR000005oSMS.\\\",\\n  \\\"exitCode\\\": 1,\\n  \\\"context\\\": \\\"Delete\\\",\\n  \\\"stack\\\": \\\"DEPENDENCY_EXISTS: This flow version is referenced elsewhere in Salesforce. Remove the usage and try again. : Flow Interview - 0FoRR000005oSMS. This flow version is referenced elsewhere in Salesforce. Remove the usage and try again. : Flow Interview - 0FoRR000005oSMS.\\\\n    at SfCommandError.from (file:///opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/SfCommandError.js:39:16)\\\\n    at Delete.catch (file:///opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@salesforce/sf-plugins-core/lib/sfCommand.js:316:47)\\\\n    at Delete._run (/opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/command.js:305:29)\\\\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\\\\n    at async Config.runCommand (/opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/config/config.js:424:25)\\\\n    at async run (/opt/homebrew/lib/node_modules/@salesforce/cli/node_modules/@oclif/core/lib/main.js:95:16)\\\\n    at async file:///opt/homebrew/lib/node_modules/@salesforce/cli/bin/run.js:15:1\\\",\\n  \\\"cause\\\": \\\"undefined\\\",\\n  \\\"warnings\\\": [],\\n  \\\"code\\\": \\\"DEPENDENCY_EXISTS\\\",\\n  \\\"status\\\": 1,\\n  \\\"commandName\\\": \\\"Delete\\\"\\n}\\n\",\"stderr\":\"\"}}"}
[sfdx-hardis] [BulkApiV2] SELECT Name,InterviewLabel,InterviewStatus,CreatedBy.Username,CreatedDate,LastModifiedDate FROM FlowInterview WHERE Id IN ('0FoRR000005oSMS') ORDER BY Name
✔ [BulkApiV2] Bulk Query completed with 1 results.
[sfdx-hardis] Flow interviews to be deleted would be the following:
NAME     INTERVIEWLABEL                INTERVIEWSTATUS CREATEDBY.USERNAME            CREATEDDATE              LASTMODIFIEDDATE        
00000012 Create a Case 27.09.2024 9:50 Error           [email protected] 2024-09-27T07:50:34.000Z 2024-09-27T07:50:34.000Z
[sfdx-hardis] SOQL BULK on object FlowInterview with action delete (1 records)
✔ Bulk Load on FlowInterview (delete) completed.
[sfdx-hardis] Trying again to delete flow versions after deleting flow interviews...
[sfdx-hardis] [ToolingApi] Delete 1 records on Flow: ["301RR00000OX3vJYAT"]
[sfdx-hardis] [ToolingApi] jsforce error while calling Tooling API. Fallback to to unitary delete (longer but should work !)
[sfdx-hardis] The requested resource does not exist
✔ [sfdx-hardis][command] sf data:delete:record --sobject Flow --record-id 301RR00000OX3vJYAT --target-org [email protected] --use-tooling-api --json
[sfdx-hardis] {
  "status": 0,
  "result": {
    "id": "301RR00000OX3vJYAT",
    "success": true,
    "errors": []
  },
  "warnings": []
}

[sfdx-hardis] Deleted the following list of record(s):
0               ID                 SUCCESS
[object Object]                           
                301RR00000OX3vJYAT true   
[sfdx-hardis] hardis:org:purge:flow execution time 0:00:27.794

@nvuillam
Copy link
Member Author

I don't understand :'(

image

Any chance you could debug locally ? 😇

https://sfdx-hardis.cloudity.com/#contributing

@alesremta-ext43767
Copy link

Any chance you could debug locally ? 😇
Challenge, but I'll try - though it'll take me time, this weekend is busy :-)

Though in your conditions:

  1. is true, cos there were errors
  2. is true, cos it's CI (so this.deleteFlowInterviews don't matter)
  3. seems to be called with True from line 125

so I'd say it's number 2?

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

No branches or pull requests

2 participants