-
Notifications
You must be signed in to change notification settings - Fork 98
fix(profile): add ability to reset cache when the command is executed against an org multiple times #1422
base: main
Are you sure you want to change the base?
Conversation
… 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
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1422 +/- ##
=======================================
Coverage 46.80% 46.80%
=======================================
Files 70 70
Lines 2662 2662
Branches 302 302
=======================================
Hits 1246 1246
Misses 1414 1414
Partials 2 2 ☔ View full report in Codecov by Sentry. |
…get-org-or-include-the-org-name-into-the-cache
Reviewpad Report
|
@@ -65,7 +65,7 @@ export default class Retrieve extends SfpowerscriptsCommand { | |||
folders.push(...argFolder); | |||
} | |||
|
|||
Sfpowerkit.initCache(); | |||
Sfpowerkit.initCache(true); |
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.
@azlam-abdulsalam
Why did you only optionally reseted the cache for the other two commands and forced it for the retrieve? Why not uniformly? The error can occur with every command. And is there anything against not flushing the cache when changing the org? Or to build the cache key with alias?
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.
same question here
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.
Reconcile is used in sfpowerscripts using a dual pass approach, so if we reset the second one will be expensive. Hence made optional, it makes sense though while you retrieve to ensure you ignore any existing cache.
Ideally the fix would be to be have a proper data structure, that caches for every org, as you proposed, but I do think this is a cheaper option for now to get this bug resolved, and then proceed to fix it later
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.
For me thats fine fore a temp fix. How do you decide if a cache is valid or not anymore?
The PR adds an additional flag --resetcache to merge/reconcile which provides ability to reset cache
as required among subsequent runs
fixes #1413
Summary generated by Reviewpad on 17 Oct 23 01:45 UTC
This pull request includes two patches.
The first patch fixes an issue in the profile merge and reconcile commands. It adds a new flag '--resetcache' which allows users to reset the cache and retrieve the latest profile permissions from the org. This fix addresses issue #1413.
The second patch fixes a formatting issue with the prettier in the sfpowerkit utility file.
Overall, these patches enhance the profile merge and reconcile commands and improve the formatting of the sfpowerkit utility.
Checklist
All items have to be completed before a PR is merged