fairdataihub / codefair-app

Your coding assistant to make research software reusable without breaking a sweat!
https://codefair.io
MIT License
7 stars 2 forks source link

👷 ci: setup deployment environments #102

Closed megasanjay closed 1 week ago

megasanjay commented 1 week ago

Summary by Sourcery

Set up deployment environments for production and staging, updating CI workflows to support these environments with concurrency control. Modify Dockerfile to optimize build and runtime stages, and update environment variable references across the codebase. Add deployment configuration files and hooks for Kamal, and update changelog to reflect recent changes.

CI:

Deployment:

fairdataihub-bot[bot] commented 1 week ago

Thank you for submitting this pull request! We appreciate your contribution to the project. Before we can merge it, we need to review the changes you've made to ensure they align with our code standards and meet the requirements of the project. We'll get back to you as soon as we can with feedback. Thanks again!

sourcery-ai[bot] commented 1 week ago

Reviewer's Guide by Sourcery

This PR implements deployment environments for the application using Kamal, a deployment tool. The changes include setting up production and staging environments, configuring Docker builds, and updating environment variable references. The deployment setup includes SSL certification, health checks, and secrets management.

Class diagram for environment variable updates

classDiagram
    class EnvironmentVariables {
        +String DOCKER_BUILDKIT
        +String KAMAL_REGISTRY_LOGIN_SERVER
        +String KAMAL_REGISTRY_USERNAME
        +String KAMAL_REGISTRY_PASSWORD
        +String KAMAL_SERVER_IP
        +String DATABASE_URL
        +String APP_ID
        +String GH_APP_ID
        +String GH_APP_NAME
        +String GH_CLIENT_ID
        +String GH_CLIENT_SECRET
        +String PRIVATE_KEY
        +String WEBHOOK_SECRET
        +String CODEFAIR_APP_DOMAIN
        +String CODEFAIR_BOT_DOMAIN
        +String ZENODO_API_ENDPOINT
        +String ZENODO_ENDPOINT
    }
    note for EnvironmentVariables "Updated environment variable references for deployment"

File-Level Changes

Change Details Files
Set up Kamal deployment configuration and environments
  • Added deploy.yml configuration file for Kamal deployment
  • Created deployment environment folders and hooks
  • Added concurrency settings to prevent parallel deployments
  • Configured SSL certification and proxy settings
  • Set up health check endpoints for deployment monitoring
bot/config/deploy.yml
.github/workflows/deploy-main.yml
.github/workflows/deploy-staging.yml
bot/.kamal/hooks/*
Optimize Docker build process
  • Implemented multi-stage Docker build
  • Added proper cleanup steps to reduce image size
  • Improved dependency management and caching
  • Added proper labels and environment configurations
bot/Dockerfile
bot/Dockerfile.dev
Standardize environment variable naming
  • Renamed GITHUBAPP variables to GH_
  • Updated environment variable references across the codebase
  • Added proper environment variable handling for private keys
bot/index.js
bot/main.js
bot/utils/tools/index.js
ui/server/utils/auth.ts
ui/server/api/**/*.ts
Code quality improvements
  • Fixed boolean expression simplifications
  • Removed redundant URL construction logic
  • Updated version number formatting in changelog
bot/index.js
bot/metadata/index.js
CHANGELOG.md
codemeta.json

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).
fairdataihub-bot[bot] commented 1 week ago

Thanks for making updates to your pull request. Our team will take a look and provide feedback as soon as possible. Please wait for any GitHub Actions to complete before editing your pull request. If you have any additional questions or concerns, feel free to let us know. Thank you for your contributions!

fairdataihub-bot[bot] commented 1 week ago

Thanks for closing this pull request! If you have any further questions, please feel free to open a new issue. We are always happy to help!