Skip to content

Commit

Permalink
chore: Move appsmithctl to RTS (#37531)
Browse files Browse the repository at this point in the history
Move the `appsmithctl` code to RTS.

RTS' own build system will build `appsmithctl` as well. We're adding two
command scripts, `ctl` and `appsmithctl` to `/opt/bin`, which will be
the entrypoints for this. The `appsmithctl` is now just an alias to the
much shorter and non-redundancy-inducing `ctl`.

We aren't migrating to TypeScript in this PR so we're ignoring the new
`ctl` folder in both `tsconfig.json` and `.eslintrc`. That's temporary,
the next PR will fix that.


## Automation

/test 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/11930931528>
> Commit: 90b5f97
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11930931528&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.Sanity`
> Spec:
> <hr>Wed, 20 Nov 2024 10:36:02 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

## Release Notes

- **New Features**
  - Introduced the `appsmithctl` command for easier command execution.
  - Updated build process to include additional entry points.

- **Bug Fixes**
- Streamlined Docker build process, enhancing efficiency and reducing
complexity.

- **Documentation**
- Added a new section in the README for `appsmithctl` command
description.

- **Chores**
  - Updated dependencies in `package.json`.
  - Removed obsolete files and workflows to simplify project structure.

- **Style**
  - Added a new ESLint configuration for specific project needs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
sharat87 authored Nov 20, 2024
1 parent f21ec5e commit 81b7727
Show file tree
Hide file tree
Showing 29 changed files with 203 additions and 8,802 deletions.
99 changes: 0 additions & 99 deletions .github/workflows/appsmithctl.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/docs/integration-tests-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ The `client-build` job builds the client-side codebase. It uses the configuratio

The `rts-build` job builds the "rts" (real-time suggestions) package of the client-side codebase. It uses the configuration defined in the `.github/workflows/rts-build.yml` file.

### `test-appsmithctl`

The `test-appsmithctl` job runs tests for the `appsmithctl` utility. It uses the configuration from the `.github/workflows/appsmithctl.yml` file.

### `build-docker-image`

The `build-docker-image` job builds and pushes the Docker image for the application. It depends on the successful completion of the `client-build`, `server-build`, and `rts-build` jobs. The Docker image is built with support for both `linux/arm64` and `linux/amd64` platforms.
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/pr-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ jobs:
with:
pr: ${{ github.event.number }}

test-appsmithctl:
if: success()
name: appsmithctl
uses: ./.github/workflows/appsmithctl.yml
secrets: inherit
with:
pr: ${{ github.event.number }}

build-docker-image:
needs: [client-build, server-build, rts-build]
# Only run if the build step is successful
Expand Down
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/**/* @sh
# DevOps & Shri
deploy/**/* @sharat87 @pratapaprasanna
.github/workflows/*.yml @sharat87
app/client/packages/ctl/**/* @sharat87 @pratapaprasanna
app/server/**/pom.xml @sharat87
app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/BaseAppsmithRepositoryCEImpl.java @sharat87
app/server/appsmith-server/src/main/java/com/appsmith/server/repositories/ce/params/QueryAllParams.java @sharat87
Expand Down
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,11 @@ COPY ./app/client/build editor/
# Add RTS - Application Layer
COPY ./app/client/packages/rts/dist rts/

ENV PATH /opt/bin:/opt/appsmith/utils/node_modules/.bin:/opt/java/bin:/opt/node/bin:$PATH
ENV PATH /opt/bin:/opt/java/bin:/opt/node/bin:$PATH

RUN <<END
set -o errexit

cd ./utils
npm install --only=prod
npm install --only=prod -g .
rm -rf utils/node_modules/resolve/test
cd -

# Make all `*.sh` files executable, excluding `node_modules`.
find . \( -name node_modules -prune \) -o \( -type f -name '*.sh' \) -exec chmod +x '{}' +

Expand Down
2 changes: 1 addition & 1 deletion app/client/packages/rts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const getWorkflowDependencies = () => {
const bundle = async () => {
return esbuild
.build({
entryPoints: ["src/server.ts"],
entryPoints: ["src/server.ts", "src/ctl/index.js"],
bundle: true,
sourcemap: true,
platform: "node",
Expand Down
4 changes: 4 additions & 0 deletions app/client/packages/rts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
"@opentelemetry/semantic-conventions": "^1.27.0",
"@shared/ast": "workspace:^",
"axios": "^1.7.4",
"dotenv": "10.0.0",
"express": "^4.20.0",
"express-validator": "^6.14.2",
"http-status-codes": "^2.2.0",
"loglevel": "^1.8.1",
"mongodb": "^5.8.0",
"nodemailer": "6.9.9",
"readline-sync": "1.4.10",
"socket.io": "^4.6.2"
},
"devDependencies": {
Expand Down
15 changes: 15 additions & 0 deletions app/client/packages/rts/src/ctl/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": ["../../../../.eslintrc.base.json"],
"rules": {
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/no-explicit-any": "off",
"testing-library/no-debugging-utils": "off",
"@typescript-eslint/no-var-requires": "off",
"padding-line-between-statements": "off",
"no-console": "off",
"@typescript-eslint/promise-function-async": "off",
"@typescript-eslint/no-unused-vars": "off",
"sort-destructure-keys/sort-destructure-keys": "off"
}
}
3 changes: 3 additions & 0 deletions app/client/packages/rts/src/ctl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `appsmithctl`

This is the source for the `appsmithctl` command in Appsmith containers.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 81b7727

Please sign in to comment.