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

New linter for checking if referenced metadata is in repository #348

Open
przemekrcloudity opened this issue Mar 31, 2023 · 1 comment
Open

Comments

@przemekrcloudity
Copy link
Contributor

General Idea

Detect references to metadata (for example in profiles, permission sets, permission set groups...) that no longer exist

Motivation

It's very easy to remove metadata that is no longer used but forget to remove all references to it in other files.
While using partial deployments based on git-diff, this will not be detected by SF as file with references to removed metadata was not deployed.
An example from my last month would be removing the field of SObject but not removing it from profiles and permission sets.

What is worse is that SFDX will inform user only about first occurrence of metadata that doesn't exist and with each next deployment user will learn about new metadata that is not included in repository. This can significantly increase build-fixing time

Propsoal

Add command to lint folder that would scan project for known metadata types (apex classes, fields, labels) and then check

  • profiles
  • permission sets
  • permission set groups
  • layouts
  • package definition files

for references to these fields.

Possible problems

I believe that references to components from namespaces should be skipped during analisis

@nvuillam
Copy link
Member

That would be GREAT 👓

And even greater (maybe in a second version), a --fix option ? :D

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