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

👷 ci: setup deployment environments #102

Merged
merged 14 commits into from
Nov 15, 2024
Merged

👷 ci: setup deployment environments #102

merged 14 commits into from
Nov 15, 2024

Conversation

megasanjay
Copy link
Member

@megasanjay megasanjay commented Nov 15, 2024

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:

  • Update CI workflows to deploy to both production and staging environments with concurrency control.

Deployment:

  • Set up deployment environments for production and staging, including environment variables and Docker configurations.

slugb0t and others added 14 commits October 17, 2024 10:52
* fix: 🐛 patch removing pull_request.closed bug on metadata pr merge

* fix: 🐛 don't update firstPublished in the codemeta file + better logs

* fix: 🐛 patch error on reading db entry when it doesn't exist

* chore: 🔊 better log on successful Zenodo publish

* style: 🎨 margins between text and icon

* feat: ✨ links to the list of tools used for codefair in /codefair

* refactor: ✨ ♻️ abstract the license validation fn

* doc: 🔖 update changelog

* feat: ✨ ♻️ abstraction to zenodo workflow

* wip: 🚧 abstracting zenodo workflow

* feat: ✨ add help link in the Zenodo release page

* refactor: ♻️ ✨ abstract out github release functions

* refactor: 🔊 ♻️ improve error tracing in metadata file

* chore: 🔨 remove todo

* refactor: ✨ ♻️ abstracted Zenodo workflow (bot)

* wip: 🚧 save custom license content when no assertion is provided

* ✨ feat: add support for custom licenses (#90)

* ✨ feat: add support for custom licenses

* 🐛 fix: reset citation license field

* 🐛 fix: update zenodo workflow for custom licenses

* fix: 🐛 license is valid with custom license

* feat: ✨ custom license template

* ✨ feat: update codemeta, license and cwl ui paths (#91)

* ✨ feat: update meta paths for consistency

* 🚚 fix: updatel icense request path

* ✨ feat: add support for custom license title (#92)

* refactor: ♻️ ✨ new patches for license, cwl, metadata UI's

* refactor: ✨ ♻️ apply migrations from UI to bot

* feat: ✨ request custom license title from user

* refactor: ♻️ hide message box when custom license title is blank

* refactor: ♻️ issue dashboard requests custom title

* feat: ✨ Saving custom title (#93)

* feat: ✨ save custom title option

* refactor: :recyle: reuse saveLicenseDraft for storing custom license title

* refactor: ♻️ join draft and save title buttons together

* refactor: ♻️ use naive-ui's properties for styling

* chore: 🔨 remove typo

* chore: 🔨 remove unused variables

* feat: ✨ toasts for custom title saved button

* refactor: ♻️ function rename

* feat: ✨ create Zenodo metadata fn handles custom licenses

* feat: ✨ custom license reference for archival workflow

* refactor: ♻️ stop creating identifiers for new db entries

* refactor: ♻️ 🐛 revert allowing custom licenses for zenodo

* refactor: ♻️ Custom License Support (#94)

* refactor: ♻️ ✨ custom title saved updates dashboard, disable create release btn when custom license

* refactor: ♻️ block progress of fair release if license is custom

* feat: ✨ listener for when custom license title is saved through UI

* feat: ✨ prevent fair release if not fair compliant

* refactor: ♻️ improve license validation and update template text for custom licenses

* refactor: ♻️ re-render issue from ui side

* refactor: ♻️ update to message explaining custom licenses

* db calls running in parallel

* fix: 🐛 prevent Zendo section from being seen when the license is custom

* fix: 🐛 trim license content before comparison

---------

Co-authored-by: Sanjay Soundarajan <sanjay.16@live.com>
* fix: 🐛 rerender template will stop using old links

* doc: 📝 update CHANGELOG

* doc: 📝 update metadata
Copy link

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!

Copy link

sourcery-ai bot commented Nov 15, 2024

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"
Loading

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 GITHUB_APP_* 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 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

Copy link

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!

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @megasanjay - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@megasanjay megasanjay merged commit f23ab0d into main Nov 15, 2024
1 check passed
Copy link

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!

@megasanjay megasanjay deleted the staging branch November 15, 2024 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants