-
Notifications
You must be signed in to change notification settings - Fork 17
feat: create new rule for inactive flows #83
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
feat: create new rule for inactive flows #83
Conversation
|
This is awesome @k-capehart, thank you so much! I would like to change the description in the rule (and also readme) to something a bit more elaborate, so heres some documentation I came across around this topic(which is limited):
In general I think inactive data is often recommended to be deleted so maybe it can be more generic. I'll sleep on this, but this can be merged as is, its just an awesome job! |
|
Great addition ! But... Inactive flows can be manually configured in the org and you won't see it in the sources 🥹 With sfdx hardis monitoring you'll see it and receive a notification on slack / teams / mail / api (grafana) 🥳 https://sfdx-hardis.cloudity.com/salesforce-monitoring-home/#detect-inactive-metadata |
|
@nvuillam I tested this and if I deactivate a flow it changes the status when I retrieve the flow. So I am not sure what you mean exactly. According to the docs valid values are:
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_visual_workflow.htm |
|
@RubenHalman when you retrieve the flow yes, but after a deployment someone can manually create a new flow version and you won't see it :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. The changes requested by me are not critical but would be appreciated. Additionally we need to update the readme with the new rule and its description, which I can take care of if you like.
src/main/rules/InactiveFlow.ts
Outdated
| @@ -0,0 +1,35 @@ | |||
| import * as IdPrefixes from '../data/IdPrefixes.json'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@k-capehart this import can be removed
src/main/rules/InactiveFlow.ts
Outdated
|
|
||
| public execute(flow: core.Flow): core.RuleResult { | ||
| const inactiveFlows = []; | ||
| console.log(flow.name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@k-capehart please remove the console log, it will show in the sfdx application
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thanks so much for catching that! I'll update the PR
|
@nvuillam everything can be changed manually in production when it comes to a flow, so it should probably always be best practice to retrieve the source. It does really seem to be a seperate issue, and I think you also agree with the bottom-line of this PR, which is that having inactive flows in your Org is not in line with Best Practices? |
|
@RubenHalman I took a first pass at the description, but I'm sure you'll want to tweak it and link documentation. Thanks for the review! |
Based on discussion here: https://github.com/Lightning-Flow-Scanner/lightning-flow-scanner-sfdx/discussions/89
Creates a new rule that scans for flows where Status != "Active"
Therefore an inactive flow would be any of the following: Draft, Obsolete, InvalidDraft: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_visual_workflow.htm