Skip to content
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

chore: Exit the script if server artifact placer is not available #36569

Merged

Conversation

abhvsn
Copy link
Contributor

@abhvsn abhvsn commented Sep 26, 2024

Description

PR to fail fast at the build step only if the script to place the server artifacts for pg and mongo is not available. This PR also replaces pg tag with nightly tag for placing the server artifacts for pg to improve the stability of the image shipped to customers.

Fixes: #36478

/test Sanity

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11050797504
Commit: 40c5621
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Thu, 26 Sep 2024 11:23:28 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling for missing scripts in the build and release workflows, ensuring clearer error messages and preventing process failures.
  • Chores

    • Introduced a new environment variable for using the nightly PostgreSQL Docker image in the release process.

Copy link
Contributor

coderabbitai bot commented Sep 26, 2024

Walkthrough

The changes involve enhancements to the GitHub Actions workflows, specifically in the .github/workflows/github-release.yml and .github/workflows/test-build-docker-image.yml files. These modifications introduce error handling for the prepare_server_artifacts.sh script, ensuring it is checked for existence before execution. Additionally, a new environment variable PG_TAG is established to utilize the nightly PostgreSQL Docker image tag during artifact preparation.

Changes

File Path Change Summary
.github/workflows/github-release.yml Introduced PG_TAG environment variable set to nightly for script execution; added error handling for script absence.
.github/workflows/test-build-docker-image.yml Enhanced error handling for prepare_server_artifacts.sh by checking for its existence before execution.

Possibly related PRs

Suggested labels

skip-changelog, ok-to-test

Suggested reviewers

  • sharat87
  • pratapaprasanna
  • AnaghHegde

🌟 In the land of code, where scripts do play,
A nightly PostgreSQL tag joins the fray.
With checks in place, no errors to see,
Our workflows now dance, oh so gracefully!
So let’s celebrate this coding delight,
For robust actions make everything right! 🎉


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Sep 26, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
.github/workflows/github-release.yml (1)

250-257: Well done, class! Let's review these changes together.

I'm pleased to see the improvements in error handling and the use of the nightly tag for PostgreSQL. These changes will make our workflow more robust and reliable. However, let's consider making the error message a bit more informative for our future selves.

Consider updating the error message to be more specific:

-            echo "No script found to prepare server artifacts"
+            echo "Error: The script 'scripts/prepare_server_artifacts.sh' was not found. Please ensure it exists and is in the correct location."

This will help us quickly identify and resolve the issue if it ever occurs. Remember, clear communication is key in both code and error messages!

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 91bea3e and 40c5621.

📒 Files selected for processing (2)
  • .github/workflows/github-release.yml (1 hunks)
  • .github/workflows/test-build-docker-image.yml (2 hunks)
🔇 Additional comments (2)
.github/workflows/test-build-docker-image.yml (2)

359-364: Very good, class! This change deserves a gold star!

Now, let's review what we've learned from this modification:

  1. We're checking if the script exists before trying to run it. This is like making sure you have all your school supplies before starting your homework.
  2. If the script is missing, we're telling the computer to stop and let us know. It's similar to raising your hand in class when you need help.
  3. The exit 1 command is like telling the computer "Oops, we can't continue". This helps us avoid bigger problems later.

This change is excellent because it helps us catch problems early, just like how checking your work helps you avoid mistakes on a test.


446-448: Excellent work! You've shown great consistency, just like always using your best handwriting!

Let's recap what we've observed in this change:

  1. We're using the same check we learned about earlier in the file. This is like using the same problem-solving method for similar math problems.
  2. By repeating this check, we're making sure our workflow is consistent. It's like following the same rules in every classroom.
  3. This consistency helps anyone reading our code understand it better, just like how using the same format for all your essays makes them easier to read.

Remember, class: consistency in coding is as important as consistency in your study habits!

@abhvsn abhvsn added the ok-to-test Required label for CI label Sep 26, 2024
@github-actions github-actions bot added DB Infrastructure Pod Pod to handle database infrastructure Move to Postgres Issues required to be solved for the move to Postgres as repository layer Task A simple Todo labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DB Infrastructure Pod Pod to handle database infrastructure Move to Postgres Issues required to be solved for the move to Postgres as repository layer ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog Task A simple Todo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Make the latest image adaptive
2 participants