Commit Graph

15 Commits

Author SHA1 Message Date
Abhijeet
24ec7954a2
feat: Add instanceId to distributed lock keys for multi-instance isolation (#40966) 2025-06-19 12:20:59 +05:30
Abhijeet
5f3b6b8b24
feat: Restrict cron execution for single pod in clustered environment (#39171)
## Description
PR to update crons:
1. Execute crons for all orgs present in the DB
2. Add distributed locking mechanism to run cron by a single pod in
multi-clustered setup
3. Add orgId in the analytics event which are part of cron to filter
based on the combination of instanceId and orgId

##### TODOs:
1. Need to introduce a way to pass orgId while fetching organization
level feature flags
- When fetching flags for anonymous user orgId is not present in the
session
- While using methods annotated with @FeatureFlagged without the user
context (server internal workflow)
2. Currently we are fetching status of license and org level feature
flags at the startup, which was fine but going forward to avoid initial
delay we need to find better alternative to this.

Fixes https://github.com/appsmithorg/appsmith/issues/39068,
https://github.com/appsmithorg/appsmith/issues/39388

/test All

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!IMPORTANT]
> 🟣 🟣 🟣 Your tests are running.
> Tests running at:
<https://github.com/appsmithorg/appsmith/actions/runs/13519994895>
> Commit: c1b8e5de730f04c2a50966a95c061138af658955
> Workflow: `PR Automation test suite`
> Tags: `@tag.All`
> Spec: ``
> <hr>Tue, 25 Feb 2025 11:19:31 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


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

## Summary by CodeRabbit

- **New Features**
- Enhanced organization management with dynamic feature flag updates and
improved restart handling.
- Added distributed locking to scheduled background tasks for increased
stability and reliability in multi-tenant environments.
- Introduced new methods for retrieving all organizations and managing
organization configurations.
- New logging capabilities for better visibility into method invocation
failures.

- **Refactor**
- Streamlined internal workflows with enhanced logging and optimized
reactive processing, ensuring better monitoring and system
responsiveness.
- Improved method signatures and error handling for better clarity and
functionality.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-02-25 17:20:11 +05:30
Arpit Mohan
17d5d6eb00
chore: Upgrading spring to 3.3.3 to resolve vulnerable dependencies (#36266)
Co-authored-by: Nidhi Nair <nidhi@appsmith.com>
2024-10-01 22:12:56 +05:30
subratadeypappu
9a2606618f
chore: introduce caching and projection to optimise FPL (#36118)
## Description
This PR aims to enhance the performance of the pages span in
consolidated-API view mode. It does so by brining the following changes

- **Add Projection:** Implement projections to enhance performance for
`appsmith.consolidated-api.view.pages.getpage`.
- **Implement Caching:** Introduce caching to eliminate the `getpage`
query, thereby optimizing
`appsmith.consolidated-api.view.application_id` and related spans.
    
We will implement caching to store `defaultApplicationId` information in
memory. This cache will reduce the need for the time-consuming `getpage`
query. On a cache miss, the system will first fetch the page and then
the branched application. If the information is present in the cache, it
will directly retrieve the branched application, leveraging the cached
data for improved efficiency.

With these changes, the pages API is showing improvements. A few
screenshots from local environment:

![Screenshot 2024-09-04 at 6 57
01 PM](https://github.com/user-attachments/assets/c5e91d81-7902-4f58-8d18-8c16e92af540)
![Screenshot 2024-09-04 at 6 57
46 PM](https://github.com/user-attachments/assets/3b99000e-2236-41cc-8955-b8b30780ee87)
![Screenshot 2024-09-04 at 7 03
17 PM](https://github.com/user-attachments/assets/ff60d8cb-2588-40a7-ad82-b132da6dba72)
![Screenshot 2024-09-04 at 7 12
47 PM](https://github.com/user-attachments/assets/e528ebc7-b48d-4632-a44c-4a6b3cbb2cf8)



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

## Automation

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

### 🔍 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/10778438378>
> Commit: 25e71b594261a318ef6204603a225c3136892a89
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10778438378&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Mon, 09 Sep 2024 18:03:52 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


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

## Summary by CodeRabbit

- **New Features**
- Enhanced page retrieval capabilities with additional parameters for
improved data handling.
- Introduced a caching mechanism for optimized retrieval of application
IDs in view mode.
- Added support for bulk cache eviction through the `@CacheEvict`
annotation.

- **Bug Fixes**
- Adjusted method signatures in tests to align with updated service
methods, ensuring proper functionality.

- **Documentation**
- Updated test cases to reflect changes in method parameters for clarity
and accuracy.

- **Chores**
- Refactored method calls across various services and tests to
incorporate new parameters and improve overall performance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: “sneha122” <“sneha@appsmith.com”>
2024-09-10 00:04:22 +06:00
Nidhi
c51e4b810d
chore: Introduce changes to minimize git footprint (#32595) 2024-04-16 21:34:24 +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
Shrikant Sharat Kandula
e26d7ec8b3
chore(deps): Update pf4j to v3.10.0 (#27044)
This includes fixes for the following High-severity Dependabot alerts:

1. https://github.com/appsmithorg/appsmith/security/dependabot/256
2. https://github.com/appsmithorg/appsmith/security/dependabot/257
3. https://github.com/appsmithorg/appsmith/security/dependabot/258
4. https://github.com/appsmithorg/appsmith/security/dependabot/259
5. https://github.com/appsmithorg/appsmith/security/dependabot/260
6. https://github.com/appsmithorg/appsmith/security/dependabot/261
2023-09-07 08:48:45 +05:30
Nidhi
d6e74bf012
chore: Applied Spotless formatter (#25173) 2023-07-07 00:43:11 +05:30
sidhantgoel
b73d41929d
fix for caching library autoconfiguration (#19849)
> Pull Request Template
>
> Use this template to quickly create a well written pull request.
Delete all quotes before creating the pull request.

## Description
Spring Boot 2.7 introduced a new
META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
file for registering auto-configurations, while maintaining backwards
compatibility with registration in spring.factories. With this release,
support for registering auto-configurations in spring.factories has been
removed in favor of the imports file.
> Please include a summary of the changes and which issue has been
fixed. Please also include relevant motivation
> and context. List any dependencies that are required for this change
> Links to Notion, Figma or any other documents that might be relevant
to the PR

> Add a TL;DR when description is extra long (helps content team)

Fixes # (issue)
> if no issue exists, please create an issue and ask the maintainers
about this first


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

> 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


## How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Provide
instructions, so we can reproduce.
> Please also list any relevant details for your test configuration.
> Delete anything that is not important

- Manual
- 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
- [ ] 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-01-17 22:18:42 +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
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
Trisha Anand
936ef75841
chore: Adding cache logs for debugging (#17029) 2022-09-23 23:24:27 +05:30
Shrikant Sharat Kandula
8a0838505a
All outgoing requests should go through the configured proxy (#14427)
Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-01 11:16:45 +05:30
Trisha Anand
8f3591615a
feat: RBAC framework (#14823)
Co-authored-by: Sidhant Goel <sidhant@appsmith.com>
Co-authored-by: Ankita Kinger <ankita@appsmith.com>
Co-authored-by: Sangeeth Sivan <sangeeth@appsmith.com>
Co-authored-by: Parthvi <80334441+Parthvi12@users.noreply.github.com>
2022-08-22 23:27:07 +05:30
sidhantgoel
4c56cc5bda
feat: Annotation based Caching library similar to spring's Cacheable with WebFlux support (#14416)
* added reactive caching module

Signed-off-by: Sidhant Goel <sidhant@appsmith.com>

* CacheManager and implementation

* updated root level pom.xml

* removed spring boot maven plugin from project reactiveCaching

* Support for key annotation

* moved conditional on annotation

* Added comments

* Update app/server/reactive-caching/src/main/java/com/appsmith/caching/aspects/ReactiveCacheAspect.java

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>

* Update app/server/reactive-caching/src/main/java/com/appsmith/caching/aspects/ReactiveCacheAspect.java

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>

* Update app/server/reactive-caching/src/main/java/com/appsmith/caching/aspects/ReactiveCacheAspect.java

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>

* review changes

* addressed review comments

Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
2022-07-28 21:45:47 +05:30