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

Incrementally get Profile Changes #198

Closed
ronika-das opened this issue Oct 20, 2021 · 14 comments · Fixed by #533
Closed

Incrementally get Profile Changes #198

ronika-das opened this issue Oct 20, 2021 · 14 comments · Fixed by #533
Assignees
Labels
enhancement New feature or request

Comments

@ronika-das
Copy link

Is your proposal related to a problem?


Similar to how it currently for custom label and workflows, We are not able to pick changes incrementally from Profile Files

Describe the solution you'd like


So for example, there is a profile file, and I am newly adding a field permission to it. I would want want only the newly Field permission to be present while running the command.

Describe alternatives you've considered


Assume we have this profile file at commit abc123
image

And then we add a new field permission as follows at commit def456
image

After running the command
we want the file to look as follows

image

Additional context


N/A

@ronika-das ronika-das added the enhancement New feature or request label Oct 20, 2021
@scolladon
Copy link
Owner

scolladon commented Oct 20, 2021

Hi @ronika-das !

Thanks for your interest in the plugin and for your help to make it better

This is a very tricky question to answer because we all know all the joy we have to deal with Profile and Permission Set.

To address this topic we have created a very old pull request which add a command to the plugin in order to deal with those metadata.

This pull request is not moving forward yet because we do not see a lot of traction from the community for it (you are the first).
If there is a need we will invest time in it ! 😄

@scolladon
Copy link
Owner

Duplicate of #328

@scolladon scolladon marked this as a duplicate of #328 Mar 7, 2023
@benahm
Copy link

benahm commented Mar 18, 2023

Hello @ronika-das , this plugin lacks this feature that is very important to deal with some metadata
that why I have created another plugin that support incremental diffs for Profiles, Translations, Workflows...

Checkout git:delta command : mdt:git:delta

You can also read more on this article :Generate a delta 🛆 of your Salesforce ☁️ metadata for deployment 🚀

Alt Text

@scolladon
Copy link
Owner

Hi @benahm

Thanks you for enforcing the fact that this feature should be implemented.
We had long discussion about weither we should deal with it, is it a good idea or bad idea, why ? Pros and Cons, etc.

There is another person interested in this feature as well.
So, we decided to include it in the plugin.
We have an old WIP that will not be shipped because it is as another command and we don't want to add new command because it can complexify usage workflow.

Instead we have revamped it with new parameter and are working on it !
@ronika-das stay tuned !

Thanks for this awesome feature in your plugin @benahm, I personally love your contributions to the Salesforce ecosystem, especially your test data factory, it is one of the best in the ecosystem and I love using it when I need to. 👏 🙇

@ronika-das
Copy link
Author

Thank you @scolladon :)

There is one thing I wanted to share.

Recently for us, we had removed certain field permissions, class access etc from a Permission Set. One would expect it to not to remove anything from the Salesforce environment.
But we observed, the permissions got removed from the Permission Set on the Salesforce environment. Our intention was to only remove it from file but not the environment.

I guess this is something that should be checked once.
We should be good for profile, custom label, translation files

@ronika-das
Copy link
Author

@benahm thank you sharing details on your plugin and I going to check it out

@github-actions
Copy link

Shipped in release v5.18.0.
You can install the new version using the version number or the latest-rc channel

$ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install [email protected]

@scolladon
Copy link
Owner

Hi @ronika-das

We have extended the content pruning algorithm to more types (I think all of them now).

It is available in the latest-rc channel, ready for you to use it.
If you find any issue feel free to create a github issue so we can fix it quickly hopefully.

@e-bacho
Copy link

e-bacho commented Jan 23, 2024

Hi @scolladon-sfdc, wondering whether this ever made it to a release?

I am running sfdx-git-delta 5.34.0 (latest-rc) and was expecting to see only the changed elements inside a profile output file, but I am seeing a copy of the original (changed) file instead. Am I missing something?

@scolladon
Copy link
Owner

Hi @e-bacho, sorry to ear that.

It seems to be working on my local machine (just tested).
Could you send me reproduction steps and also more information about your env please (os, git version, node version, sfdx version and sgd version)

@e-bacho
Copy link

e-bacho commented Jan 24, 2024

Thanks for the prompt response @scolladon. I've updated everything to latest versions:

macOS 14.2.1
git 2.39.3
node v21.6.1
@salesforce/cli/2.24.4 darwin-arm64
sfdx-git-delta 5.34.0 (5.18.0)

I added a single field permission and re-ran the delta. It turns out the field permission is picked up and added to the output file, but so are all the layout assignments and IP ranges too. Is this an expected behaviour or a bug?

Screenshot 2024-01-24 at 11 14 53 am

@scolladon
Copy link
Owner

Hi @e-bacho,

Yes it is expected, layout assignments and ip ranges do not have a clear unique way to be identified (no fullname per example).
So we decided to not prune them.

I hope it helps, and happy incremental deployments

@gvivo
Copy link

gvivo commented Nov 26, 2024

Hi @scolladon, I'm currently testing the latest version and testing it with my CI/CD. Props for the amazing work!

I am facing the same situation as e-bacho. We usually go generating the delta file folder, so when we get to changes in Profiles, we're getting the LayoutAssignments and LoginIpRanges when there's no need for it.
I know of a similar plugin, now deprecated, that covered this part. They focused on creating the delta files structure by default, so they covered this part of the Profiles in a different manner. I think an option to prune the LayoutAssignments and LoginIpRanges when generating the delta files would be a good addition.
In case you're curious, I'll add the link to the plugin I mentioned before:

Thanks and regards,

@scolladon
Copy link
Owner

Thanks @gvivo for the kind words, I'm glad the plugin helps you.

I understand it is not useful to have those metadata when they are not changed.
I agree with you, we did it this way because it was simpler and it do not harm, we can go further.

I'll work soon on an improvement to try to remove those metadata when they are not changed.
Thanks for all the refs, very helpful.

Stay tuned!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment