-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Rtl #36765
Rtl #36765
Conversation
WalkthroughThe pull request introduces updates to the Changes
Possibly related PRs
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
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: 2
🧹 Outside diff range and nitpick comments (1)
.github/workflows/github-release.yml (1)
258-260
: Let's add a safety net to our script check!While simplifying our code is generally good, we want to ensure we're not introducing potential issues. The current check for the server artifacts preparation script could be more robust.
Consider updating the script check to provide more information if the file is missing:
if [[ -f scripts/prepare_server_artifacts.sh ]]; then scripts/prepare_server_artifacts.sh else echo "Warning: scripts/prepare_server_artifacts.sh not found. Skipping server artifacts preparation." fiThis way, if the script is ever accidentally removed or moved, we'll have a clear indication in our workflow logs. Remember, in the classroom of DevOps, clear communication is key!
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/github-release.yml (4 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/github-release.yml
[error] 278-278: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (3)
.github/workflows/github-release.yml (3)
30-34
: Well done on adding DockerHub authentication, class!Adding the DockerHub login step is an excellent practice. It ensures that we have the proper authentication in place before performing any Docker-related operations. This is a crucial step in maintaining the security and integrity of our workflow.
48-48
: A gold star for updating our build environment!Excellent choice in updating the runner to
ubuntu-latest
! This change ensures that our client build always uses the most recent stable Ubuntu version provided by GitHub Actions. It's like always having the latest textbook edition for our class!This update brings several benefits:
- We'll automatically get the latest security patches.
- We'll have access to the most recent software versions.
- It reduces the need for manual updates to the workflow file when new Ubuntu versions are released.
Keep up the good work in maintaining our CI/CD pipeline!
217-218
: A round of applause for updating our Docker toolbox!You've done an excellent job updating our Docker-related actions:
- Upgrading to
docker/setup-buildx-action@v2
- Moving to
docker/login-action@v2
- Adopting
docker/build-push-action@v3
These updates ensure we're using the latest features and security improvements in our Docker workflow. It's like upgrading all our lab equipment - everything runs smoother and safer!
I'm particularly impressed with the use of secrets and variables in the Docker build arguments. This is a fantastic security practice that helps protect our sensitive information.
Keep up this diligent work in maintaining our CI/CD pipeline!
Also applies to: 262-265, 268-275
echo ${{ secrets.DOCKER_HUB_USERNAME }} | ||
echo "PWD: $PWD" | ||
echo "GITHUB_REF: $GITHUB_REF" | ||
echo "GITHUB_SHA: $GITHUB_SHA" | ||
echo "GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME" |
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.
Let's be careful with our secrets, students!
I noticed that we're echoing the DockerHub username, which is stored as a secret. While it's important to have visibility into our environment, we must be cautious about potentially exposing sensitive information in our logs.
Consider removing or masking the DockerHub username output:
- echo ${{ secrets.DOCKER_HUB_USERNAME }}
+ echo "DOCKER_HUB_USERNAME: ***"
This way, we maintain visibility without risking the exposure of our DockerHub credentials. Remember, in the world of DevOps, secrecy is golden!
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
echo ${{ secrets.DOCKER_HUB_USERNAME }} | |
echo "PWD: $PWD" | |
echo "GITHUB_REF: $GITHUB_REF" | |
echo "GITHUB_SHA: $GITHUB_SHA" | |
echo "GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME" | |
echo "DOCKER_HUB_USERNAME: ***" | |
echo "PWD: $PWD" | |
echo "GITHUB_REF: $GITHUB_REF" | |
echo "GITHUB_SHA: $GITHUB_SHA" | |
echo "GITHUB_EVENT_NAME: $GITHUB_EVENT_NAME" |
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}} | ||
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:latest |
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.
Don't forget to dot your i's and cross your t's!
Eagle-eyed students might have noticed that we're missing a new line at the end of our file. While it might seem trivial, following YAML best practices helps maintain consistency and can prevent unexpected behavior in some parsers.
Let's add that missing new line:
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}}
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:latest
+
Remember, attention to detail is what separates a good DevOps engineer from a great one!
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}} | |
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:latest | |
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}} | |
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:latest | |
🧰 Tools
🪛 yamllint
[error] 278-278: no new line character at the end of file
(new-line-at-end-of-file)
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: 1
🧹 Outside diff range and nitpick comments (3)
app/client/src/sagas/InitSagas.ts (3)
Line range hint
107-109
: Undefined functionembedRedirectURL
causes a runtime errorDear student, I noticed that the function
embedRedirectURL
is being called in the error handling block, but it is neither imported nor defined within this file. This will lead to a runtime error when the code attempts to execute this function.To resolve this, you should import
embedRedirectURL
from the appropriate module. Assuming it is defined in./ErrorSagas
, you can modify the import statement as follows:import { validateResponse } from "./ErrorSagas"; +import { embedRedirectURL } from "./ErrorSagas";
Alternatively, if the function has been moved or renamed, please update the code accordingly.
Line range hint
196-200
: Empty catch block may hide errorsDear student, in the
eagerPageInitSaga
function, there's a catch block that does not handle the caught exceptione
. Ignoring exceptions can make debugging difficult and may lead to unnoticed errors in production.Consider adding error handling within the catch block, such as logging the error:
try { yield call(getInitResponses, { shouldInitialiseUserDetails: true, mode: APP_MODE.PUBLISHED, }); -} catch (e) {} +} catch (e) { + log.error(e); + // Handle the error appropriately +}This way, any errors encountered during initialization will be properly logged and can be addressed promptly.
Line range hint
85-87
: Avoid usingany
type to enhance type safetyDear student, I observe that the function
getInitResponses
is currently typed to returnany
. Using theany
type can undermine the benefits of TypeScript's static type checking and potentially introduce bugs.Consider defining a specific return type for this function to improve code safety and maintainability. If the return type is complex, you might define an interface or type alias to represent it. Would you like assistance in crafting the appropriate type definition?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
- app/client/.husky/check-staged-files.sh (1 hunks)
- app/client/package.json (1 hunks)
- app/client/src/sagas/InitSagas.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- app/client/.husky/check-staged-files.sh
🧰 Additional context used
@@ -17,7 +17,7 @@ | |||
], | |||
"scripts": { | |||
"analyze": "yarn cra-bundle-analyzer", | |||
"start": "BROWSER=none REACT_APP_ENVIRONMENT=DEVELOPMENT REACT_APP_CLIENT_LOG_LEVEL=debug HOST=dev.appsmith.com craco --max_old_space_size=4096 start", | |||
"start": "BROWSER=none EXTEND_ESLINT=true REACT_APP_ENVIRONMENT=DEVELOPMENT REACT_APP_CLIENT_LOG_LEVEL=debug HOST=0.0.0.0 craco --max_old_space_size=7168 start", |
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.
💡 Codebase verification
Attention to Configuration Consistency!
It appears that while the start
script has been successfully updated, the test
and test:ci
scripts still reference https://dev.appsmith.com
. To maintain consistency and avoid potential conflicts or unexpected behaviors, please update these scripts accordingly.
- Update
CYPRESS_BASE_URL
in test scripts:- File:
app/client/package.json
- Lines:
"test": "CYPRESS_BASE_URL=https://dev.appsmith.com cypress/test.sh", "test:ci": "CYPRESS_BASE_URL=https://dev.appsmith.com cypress/test.sh --env=ci",
- File:
Please ensure all instances of the old HOST
value are updated to match the new configuration.
🔗 Analysis chain
Class, let's examine the changes in our development environment setup!
Now, pay attention to the modifications in our start
script:
-
We've changed the
HOST
fromdev.appsmith.com
to0.0.0.0
. This is like opening our classroom doors to everyone! It allows connections from any available network interface, which is excellent for testing across different devices. -
We've also increased our
max_old_space_size
from 4096 to 7168. Think of this as giving our application a bigger brain! It allows for more memory usage, which can be beneficial for larger projects or when working with complex data structures.
However, remember that with great power comes great responsibility. Make sure your development machine can handle this increased memory allocation.
Any questions about these changes?
Let's run a quick check to ensure our changes don't conflict with any other scripts:
Great effort so far! Let's ensure we're searching in the right places.
It looks like the previous attempt couldn't find the package.json
file. No worries! We'll adjust our approach to locate all instances of package.json
in the repository and then search within them for the specified patterns.
Here's a script to help us with that:
Let's run this script to verify that the changes we've made are consistent across all relevant package.json
files.
Great job sticking with this! Let's dive deeper into our package.json
file.
It seems our previous search didn't find the package.json
file. No worries! We'll now target the specific location to ensure everything is in order.
Here's a new script to check the app/client/package.json
file directly:
Let's execute this to confirm that our changes are consistent within the app/client/package.json
file.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the new HOST and max_old_space_size values are used consistently across all scripts
# Test: Search for any other occurrences of dev.appsmith.com or the old max_old_space_size value
rg 'dev\.appsmith\.com|--max_old_space_size=4096' package.json
Length of output: 117
Script:
#!/bin/bash
# Description: Locate all package.json files and search for specific patterns to ensure consistency.
# Find all package.json files and search for occurrences of 'dev.appsmith.com' or '--max_old_space_size=4096'
fd 'package\.json' . -x grep -H 'dev\.appsmith\.com|--max_old_space_size=4096' {}
Length of output: 85
Script:
#!/bin/bash
# Description: Search for 'dev.appsmith.com' and '--max_old_space_size=4096' in app/client/package.json
rg 'dev\.appsmith\.com|--max_old_space_size=4096' app/client/package.json
Length of output: 233
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: 2
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/github-release.yml (4 hunks)
🧰 Additional context used
🪛 yamllint
.github/workflows/github-release.yml
[error] 278-278: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (5)
.github/workflows/github-release.yml (5)
25-30
: Class, let's review our security practices!I see we're still echoing our Docker Hub username. Remember, exposing secrets in logs is like writing your locker combination on the classroom whiteboard! Let's keep our sensitive information under wraps, shall we?
31-34
: Excellent addition, class!I'm pleased to see you've added a step to log into Docker Hub. This is like getting your hall pass before leaving the classroom - always important to have proper authorization!
The use of
docker/login-action@v3.3.0
is spot on, and I'm glad to see you're using secrets for your credentials. Remember, keeping secrets secret is the first rule of the DevOps club!
48-48
: A gold star for updating our learning environment!Switching to
ubuntu-latest
is like upgrading our classroom to the newest model - we always want to be working with the most up-to-date tools. This change ensures we're using the latest Ubuntu version, which comes with all the newest features and security patches.Keep up the good work in keeping our development environment fresh and secure!
217-218
: Bravo on upgrading our toolbox!Adding Docker Buildx to our workflow is like getting a new set of advanced art supplies for our classroom. This powerful tool extends our Docker capabilities, allowing us to create more sophisticated and versatile builds.
With Buildx, we can now easily create multi-platform images, which is essential in our diverse computing world. It's like being able to write in multiple languages - our Docker images can now speak to different types of computers!
Keep exploring these advanced tools, class. They're the key to becoming true DevOps artists!
262-265
: Good job keeping our tools sharp!Updating our Docker login action to v2 is like getting the latest edition of our textbook. It ensures we're using the most recent and reliable version of the tool.
I'm also pleased to see you've maintained the use of secrets for our credentials. Remember, class, in the world of DevOps, we treat our secrets like the answers to a test - keep them secure and never share them!
Keep up this excellent practice of regular updates and security consciousness.
scripts/prepare_server_artifacts.sh | ||
fi | ||
|
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.
Let's think about error-proofing our workflow!
I see we've removed the safety net of checking if our script exists before running it. While I appreciate the confidence, remember that in the world of DevOps, we always prepare for the unexpected!
Consider this change:
- scripts/prepare_server_artifacts.sh
+ if [[ -f scripts/prepare_server_artifacts.sh ]]; then
+ scripts/prepare_server_artifacts.sh
+ else
+ echo "Warning: prepare_server_artifacts.sh not found. Skipping this step."
+ fi
This way, our workflow won't stumble if the script goes missing. It's like having a backup lesson plan - always good to be prepared!
What do you think, class? Shall we add this extra layer of caution to our workflow?
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
scripts/prepare_server_artifacts.sh | |
fi | |
if [[ -f scripts/prepare_server_artifacts.sh ]]; then | |
scripts/prepare_server_artifacts.sh | |
else | |
echo "Warning: prepare_server_artifacts.sh not found. Skipping this step." | |
fi | |
- name: Build and push Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
platforms: linux/arm64,linux/amd64 | ||
build-args: | | ||
APPSMITH_SEGMENT_CE_KEY=${{ secrets.APPSMITH_SEGMENT_CE_KEY }} | ||
BASE=${{ vars.DOCKER_HUB_ORGANIZATION }}/base-${{ vars.EDITION }}:nightly | ||
BASE=appsmith/base-${{ vars.EDITION }}:nightly | ||
tags: | | ||
${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}} | ||
${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:latest | ||
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}} | ||
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:latest |
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.
Excellent work on our Docker image building process!
Class, I'm impressed with the improvements you've made here. Let's review:
- Updating to
docker/build-push-action@v3
is like upgrading our lab equipment - always a good move! - Adding multi-platform support is fantastic. It's like making our project accessible in multiple languages - very inclusive!
- Using secrets for the Docker Hub username is top-notch security practice. Remember, treat your secrets like your diary - keep them private!
However, we're missing one small detail. Can anyone spot it? That's right - we're missing a newline at the end of our file! Let's fix that:
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}}
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:latest
+
Adding this newline is like putting a period at the end of a sentence - it's a small touch that makes everything complete and follows best practices.
Great job overall, class! Keep up the excellent work in making our workflow more robust and versatile.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: linux/arm64,linux/amd64 | |
build-args: | | |
APPSMITH_SEGMENT_CE_KEY=${{ secrets.APPSMITH_SEGMENT_CE_KEY }} | |
BASE=${{ vars.DOCKER_HUB_ORGANIZATION }}/base-${{ vars.EDITION }}:nightly | |
BASE=appsmith/base-${{ vars.EDITION }}:nightly | |
tags: | | |
${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}} | |
${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:latest | |
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}} | |
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:latest | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
platforms: linux/arm64,linux/amd64 | |
build-args: | | |
APPSMITH_SEGMENT_CE_KEY=${{ secrets.APPSMITH_SEGMENT_CE_KEY }} | |
BASE=appsmith/base-${{ vars.EDITION }}:nightly | |
tags: | | |
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:${{needs.prelude.outputs.tag}} | |
${{ secrets.DOCKER_HUB_USERNAME }}/appsmith-${{ vars.EDITION }}:latest | |
🧰 Tools
🪛 yamllint
[error] 278-278: no new line character at the end of file
(new-line-at-end-of-file)
Customize for specific country that can't use from depot
Summary by CodeRabbit
New Features
Bug Fixes
Chores