Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Reset the Sfpowerkit on a different target org or include the org name into the cache #1413

Open
Schuchie opened this issue Sep 25, 2023 · 1 comment · May be fixed by #1422
Open

Reset the Sfpowerkit on a different target org or include the org name into the cache #1413

Schuchie opened this issue Sep 25, 2023 · 1 comment · May be fixed by #1422
Assignees
Labels
bug Something isn't working

Comments

@Schuchie
Copy link
Contributor

Schuchie commented Sep 25, 2023

Describe the bug
Currently the profile reconcile command does not clean all metadata existing to the connected org. This happens only if you execute the command twice and switch the org between the first run and second run.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to Org A
  2. Create a new field (Account.Test__c)
  3. Add this field to the Admin Profile
  4. Run the sfp profile reconcile for the Admin-Profile
  5. Switch to Org B (without the Test-Field)
  6. Run the sfp profile reconcile with target Org B
  7. Field was not cleared, because the Sfpowerkit has still the Account.Test__c-Field from Org A in the cache

Expected behavior
The Sfpowerkit-Cache resets after each change of target org or adds the org alias to the cache.

Screenshots
If applicable, add screenshots to help explain your problem.

Platform Details (please complete the following information):

  • OS: MacBook M2
  • Version: @dxatscale/sfpowerscripts/24.5.0 darwin-arm64 node-v20.6.1
  • Salesforce CLI(sfdx cli) Version: @salesforce/cli/2.9.8 darwin-arm64 node-v20.6.1
  • CI Platform: GitHub and Local

Additional context
If I add the cache reset to the command, the reconcile works correctly or delete the current cache table:

//sfpowerscripts/packages/sfpowerscripts-cli/src/commands/profile/reconcile.ts:86
Sfpowerkit.resetCache();
@github-actions github-actions bot added the analysis To be decided on how to solution/fix label Sep 25, 2023
@azlam-abdulsalam azlam-abdulsalam added bug Something isn't working and removed analysis To be decided on how to solution/fix labels Sep 25, 2023
@azlam-abdulsalam azlam-abdulsalam self-assigned this Sep 25, 2023
azlam-abdulsalam added a commit that referenced this issue Oct 13, 2023
… against an org multiple times

The PR adds an additional flag --resetcache to merge/reconcile which provides ability to reset cache
as required among subsequent runs

fixes #1413
@azlam-abdulsalam
Copy link
Contributor

@Schuchie can you review the PR please

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
2 participants