Skip to content

Feature/add git workflow analyzer #99

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

Merged
merged 5 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 2 additions & 4 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
### Issue
[LINK TO JIRA/GITHUB ISSUE]

#### Tasks [ISSUE TASKS covered in this PR when apply]
- [ ] Task 1
- [ ] Task 2

### Preview
[UI Preview]

#### Notes:
[extra note or considerations]

@rs-gpt-review Describe the changes in this PR. Recommend improvements (including code improvements), possible memory leaks, and best practices.
37 changes: 37 additions & 0 deletions .github/workflows/rs-gpt-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# File: .github/workflows/rs-gpt-review.yml
name: 'rs-gpt-review'

# Run the workflow on new issues, pull requests and comments
on:
issues:
types: [opened]
pull_request:
types: [opened]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]

# Allows the workflow to create comments on issues and pull requests
permissions:
issues: write
pull-requests: write
contents: write

jobs:
# Runs for issues, pull requests and comments
rs-gpt-review:
name: rs-gpt-review comment
# Only run the job if the comment contains @rs-gpt-review
if: ${{ github.event_name == 'issues' && contains(github.event.issue.body, '@rs-gpt-review') || github.event_name == 'pull_request' && contains(github.event.pull_request.body, '@rs-gpt-review') || github.event_name == 'issue_comment' && contains(github.event.comment.body, '@rs-gpt-review') || github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@rs-gpt-review') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# The action will only run if the description or comments mentions @rs-gpt-review
Copy link
Contributor

@agustinkoll-rootstrap agustinkoll-rootstrap Dec 11, 2024

Choose a reason for hiding this comment

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

what do you think of copying this comment to the readme?

- uses: rootstrap/rs-gpt-review@v2
name: rs-gpt-review
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
openai_key: ${{ secrets.OPENAI_KEY }}
model: gpt-4-turbo
files_excluded: README.md, LICENSE, rs-gpt-review.yml, sonar-qube-scann.yml, .flutter-plugins, .flutter-plugins-dependencies
34 changes: 34 additions & 0 deletions .github/workflows/sonar-qube-scann.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#SonarQube Configuration
# This is the sonarqube configuration, check readme for instructions
#name: 'sonarqube'
#
#on: push
#
#jobs:
# sonarQubeTrigger:
# name: Sonarqube-Trigger
# runs-on: ubuntu-latest
# steps:
# - uses: dart-lang/setup-dart@v1
# - name: Checkout code
# uses: actions/checkout@v2
# - uses: webfactory/[email protected]
# with:
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
# - name: Set up Flutter
# uses: subosito/flutter-action@v2
# with:
# channel: stable
# flutter-version: 3.24.3
# - run: flutter --version
# - name: Get Dependencies
# run: flutter pub get app && flutter pub get modules/domain && flutter pub get modules/data && flutter pub get modules/common
# - name: Analyze App
# #run analyze first
# run: flutter analyze
# - name: Setup Sonarqube Scanner
# uses: warchant/setup-sonar-scanner@v8
# - name: Run Sonarqube Scanner
# run: sonar-scanner
# -Dsonar.token=${{ secrets.SONAR_TOKEN }}
# -Dsonar.host.url=${{ secrets.SONAR_URL }}
8 changes: 6 additions & 2 deletions .idea/flutter-base.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 21 additions & 21 deletions .idea/libraries/Dart_SDK.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ This template comes with:
- Intl.
- State Management (Blocs/Cubit).
- Env config and flavors.
- Chat with Gemini and Vertex AI (Documantation and setup WIP)
- Chat with Gemini and Vertex AI (Documentation and setup WIP)
- GitWorkflow config: RS-GPT-Review
- GitWorkflow config: Sonarqube

## Initial Setup

Expand Down Expand Up @@ -188,7 +190,29 @@ TBD

We are using Bitrise to configure and run
the [CI/CD pipelines](https://www.notion.so/rootstrap/Flutter-CI-CD-9a0a5957ee8442908fc00c3ea8f49bf1)
.

### Github Actions: RS-GPT-Review
- Configure GPT secrets vars on your repo settings:
- OPENAI_KEY

### Github Actions: Sonarqube
- Go to you sonarqube server and configure a new project.
- Configure the sonar-project.properties:
example:
'''
sonar.projectKey=your-app-key
sonar.projectName=your-project-name
sonar.host.url=https://your-sonarqube-server.net
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
'''
# Main source directories
sonar.sources=app/lib,modules/domain,modules/data,modules/common
sonar.dart.exclusions=pubspec.yaml
sonar.dart.analyzer.report.mode=LEGACY
- Configure Sonarqube secrets vars on your repo settings:
- SONAR_TOKEN (your sonarqube project token)
- SONAR_URL (your sonarqube server url)

## License

Expand Down
21 changes: 21 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This config file is for Sonarqube only
name: Sonar
description: Sonar

publish_to: "none"
version: 0.0.1+1

environment:
sdk: '>=3.0.0 <4.0.0'

dependencies:
flutter:
sdk: flutter

dev_dependencies:
flutter_test:
sdk: flutter

flutter:
generate: true
uses-material-design: true
9 changes: 9 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sonar.projectKey=your-project-key
sonar.projectName=your-project-name
sonar.host.url=https://your-sonarqube-server.net
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8
# Main source directories
sonar.sources=app/lib,modules/domain,modules/data,modules/common
sonar.dart.exclusions=pubspec.yaml
sonar.dart.analyzer.report.mode=LEGACY