Skip to content

sfdx force:source:pull tracking changes incorrectly for Profiles since Spring 20 release #311

@lockholster

Description

@lockholster

Summary

Prior to the Spring 20 release, if you push field level security or object level security profiles, then later pull (due to changes via ui), the new changes would be retrieved along with what was pushed prior. Now the profiles are returned almost empty, with only the fields changed since last push.

Also, this means if you push profile changes then pull again later, you also lose other fls, ols, and application visibilities, even if they were changed via the UI in the same session.

sfdx-cli/7.45.1-bc18d49798 win32-x64 node-v10.15.3
api v48.0

Steps To Reproduce:

Many ways to produce this but the best way to display why this breaks source driven development would be:

  1. Create scratch org
  2. Create new custom profile
  3. Create new object, and one new field on that object (giving read/write to custom profile)
  4. Pull changes (Profile retrieves with new object and new field, no other fls/ols)
  5. Create a new scratch org and push project
  6. Create a 2nd field on the new object
  7. Pull changes (Profile retrieves with previous field removed, only contains new field)
  8. Create a new scratch org and push project

Expected result

Profile has read/write access to both fields as configured

Actual result

Read/write access has been removed from the First field.

Additional information

The obvious problem this creates is that for source driven projects, whenever fls/ols changes and a pull is required, all our previous profile metadata (which was pushed) is removed.

Only way to get around this is to forceignore profiles (no longer functional for source driven projects), and use scripting (via mdapi) to replace them so future scratch orgs and CI deployments to sandboxes/production.

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.45.1-bc18d49798 win32-x64 node-v10.15.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)
@oclif/plugin-autocomplete 0.1.5 (core)
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.3 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.9 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.7.0 (core)
generator 1.1.2 (core)
salesforcedx 47.18.0 (core)
├─ salesforcedx-templates 47.19.0 (core)
└─ salesforce-alm 47.16.0 (core)

OS and version:
Windows 10, sourceApiVersion: 48.0 (this was updated to most recent in attempt to avoid the above)

Metadata

Metadata

Assignees

No one assigned

    Labels

    more information requiredIssue requires more information or a response from the customer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions