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

phase 2. #341

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
73 changes: 36 additions & 37 deletions packages/code-review-gpt/.eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,82 +1,81 @@
module.exports = {
env: {
browser: true,
es2021: true,
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.json"
},
ignorePatterns: ["**.js", "**.d.ts", "**.cjs", "**.mjs", "**.json"],
ignorePatterns: [
"**.d.ts",
"**.json",
"node_modules/",
"dist/",
"docs/",
".eslintrc.cjs",
"vitest.config.ts",
"tsup.config.ts",
"src/test/examples/"
],
extends: [
"eslint:recommended",
"plugin:import/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
],
rules: {
"import/extensions": 0,
"import/no-unresolved": 0,
"import/prefer-default-export": 0,
"import/no-duplicates": "error",
complexity: ["error", 8],
"max-lines": ["error", { max: 200, skipBlankLines: true }],
"max-depth": ["error", 3],
"max-params": ["error", 6],
eqeqeq: ["error", "smart"],
"prettier/prettier": "error",
"eqeqeq": ["error", "smart"],
"@typescript-eslint/no-non-null-assertion": 1,
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" }
],
"@typescript-eslint/no-misused-promises": [
2,
{
checksVoidReturn: {
attributes: false,
},
},
attributes: false
}
}
],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
},
peerDependencies: false
}
],
"prefer-const": "error",
"padding-line-between-statements": [
"error",
{
blankLine: "always",
prev: "*",
next: "return",
},
next: "return"
}
],
"no-restricted-imports": [
"error",
{
paths: [
{
name: "aws-sdk",
message: "Please use aws-sdk/{module} import instead",
},
{
name: ".",
message: "Please use explicit import file",
},
],
},
message: "Please use explicit import file"
}
]
}
],
curly: ["error", "all"],
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-unnecessary-type-arguments": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
},
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.eslint.json"],
tsconfigRootDir: __dirname,
},
};
"@typescript-eslint/prefer-string-starts-ends-with": "error"
}
}
11 changes: 8 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
---
name: 🐞 Bug
about: File a bug report to help us improve the project
title: '[BUG] <title>'
title: "[BUG] <title>"
labels: bug, needs triage
assignees: ''

assignees: ""
---

<!--
Note: Please search to see if an issue already exists for the bug you encountered.
-->

### Current Behavior:

<!-- A concise description of what you're experiencing. -->

### Expected Behavior:

<!-- A concise description of what you expected to happen. -->

### Steps To Reproduce:

<!--
Example: steps to reproduce the behavior:
1. In this environment...
Expand All @@ -27,6 +29,7 @@ Example: steps to reproduce the behavior:
-->

### Environment:

<!--
Example:
- OS: Ubuntu 20.04
Expand All @@ -35,11 +38,13 @@ Example:
-->

### Anything else:

<!--
Links? References? Anything that will give us more context about the issue that you are encountering!
-->

### Suggestions on the root cause

<!--
Add any suggestions on what you think the problem is. Be as specific as you can.
-->
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/user-story.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,28 @@ name: User Story
about: Use this template for user stories.
title: "[Epic]: User story"
labels: user story

---

### Description

<!--
Write a short description of what the ticket solves, how it provides value and who suggested it
-->

### Validation steps

<!--
Write steps to validate that the ticket is done (Necessary for BR done)
-->

### Tech steps

<!--
Write tech steps to complete the ticket (Necessary for TR done)
-->

### Tests?

<!--
What tests should be written for this ticket?
-->
55 changes: 0 additions & 55 deletions .github/workflows/merge.yml

This file was deleted.

73 changes: 19 additions & 54 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,75 +11,40 @@ permissions:
actions: read

jobs:
build_and_test_crgpt_package:
build_and_test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/code-review-gpt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_SHA: ${{ github.sha }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: npm ci
run: bun i

- name: Build package
run: npm run build

- name: Run code review script
run: npm run start -- --ci=github --model=gpt-4o
run: bun run build

- name: Run linting test
run: npm run lint-test
- name: Run static tests
run: bun run test

- name: Run unit tests
run: npm run test-unit
- name: Run review
run: bun run start:review --ci=github --model=gpt-3.5-turbo --debug

- name: Run prompt tests
run: npm run test -- --ci=github --model=gpt-4o

deploy_core_to_dev:
runs-on: ubuntu-latest
env:
CI: true
AWS_REGION: eu-west-2
APP_ID: ${{ secrets.APP_ID }}
WEBHOOK_SECRET: ${{ secrets.WEBHOOK_SECRET }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}

defaults:
run:
working-directory: services/core
shell: bash

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN_DEV }}

- name: Install pnpm
run: npm i -g pnpm

- name: 🚀 Deploy core to dev
run: pnpm i && pnpm deploy-dev
run: bun run start:test --ci=github --model=gpt-4o --debug
8 changes: 1 addition & 7 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
name: Release Package

defaults:
run:
shell: bash
working-directory: packages/code-review-gpt

on:
push:
branches:
Expand All @@ -25,7 +20,6 @@ jobs:
with:
release-type: node
package-name: code-review-gpt
path: code-review-gpt
publish-package:
runs-on: ubuntu-latest
needs: release-please
Expand All @@ -34,7 +28,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "20"
cache: "npm"
registry-url: "https://registry.npmjs.org"
- name: 💫 Install dependencies
Expand Down
Loading