-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Remove unused new
from JSON exports/responses
#34652
Conversation
This field isn't used on client and so shouldn't be sent across. /test sanity <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9756721589> > Commit: ea11761 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9756721589&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved data handling by modifying visibility annotations, enhancing security and data privacy. - **Tests** - Updated tests to align with changes in data visibility, ensuring accurate validation of JSON responses. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
WalkthroughThe recent changes involve cleanup and streamlining of JSON fixture files and Java classes. The modifications primarily include the removal of the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
new
from JSON exports/responses
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- app/client/cypress/fixtures/PartialImportExport/CustomJsLibsExportedOnly.json (1 hunks)
- app/client/cypress/fixtures/PartialImportExport/DatasourceExportedOnly.json (1 hunks)
- app/client/cypress/fixtures/PartialImportExport/JSExportedOnly.json (1 hunks)
- app/client/cypress/fixtures/PartialImportExport/QueriesExportedOnly.json (1 hunks)
- app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/BaseDomain.java (2 hunks)
- app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java (1 hunks)
Files skipped from review due to trivial changes (4)
- app/client/cypress/fixtures/PartialImportExport/CustomJsLibsExportedOnly.json
- app/client/cypress/fixtures/PartialImportExport/DatasourceExportedOnly.json
- app/client/cypress/fixtures/PartialImportExport/JSExportedOnly.json
- app/server/appsmith-server/src/test/java/com/appsmith/server/configurations/CommonConfigTest.java
Additional context used
Path-based instructions (1)
app/client/cypress/fixtures/PartialImportExport/QueriesExportedOnly.json (1)
Pattern
app/client/cypress/**/**.*
: Follow best practices for Cypress code and e2e automation.
Avoid using cy.wait in code.
Avoid using cy.pause in code.
Use variables for locators, not strings.
Usedata-*
attributes for selectors; avoid Xpaths and CSS attributes.
Avoid selectors like.btn.submit
orbutton[type=submit]
.
Perform logins via API withLoginFromAPI
.
Only interact with controlled sites/servers.
Ensure tests can run withit.only
and are independent.
Usebefore
,beforeEach
,after
,afterEach
correctly; clean state before tests.
Check new specs for flakiness by running them 10 times on CI.
Use multiple assertions; don't treat Cypress as unit tests.
Use constants for strings.
Include datasource operations inbefore
hooks.
Additional comments not posted (4)
app/server/appsmith-interfaces/src/main/java/com/appsmith/external/models/BaseDomain.java (1)
82-84
: Change approved:isNew()
method annotation updatedThe annotation change from
@JsonView(Views.Public.class)
to@JsonIgnore
ensures theisNew()
method is no longer serialized in JSON responses, aligning with the PR objective.app/client/cypress/fixtures/PartialImportExport/QueriesExportedOnly.json (3)
1-1
: Change approved:InsertQuery
configuration updatedThe removal of specific field values like
insert_form.formData.*
aligns with the PR objective of eliminating unused fields. No issues are found.
1-1
: Change approved:DeleteQuery
configuration updatedThe removal of specific field values like
data_table.triggeredRow.id
aligns with the PR objective of eliminating unused fields. No issues are found.
1-1
: Change approved:UpdateQuery
configuration updatedThe removal of specific field values like
update_form.fieldState.*
aligns with the PR objective of eliminating unused fields. No issues are found.
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.
Minor comment!
@@ -78,7 +79,7 @@ public abstract class BaseDomain implements Persistable<String>, AppsmithDomain, | |||
protected Set<Policy> policies = new HashSet<>(); | |||
|
|||
@Override | |||
@JsonView(Views.Public.class) | |||
@JsonIgnore | |||
public boolean isNew() { | |||
return this.getId() == null; | |||
} |
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.
If this is not being used anywhere in the code does it make sense to remove this piece of code completely.
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.
Oh it's being used in the server code, quite a bit. It's also important in pg
, where we use this in our overridden .save
method in BaseCake
. Just that the client doesn't need it, so we should send it across. Server very much uses and needs it.
…4652) This field isn't used on client and so shouldn't be sent across. EE PR at https://github.com/appsmithorg/appsmith-ee/pull/4466. All pass. **/test all** <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9853291119> > Commit: 22f7383 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9853291119&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.All` > Spec: > <hr>Tue, 09 Jul 2024 09:02:56 UTC <!-- end of auto-generated comment: Cypress test results --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Resolved JSON formatting issues in several export fixture files. - Removed unnecessary field values from action configurations to ensure cleaner and more efficient data handling. - **Refactor** - Updated the `isNew` method's annotation in `BaseDomain.java` to improve JSON serialization behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This field isn't used on client and so shouldn't be sent across.
EE PR at https://github.com/appsmithorg/appsmith-ee/pull/4466. All pass.
/test all
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/9853291119
Commit: 22f7383
Cypress dashboard.
Tags:
@tag.All
Spec:
Tue, 09 Jul 2024 09:02:56 UTC
Summary by CodeRabbit
Bug Fixes
Refactor
isNew
method's annotation inBaseDomain.java
to improve JSON serialization behavior.