chore: adds depandabot.yml (#40521)

## Description
We are implementing this to control Dependabot alerts and prevent
flagging of the TinyMCE library, which we are maintaining at version
6.8.3.

* Additionally, we have reverted the change that checks for TinyMCE
version updates in the pre-commit hook. Managing this within the
Dependabot configuration file is a better approach.

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## 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/14770091908>
> Commit: bc960270a70184b00bfee7789dd3ae3d0c2cf7b5
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14770091908&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Thu, 01 May 2025 05:43:58 UTC
<!-- end of auto-generated comment: Cypress test results  -->


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


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

- **Chores**
- Added automated dependency update configuration to streamline npm
package management, with specific rules for update frequency, labeling,
and commit message formatting.
- **Refactor**
- Simplified pre-commit checks by removing restrictions related to
TinyMCE version changes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Rahul Barwal 2025-05-01 11:14:04 +05:30 committed by GitHub
parent cb163bb6f5
commit fb7c3d1a07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 21 deletions

27
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,27 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/app/client"
schedule:
interval: "weekly"
ignore:
- dependency-name: "tinymce"
versions: ["6.8.3"]
open-pull-requests-limit: 5
labels:
- "dependencies"
- "javascript"
commit-message:
prefix: "chore"
include: "scope"
- package-ecosystem: "maven"
directory: "/app/server"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "java"
commit-message:
prefix: "chore"
include: "scope"

View File

@ -2,24 +2,12 @@
is_server_change=$(git diff --cached --name-only | grep -c "app/server")
is_client_change=$(git diff --cached --name-only | grep -c "app/client")
is_package_json_change=$(git diff --cached --name-only | grep -c "app/client/package.json")
is_merge_commit=$(git rev-parse -q --verify MERGE_HEAD)
# Function to check TinyMCE version changes
check_tinymce_version() {
# Check if TinyMCE version is being changed
if git diff --cached app/client/package.json | grep -q '^-.*"tinymce": "6\.8\.3"' &&
git diff --cached app/client/package.json | grep -q '^+.*"tinymce": "[^"]*"'; then
echo "❌ Error: Attempting to change TinyMCE version. This is not allowed as per team decision."
echo "Please keep TinyMCE at version 6.8.3"
exit 1
fi
}
# Function to apply Spotless and only commit staged files
apply_spotless_and_commit_staged_files() {
staged_server_files=$(git diff --cached --name-only | grep "app/server" | sed 's|app/server/||')
staged_server_files=$(git diff --cached --name-only | grep "app/server"| sed 's|app/server/||')
mvn spotless:apply
# Check if Spotless succeeded
if [ $? -ne 0 ]; then
@ -33,16 +21,11 @@ apply_spotless_and_commit_staged_files() {
if [ "$is_merge_commit" ]; then
echo "Skipping server and client checks for merge commit"
else
if [ "$is_package_json_change" -ge 1 ]; then
echo "Checking package.json changes..."
check_tinymce_version
fi
if [ "$is_server_change" -ge 1 ]; then
echo "Applying Spotless to server files..."
pushd app/server >/dev/null
pushd app/server > /dev/null
apply_spotless_and_commit_staged_files
popd >/dev/null
popd > /dev/null
else
echo "Skipping server side check..."
fi