-
Notifications
You must be signed in to change notification settings - Fork 0
build: Psl auto pr review2 #2
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
base: main
Are you sure you want to change the base?
Changes from all commits
dd75ef0
117a75a
ba33402
09dbdbd
1b73254
21cacab
6f7625a
863ab73
d645b0b
139a6cb
fd84c89
2ec0b05
ceb64f1
f293fc7
64bdcac
2343f2a
bc0ccd3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"model": "gpt-4", | ||
"commentMode": "multi", | ||
"language": "en", | ||
"filesToIgnore": [ | ||
"**/*.md", | ||
"**/*.yml", | ||
"**/*.json", | ||
"**/__pycache__/**", | ||
"**/*.lock" | ||
], | ||
"rules": [ | ||
{ | ||
"name": "No TODOs in code", | ||
"description": "Prevent merging PRs with TODO comments left in code.", | ||
"pattern": "TODO", | ||
"failOnMatch": true | ||
}, | ||
{ | ||
"name": "Avoid console/debug prints", | ||
"description": "Remove print/debug/log statements before committing.", | ||
"pattern": "console\\.log|print\\(|debugger;", | ||
"failOnMatch": true | ||
}, | ||
{ | ||
"name": "Require tests for Python changes", | ||
"description": "Changes to backend Python code should include tests.", | ||
"pathPattern": "backend/**/*.py", | ||
"requireMatchingTest": true | ||
}, | ||
{ | ||
"name": "Require tests for React components", | ||
"description": "Ensure that React component changes include test coverage.", | ||
"pathPattern": "frontend/src/components/**/*.tsx?", | ||
"requireMatchingTest": true | ||
}, | ||
{ | ||
"name": "Avoid hardcoded secrets or keys", | ||
"description": "Scan for obvious secret patterns in code.", | ||
"pattern": "(api[_-]?key|secret|password)\\s*[:=]\\s*[\"'].*[\"']", | ||
"failOnMatch": true | ||
} | ||
] | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Auto PR Review | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- uses: omio-labs/pr-reviewer-bot@v1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | ||
|
||
|
||
|
||
# on: | ||
# pull_request: | ||
# types: [opened, edited, synchronize] | ||
|
||
# jobs: | ||
# review: | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Checkout PR code | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Run Auto PR Review | ||
# uses: tianhaoz95/auto-pr-review@v0.0.9 | ||
# with: | ||
# github-token: ${{ secrets.GIT_TOKEN }} | ||
# I need to create new token for this repo and add it to secrets, cannot use the default GITHUB_TOKEN. | ||
# because this token does not have permission to post reviews for PRs | ||
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -76,8 +76,8 @@ jobs: | |||||||||||||||||
file: ./src/WebApp.Dockerfile | ||||||||||||||||||
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'dependabotchanges' }} | ||||||||||||||||||
tags: | | ||||||||||||||||||
${{ steps.registry.outputs.int_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }} | ||||||||||||||||||
${{ steps.registry.outputs.int_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }} | ||||||||||||||||||
${{ steps.registry.outputs.int_registry }} webapp:${{ steps.determine_tag.outputs.tagname }} | ||||||||||||||||||
${{ steps.registry.outputs.int_registry }} webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }} | ||||||||||||||||||
Comment on lines
+79
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of the slash between the registry and the image name may result in an invalid Docker tag format. Consider restoring the slash (/) to correctly construct the tag.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback
Comment on lines
+79
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Docker image tag strings now have a space instead of a forward slash between the registry URL and the image name, which could result in incorrect image tagging. Consider restoring the forward slash (/) between these components.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||
|
||||||||||||||||||
- name: Build Docker Image and optionally push - External Registry | ||||||||||||||||||
if: ${{ github.ref_name == 'main' }} | ||||||||||||||||||
|
@@ -87,6 +87,6 @@ jobs: | |||||||||||||||||
file: ./src/WebApp.Dockerfile | ||||||||||||||||||
push: ${{github.ref_name == 'main' }} | ||||||||||||||||||
tags: | | ||||||||||||||||||
${{ steps.registry.outputs.ext_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }} | ||||||||||||||||||
${{ steps.registry.outputs.ext_registry }}/webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }} | ||||||||||||||||||
${{ steps.registry.outputs.ext_registry }} webapp:${{ steps.determine_tag.outputs.tagname }} | ||||||||||||||||||
${{ steps.registry.outputs.ext_registry }} webapp:${{ steps.determine_tag.outputs.tagname }}_${{ steps.date.outputs.date }}_${{ github.run_number }} | ||||||||||||||||||
Comment on lines
+90
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The missing slash between the external registry and the image name could produce an improperly formatted Docker tag. Inserting a slash (/) between the registry and the image name should resolve this.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback
Comment on lines
+90
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tag for the external registry image appears to be missing the slash separator between the registry URL and the image name. Adding a '/' should correctly format the Docker tag.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider removing the commented-out workflow configuration if it is no longer needed to enhance clarity and maintainability.
Copilot uses AI. Check for mistakes.