appsmith
appsmith copied to clipboard
fix: Refactor entities with specific rules
Description
This PR introduces more intelligence in the way we parse the DSL, actions and JS Objects during the refactor flow. Earlier, we used to treat each of these objects as plain maps that needed to be walked and performed a string replacement at any location where we found a match with the old name that was being refactored. However, this caused a few problems like ending up refactoring texts in the DSL that was not a binding but just happened to share the same keyword. Examples of these are when table names happened to have the same name as a widget name that is being refactored.
In this PR, we now only look at very specific paths in each type of object:
- For DSL:
- Only look at widgets
- Specifically look at widget names
- Parse through paths identified to contain dynamic bindings or dynamic triggers
- In case of list, also look at templates
- For actions:
- Parse through paths identified to contain dynamic bindings or dynamic triggers
- For JS Objects:
- For an JS function that has been refactored, also update the complete body string for that action collection
Fixes #6760
Type of change
- Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
- Manual testing
- JUnit tests
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| appsmith | ✅ Ready (Inspect) | Visit Preview | Oct 20, 2022 at 6:05PM (UTC) |
Deployment failed with the following error:
Resource is limited - try again in 27 minutes (more than 100, code: "api-deployments-free-per-day").
Deployment failed with the following error:
Resource is limited - try again in 29 minutes (more than 100, code: "api-deployments-free-per-day").
Deployment failed with the following error:
Resource is limited - try again in 8 minutes (more than 100, code: "api-deployments-free-per-day").
/ok-to-test sha=21964bb
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/3288919659.
Workflow: Appsmith External Integration Test Workflow.
Commit: 21964bb.
PR: 17523.
Perf tests will be available at https://app.appsmith.com/app/performance-infra-dashboard/pr-details-63465d4789020c7ac296d08d?pr=17523&runId=3288919659_1