Commit Graph

89 Commits

Author SHA1 Message Date
Nidhi
3b45db6df6
fix: Make git push operation atomic (#32777) 2024-04-19 10:16:32 +05:30
Nidhi
c51e4b810d
chore: Introduce changes to minimize git footprint (#32595) 2024-04-16 21:34:24 +05:30
Rudraprasad Das
15374ab016
fix: missing methods in gitexecutorceimpl (#32614)
Fixes broken builds due to missing overriden base methods

## Automation

/ok-to-test tags="@tag.Git"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8650609417>
> Commit: 9bf9e6d75b4bf29adfd65d16504ebcd2f451d32a
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8650609417&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->
2024-04-12 06:21:01 +05:30
Rudraprasad Das
f7118422c6
feat: granular git status (#31619)
## Description
Lists down changes in entity with level 1 granularity

Fixes #31644 

## Automation

/ok-to-test tags="@tag.Git"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8642841391>
> Commit: dd9dd7abb619a4e62edd950cbc6e64e15b4a42e2
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8642841391&attempt=1"
target="_blank">Click here!</a>

<!-- end of auto-generated comment: Cypress test results  -->









<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced granular tracking of Git changes, including added,
modified, and removed pages, datasources, queries, JS objects, and JS
libraries.
- Implemented a new feature flag `release_git_status_granular_enabled`
to toggle granular Git status tracking.
- Added new components to display detailed Git changes with expandable
views for different types of entities.

- **Enhancements**
- Simplified the logic for determining if a commit is required by
enhancing the Git status checks.
- Enhanced Git status display to include specific messages and icons for
various types of changes.
- Improved the Git sync feature's user interface with updated components
and styling for displaying Git changes.
	
- **Bug Fixes**
- Corrected the display logic to accurately reflect when a JS library is
added instead of modified.

- **Refactor**
- Refactored Git status handling logic on both client and server sides
for improved performance and readability.
- Updated test suites to align with the new Git status tracking and
display functionalities.

- **Tests**
- Added and updated tests to cover new Git status functionalities and
components.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-04-11 18:26:09 +05:30
Nidhi
6339b05670
chore: Added metrics on File I/O wrt git (#32433) 2024-04-09 21:16:10 +05:30
Manish Kumar
807f5606f0
chore: Git spans changed from enum to string (#32454) 2024-04-09 19:59:21 +05:30
Manish Kumar
fbae2dc83c
chore: server autocommit (#32387)
## Description
The purpose of this test file is to detect if code in Appsmith has
changed in a way which would reflect as uncommitted changes in
git-connected applications.

This test case would fail if we have added new domains, changed the
underlying structure of the domains, or how it's represented in domains.

It is intentionally kept to fail so that developers could identify if
their code has brought about these changes.

In order to make the test case pass, we would need to add the following
steps:

Once the test starts failing, that would mean that we need to increment
the serverSchemaVersion which is a constant in JsonSchemaVersions.java
by 1 count. After that, do the needful in JsonSchemaMigrations to update
the version number in incoming imports.
This is important so that the server code could detect that an
auto-commit is required for git-connected applications for a seamless
experience.

After step 1, this test case would still fail. In order to make the test
case work again, please replace the respective JSON with the updated
application JSON. Please take note that the Serialisation Objective
should be VERSION_CONTROL. In order to retrieve the updated JSON, one
could simply copy the serialized files from the test case itself.

After this there would be one issue left to deal with:
https://github.com/appsmithorg/appsmith/issues/32401

Fixes #32416
## Automation

/ok-to-test tags="@tag.Git"

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added functionality to reconstruct metadata from a Git repository for
workspace, application, repository, and branch information.
<!-- end of auto-generated comment: release notes by coderabbit.ai
--><!-- This is an auto-generated comment: Cypress test results -->
> [!IMPORTANT]  
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/8552624183>
> Commit: `48c393eb726f8ecc32b9b5fe01a0e4d4606f6333`
> Cypress dashboard url: <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=8552624183&attempt=1"
target="_blank">Click here!</a>
> All cypress tests have passed 🎉🎉🎉

<!-- end of auto-generated comment: Cypress test results  -->
2024-04-05 01:15:24 +05:30
Nidhi
0af7a45238
chore: Use a single gson object across service instead of reinitializing for each request (#32405) 2024-04-04 13:33:45 +05:30
Manish Kumar
d0162013f6
chore: analytics for GIT FS (#32302) 2024-04-02 20:55:19 +05:30
Shrikant Sharat Kandula
9afcf84d0d
chore: Fix double-brace-initialization (#31643)
This PR fixes all uses of double brace initialization, with ordinary
normal code.

It is usually advised to avoid Double brace initialization, especially
for building collections as it can cause very hard-to-troubleshoot bugs
with systems that use reflection a lot, like Spring, Hibernate, Jackson,
etc.

Almost every Java linter out there recommends to avoid this.

This can be configured in IntelliJ to show up as an error with the
following configuration. Please **please** do this.

![shot-2024-03-11-04-14-16](https://github.com/appsmithorg/appsmith/assets/120119/cc3d8c67-5dfc-4884-a36a-8f9e1aeea19f)
2024-03-11 11:54:25 +05:30
Manish Kumar
193f071982
chore: git refactor first set of apis (#31548) 2024-03-07 14:00:43 +05:30
Shrikant Sharat Kandula
b5e9ce8718
chore: Use Lombok's FieldNameConstants instead of QueryDSL (#31269)
QueryDSL will be replaced with Lombok's `FieldNameConstants` here. Why?

1. QueryDSL with JPA on relational databases doesn't lend itself very
well to nested data structures. But with MongoDB, it works quite well.
So we've come to rely on it quite a bit. Since we intend to move towards
a more flat, relation-ed and normalized DB design once we get to
Postgres, dealing with nested data structures should be seen as
temporary.

2. We only use QueryDSL for field name constants, and absolutely nothing
else. QueryDSL is a far more capable and powerful system, and is
overkill for this purpose. Lombok's annotation is exactly tuned for this
purpose and is more concise and easy-to-use.

3. QueryDSL query generation current doesn't work in IntelliJ, but
Lombok's does. So this will free us up from having to run a Maven build
when sometimes switching branches.

**PS**: This PR doesn't remove QueryDSL entirely. Only a part of it.
That'd become a much bigger PR and I'm already uncomfortable with the
size of this PR. Once this is merged, I'll open further PRs until we
completely remove QueryDSL.

**PPS**: QueryDSL is a powerful querying mechanism that we don't use
today. Perhaps once we're comfortable with Postgres in the future, we
will very likely revisit.
2024-02-26 16:33:07 +05:30
Nidhi
e622836794
fix: Split changes for git support in apps with mi bugs (#30997) 2024-02-08 14:07:51 +05:30
Nayan
4167cc288f
chore: Add all the changes as part of the auto commit (#30644)
## Description
Instead of writing only the pages during auto commit, this PR makes the
change to write all the application resources. If there's any migration
change in DSL, the following auto commit will include all the server
side changes due to change in data structures.
#### PR fixes following issue(s)
Fixes #30466

#### Media
#### Type of change
- Chore (housekeeping or task changes that don't impact user perception)

## Testing
>
#### How Has This Been Tested?
- [x] Manual
- [x] JUnit

#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [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
- [x] 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
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Introduced a new system for tracking and managing updated resources
within applications.

- **Refactor**
- Streamlined the process of checking if specific resources have been
updated.
- Enhanced the logic related to exporting application components such as
action collections, custom JavaScript libraries, and pages.

- **Bug Fixes**
- Fixed issues with resource tracking to ensure accurate reflection of
changes.

- **Tests**
- Added test cases to verify the functionality of the new resource
management system.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-05 16:58:59 +05:30
Nidhi
354cdb7eef
chore: Split for git with mi in apps (#30672) 2024-01-28 06:57:46 +05:30
Nidhi
861c6e0fa5
chore: Added changes for splitting git related files for mi (#30202) 2024-01-10 17:57:54 +05:30
Nayan
6a8fa4ef59
fix: Remove invalids field from auto commit (#29834)
## Description
During auto commit, the `invalids` field in the datsource was being
added and later removed by regular commit. Also older format js libs
were removed. This PR fixes this issue.

#### PR fixes following issue(s)
Fixes #29824

#### Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video
>
>
#### Type of change
- Bug fix (non-breaking change which fixes an issue)

## Testing
>
#### How Has This Been Tested?
- [x] Manual
- [ ] JUnit
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [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
- [x] My changes generate no new warnings
- [ ] 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
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Refactor**
- Improved the process for saving JS libraries by adding a change
detection mechanism.
- Enhanced data handling by refining the removal of unwanted fields from
the `DatasourceStorage` object.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2023-12-28 19:53:36 +05:30
Nayan
9525bede2f
fix: Change js lib file name in git to avoid file name error in windows (#29656)
## Description
This PR stops writing custom js libs to a file with the same name as
url.

#### PR fixes following issue(s)
Fixes #29655
2023-12-21 16:21:08 +06:00
Nayan
fba544d256
chore: Handled null pointer exception when updated resources is empty (#29630)
## Description
Added a null check in import application flow.

#### PR fixes following issue(s)
Fixes #29629
2023-12-15 12:39:03 +06:00
Nayan
6e8bfc63fb
feat: Added auto commit feature (#29439)
## Description
This PR adds the auto commit feature for git connected applications.

#### PR fixes following issue(s)
Fixes #26769
2023-12-12 12:13:56 +06:00
Nayan
3daa0a04a5
fix: Whitelist .MD and .github extensions when checking empty repository (#29301)
## Description
When user connects to Git, we check whether the repository is empty or
not. We allow certain types of files e.g.
#### PR fixes following issue(s)
Fixes #11430
2023-12-05 14:12:11 +06:00
Anagh Hegde
284e658854
fix: Call out message in git sync modal for JS library is incorrect (#28567)
## Description


#### PR fixes following issue(s)
Fixes https://github.com/appsmithorg/appsmith/issues/28563

#### Type of change
- Bug fix (non-breaking change which fixes an issue)

## Testing
#### How Has This Been Tested?
- [ ] Manual
- [ ] JUnit

#### Test Plan

#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed

---------

Co-authored-by: manish kumar <manish@appsmith.com>
2023-11-03 16:27:17 +05:30
Anagh Hegde
7d4ecdb7a6
chore: fix the jgit version updates in other places (#27558)
Should resolve the following CVE reports:

1. https://github.com/appsmithorg/appsmith/security/dependabot/263
1. https://github.com/appsmithorg/appsmith/security/dependabot/264
2023-09-22 13:16:04 +05:30
Nayan
4f1eee48cc
fix: Git import fails when pages directory contains a file (#27467)
## Description
It fixes the Git import failure bug when there's a file in the pages
directory.

#### PR fixes following issue(s)
Fixes #27466
2023-09-21 07:04:29 +06:00
Shrikant Sharat Kandula
9ea97c9db8
chore(deps): Update JGIT version (#27428)
Should resolve the following CVE reports:

1. https://github.com/appsmithorg/appsmith/security/dependabot/263
1. https://github.com/appsmithorg/appsmith/security/dependabot/264
2023-09-19 16:00:07 +05:30
Nayan
fdfb13643a
chore: Refactor default branch codes (#27104)
## Description
This PR refactors the code related to list of branches and default
branch. It separates different parts of the code into separate
functions.

#### PR fixes following issue(s)
Fixes #26875
2023-09-14 09:38:36 +05:30
Anagh Hegde
0168a31f06
test: canvas widget coverage junit (#26384)
## Description

Improve the coverage for Widgets in Junit

#### PR fixes following issue(s)
Fixes #25589
2023-08-16 22:05:59 +05:30
Nayan
db1c317599
feat: Create lightweight status api (#25857)
## Description
This PR brings those changes:
1. Creates a new API to know whether there are any uncommitted changes
or not
2. Creates a new API to compare the local branch with remote
3. Adds an optional parameter to the status API so that we can skip the
git fetch

#### PR fixes following issue(s)
Fixes #24340
2023-08-03 18:44:40 +05:30
Anagh Hegde
fdb45c8e66
fix: File lock issue git (#25504)
## Description


#### PR fixes following issue(s)
Fixes https://github.com/appsmithorg/appsmith/issues/24854

#### Type of change
- Bug fix (non-breaking change which fixes an issue)

## Testing
>
#### How Has This Been Tested?
- [ ] Manual

#### Test Plan

#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-07-27 15:54:34 +05:30
Anagh Hegde
bb7ab6d253
chore: Add file error logs (#25760)
Added error logs for the FileUtils flows.
2023-07-27 12:03:42 +05:30
Valera Melnikov
ab6cb4576b
fix: spotless server errors (#25483)
## Description
hotfix for spotless server errors

Co-authored-by: Valera Melnikov <melnikov.vv@greendatasoft.ru>
2023-07-19 12:51:40 +03:00
Anagh Hegde
3d566f4414
fix: tabs widget reading from file system (#25411)
fix the Tabs Widget issue for canvas split
2023-07-18 12:30:50 +05:30
Nidhi
d6e74bf012
chore: Applied Spotless formatter (#25173) 2023-07-07 00:43:11 +05:30
Anagh Hegde
578b82080f
feat: granular widgets for canvas (#24764)
## Description
Today if we have more than one collaborator on a page, merging is an
absolute nightmare. All of the widget config for a page is represented
in one single giant JSON blob in canvas.json this makes it very hard to
make isolated changes.

This PR is breaking down the git representation into smaller JSON files
that are aggregated by the running app.

Fixes https://github.com/appsmithorg/appsmith/issues/17033

#### Type of change
- New feature (non-breaking change which adds functionality)

## Testing
#### How Has This Been Tested?
- [ ] Manual
- [ ] Jest
- [ ] Cypress
- [ ] JUnit

#### Test Plan
#### Issues raised during DP testing
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed

---------

Co-authored-by: brayn003 <rudra@appsmith.com>
Co-authored-by: Parthvi <80334441+Parthvi12@users.noreply.github.com>
2023-07-03 20:43:04 +05:30
Anagh Hegde
7c65e35ee8
fix: rebase error message during conflicts (#24414)
## Description
Updated the error message for rebase during the conflicts state

Fixes https://github.com/appsmithorg/appsmith/issues/24391


#### Type of change
> Please delete options that are not relevant.
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update


## Testing
- [ ] Manual
- [ ] Jest
- [ ] Cypress

#### Test Plan
#### Issues raised during DP testing
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed

---------

Co-authored-by: Parthvi <80334441+Parthvi12@users.noreply.github.com>
2023-06-17 14:25:16 +05:30
Anagh Hegde
2f4c52cb5e
chore: revert git rebase with discard (#24479)
Due to one of the corrupted app state in release, we are going to revert
this and retest it and release later.

https://theappsmith.slack.com/archives/CTHN8GX5Y/p1686637493386649
2023-06-15 13:15:55 +05:30
Anagh Hegde
56d91190d6
feat: refactor git discrad flow (#23988)
## Description
Added the git rebase to the discard flow. This is to avoid the push
failure when due to branch protection rules.
Prev, it was discard and pull. This flow had above mentioned issue where
if the branch protection rule was present, then the local branch would
be in a bad state.

#### PR fixes following issue(s)
Fixes https://github.com/appsmithorg/appsmith/issues/23989

#### Type of change
- New feature (non-breaking change which adds functionality)

#### How Has This Been Tested?
- [ ] Manual

#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed

---------

Co-authored-by: brayn003 <rudra@appsmith.com>
Co-authored-by: Parthvi Goswami <parthvigoswami@Parthvis-MacBook-Pro.local>
2023-06-09 10:58:50 +05:30
Anagh Hegde
6a829a2af6
feat: Add support for yaml extension for the git connect flow validation (#24003)
## Description

#### PR fixes following issue(s)
Fixes https://github.com/appsmithorg/appsmith/issues/23417

#### Type of change
- New feature (non-breaking change which adds functionality)

## Testing
- [ ] Manual

#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Test-plan-implementation#speedbreaker-features-to-consider-for-every-change)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans/_edit#areas-of-interest)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-06-06 10:23:59 +05:30
Anagh Hegde
641ca391f5
fix: Git connected apps are showing a status error (#22046) 2023-04-04 06:09:43 +05:30
Anagh Hegde
439ceb5406
fix: Add null check before updating the body in actions (#21781)
## Description

> When an app which is connected to git which contains empty queries, is
imported shows uncommitted changes on opening git sync modal. This PR
fixes the issue.

Fixes #21742 

## Type of change

- Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?

- Manual

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-04-03 16:50:53 +05:30
Anagh Hegde
bfeab838f2
fix: do not create files for empty body of queries in the git repo (#21774)
We're currently creating an empty txt file even when there is no body
for an API call. For eg, in GET API calls. We should check whether there
is content in a file before creating the file.

Fixes #21683
2023-03-30 15:53:10 +05:30
Anagh Hegde
441f943637
fix: Added fix for the status API (#21321)
## Description

Fixed the status API call displaying the wrong number for the git.

---------

Co-authored-by: Tolulope Adetula <31691737+Tooluloope@users.noreply.github.com>
2023-03-10 17:27:39 +05:30
Anagh Hegde
4f9fe83646
feat: file structure v2 for actions (#20606)
## Description

> Ignore the body field while committing the JS Object related actions
to git repo.


Fixes https://github.com/appsmithorg/appsmith/issues/20550
https://github.com/appsmithorg/appsmith/issues/19546


## Type of change

- New feature (non-breaking change which adds functionality)


## How Has This Been Tested?

- Manual
- JUnit

### Test Plan
> Add Testsmith test cases links that relate to this PR

### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)


## Checklist:
### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-02-28 23:54:38 +05:30
Anagh Hegde
34822d563a
fix: Add file system locks after the git operation (#12174)
## Description

> Add file locking using redis with retry. Helpful when multiple users
are trying to perform git actions in the Appsmith UI.

Fixes #10856 
Fixes #14366

## Type of change


- Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

- Test A
- Test B

## 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
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes

---------

Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
Co-authored-by: Sidhant Goel <sidhant@appsmith.com>
Co-authored-by: Parthvi Goswami <parthvigoswami@Parthvis-MacBook-Pro.local>
Co-authored-by: System Administrator <root@Parthvis-MacBook-Pro.local>
2023-02-14 20:58:25 +05:30
Anagh Hegde
52e4d32a3f
feat: Separate the js object code and metadata when used with git sync (#19156)
As per current DB structure actions are embedded inside the JSObjects.
Every new method in JSObjects results in new action getting created in
DB. Consider user updates the JSObject.myFun1 then user will have
changes at 2 locations

Queries directory under myFun1 file
Body of JSObject1
We should not commit these duplicates and JSObject body should be
committed as is. These steps surely makes it easier to resolve the
conflicts even if occurs at same line.
2023-01-19 20:12:22 +05:30
Sumit Kumar
d33d35fbdb
fix: fix git sync related bugs for Custom JS Lib feature (#19352)
## Description
- Fix git import / export / status related bugs. Please check out this issue for more details : https://github.com/appsmithorg/appsmith/issues/19038
- Remove feature flag usage from the server side, since it was interfering with the JUnit TCs. Please note that the overall feature is still under feature flag since the client side also uses the same feature flag. 

Fixes #19038

## Type of change
- Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?
- Manual
- JUnit TC

Test plan is the same as the one present for https://github.com/appsmithorg/appsmith/pull/17895

Issues raised during QA
- [ ] https://github.com/appsmithorg/appsmith/pull/19352#issuecomment-1373626895

## Checklist:
### Dev activity
- [x] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] 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
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or manual QA
- [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
2023-01-10 19:26:48 +05:30
Nidhi
dfccd5a058
chore: Upgrade to Spring Boot 3.0.1 (#19044)
This upgrade takes care of our move to JDK 17, Spring Boot 3.0.1 and a
few other security upgrades along the way.

Fixes #18993 

TODO:

- [x] Check CI changes for Java 17
- [x] Check vulnerability report
- [x] Mongock needs an upgrade
- [x] Add JVM args at all possible places for exposing java.time module
- [x] Add type adapters everywhere / use the same config for type
adapters everywhere
2023-01-02 19:40:59 +07:00
Nidhi
81b257673f
chore: Upgraded Spring Boot and Spring to intermediate ver (#18844)
* chore: Upgraded Spring Boot and Spring to intermediate ver

* Introducing encryption version

* Added exit path on start up

* Fixed a few failures with release data

* Modified from property to init migration

* Removed prop

* Update app/server/appsmith-server/src/main/java/com/appsmith/server/configurations/InstanceConfig.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Added comment on prop

* Minor stuff

* Test fixes

* Removed test dir

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2022-12-22 15:59:20 +05:30
Anagh Hegde
82489a3ecd
fix: Add error message for protected branch (#18737)
* Add error message for protected branch

* Added Junit Test cases

* Add error message for protected branch

* Added Junit Test cases

* chore: push failed warning

* Add reset command

* Fix test failures

Co-authored-by: Anubhav <anubhav@appsmith.com>
2022-12-16 12:07:40 +05:30
Nidhi
66f3dfe790
chore: Move to Jupiter JUnit5 (#17083)
* Upgrading to Jupiter tests for everything but plugins

* Whoops, too soon

* Fixed failing tests

* Imports fixed

* Removed PowerMock dep and JUnit4 from interfaces

* Woohoo! That's testcontainers

* Added maven enforcer to disallow junit4

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/GitServiceTest.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserWorkspaceServiceTest.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ActionServiceCE_Test.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/CreateDBTablePageSolutionTests.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Weird formatting and version upgrades

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2022-09-29 08:54:07 +05:30