diff --git a/.github/workflows/gpt_pr_review.yml b/.github/workflows/gpt_pr_review.yml new file mode 100644 index 00000000..bf4deb11 --- /dev/null +++ b/.github/workflows/gpt_pr_review.yml @@ -0,0 +1,56 @@ +name: gpt_pr_review +permissions: + contents: read + pull-requests: write +on: + pull_request: + branches: [ main ] + types: [opened, reopened, synchronize] + pull_request_review_comment: + branches: [ main ] + types: [created] +concurrency: + group: > + ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ + github.workflow }}-${{ github.event_name == 'pull_request_review_comment' && 'pr_comment' || 'pr' }} + cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }} +jobs: + gpt_pr_review: + runs-on: ubuntu-latest + steps: + - uses: coderabbitai/ai-pr-reviewer@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + with: + system_message: > + Your purpose is to act as a highly experienced + software engineer and provide a thorough review of the code hunks + and suggest code snippets to improve key areas such as: + - Logic + - Security + - Performance + - Data races + - Consistency + - Error handling + - Maintainability + - Modularity + - Complexity + - Optimization + - Best practices: DRY, SOLID, KISS + Identify and resolve significant concerns to improve overall code + quality while deliberately disregarding minor issues. + summarize: > + Provide your final response in markdown with the following content: + - **Walkthrough**: A high-level summary of the overall change instead of + specific files within 100 words. + - **Changes**: A markdown table of files and their summaries. Group files + with similar changes together into a single row to save space. + Avoid additional commentary as this summary will be added as a comment on the + GitHub pull request. Use the titles "Walkthrough" and "Changes" and they must be H2. + summarize_release_notes: > + Craft concise release notes for the pull request. + Focus on the purpose and user impact, categorizing changes as New Feature, Bug Fix, + Documentation, Refactor, Style, Test, Chore, or Revert. Provide a bullet-point list, + e.g. "- New Feature: Added search functionality to the UI." Limit your response to 50-100 words + and emphasize features visible to the end-user while omitting code-level details. diff --git a/.github/workflows/squash_merge_to_prod.yml b/.github/workflows/squash_merge_to_prod.yml new file mode 100644 index 00000000..b2bc7950 --- /dev/null +++ b/.github/workflows/squash_merge_to_prod.yml @@ -0,0 +1,24 @@ +name: squash_merge_to_prod +on: + push: + branches: [ main ] +jobs: + squash_merge_to_prod: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Configure Git + run: | + git config user.name "Jai Bhagat" + git config user.email "jkbhagatio@gmail.com" + - name: Merge and squash to prod + run: | + git checkout prod + # Get the latest commit message from the 'main' branch + COMMIT_MSG=$(git log main -1 --pretty=format:%s) + git merge --squash main + git commit -m "$COMMIT_MSG" + git push origin prod diff --git a/env_config/env_dev.yml b/env_config/env_dev.yml index c30c7cb6..5b8831c8 100644 --- a/env_config/env_dev.yml +++ b/env_config/env_dev.yml @@ -7,20 +7,15 @@ channels: - conda-forge - defaults dependencies: - - bandit - black - - flake8 - - flake8-bugbear - - flake8-docstrings - - flake8-pyproject - gh - ipdb - - isort - - mypy - pre-commit - - pydantic + - pydantic + - pyright - pytest - pytest-cov + - ruff - sphinx - tox - pip: