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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: better "Export customizations" #25918

Merged
merged 5 commits into from Apr 11, 2024
Merged

Conversation

ankush
Copy link
Member

@ankush ankush commented Apr 11, 2024

If you use "Export customization" feature, the sync process will always override with customization stored in code. This is undesirable in most use cases.

Fixes:

  • Property setters are synced and not overridden
  • Custom docperms can't do this, but they are now not exported by default
  • A warning is added about custom docperm behaviour
  • sync_on_migrate=False now at least syncs on install. If it was set to false the code wasn't doing anything 馃挬

Closes #25458

This also isn't ideal. Deleted prop setters won't be "synced" every with this design... but that seems better than wiping out random unknown changes.

@ankush ankush requested a review from a team as a code owner April 11, 2024 12:46
@ankush ankush requested review from akhilnarang and removed request for a team April 11, 2024 12:46
@ankush ankush added backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15 labels Apr 11, 2024
@ankush ankush changed the title fix!: Sync prop setters instead of overriding fix!: better "Export customizations" Apr 11, 2024
@ankush ankush merged commit 15310b1 into frappe:develop Apr 11, 2024
23 of 24 checks passed
@ankush ankush deleted the sync_customization branch April 11, 2024 13:35
@ankush ankush removed backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15 labels Apr 11, 2024
ankush added a commit that referenced this pull request Apr 12, 2024
* fix!: Sync property setter instead of overriding them

(cherry picked from commit 526ff3b)

* test: remove usage of _testMethodName

Makes things hard to read with code all over the place and tied to test name.

(cherry picked from commit 0fcd032)

* test: prop setter syncing

(cherry picked from commit 9245062)

* fix(DX): Warn about custom docperm behaviour

(cherry picked from commit 12a8e9e)

* fix: Sync customization on first install if not sync_on_migrate

If not sync_on_migrate right now this code isn't doing anything :hanky:

(cherry picked from commit 51d41ea)

---------

Co-authored-by: Ankush Menat <ankush@frappe.io>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2024
@ankush ankush added backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15 labels Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customisation sync_on_migrate either does an exact sync or nothing at all
1 participant