-
Notifications
You must be signed in to change notification settings - Fork 25
[#493] Integrate Danger to the generated project #579
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: develop
Are you sure you want to change the base?
[#493] Integrate Danger to the generated project #579
Conversation
Kover report for template-compose:🧛 Template - Compose Unit Tests Code Coverage:
|
File | Coverage |
---|
Modified Files Not Found In Coverage Report:
Dangerfile
Gemfile
Gemfile
Gemfile.lock
review_pull_request.yml
template_review_pull_request.yml
Codebase cunningly covered by count Shroud 🧛
Generated by 🚫 Danger
8c6984f
to
db8238c
Compare
db8238c
to
003bb3b
Compare
4d15ea8
to
54f5f56
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Gemfile (1)
4-4
: Maintain consistent quote style in gem declarations.Use single quotes to maintain consistency with other gem declarations in the file.
-gem "danger-checkstyle_format" +gem 'danger-checkstyle_format'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
template-compose/Gemfile.lock
is excluded by!**/*.lock
📒 Files selected for processing (5)
.github/workflows/review_pull_request.yml
(1 hunks)Gemfile
(1 hunks)template-compose/.github/workflows/template_review_pull_request.yml
(1 hunks)template-compose/Dangerfile
(1 hunks)template-compose/Gemfile
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- template-compose/Gemfile
- .github/workflows/review_pull_request.yml
- template-compose/Dangerfile
- template-compose/.github/workflows/template_review_pull_request.yml
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Review pull request
- GitHub Check: Verify newproject script
- GitHub Check: Run Detekt and unit tests
🔇 Additional comments (1)
Gemfile (1)
Line range hint
1-6
: Verify the impact of removed gems.The PR objectives mention integrating Detekt, but
danger-kotlin_detekt
gem has been removed. Additionally,danger-commit_lint
for commit message validation anddanger-shroud
for security scanning were removed.Let's verify if these features are handled differently:
🧰 Tools
🪛 rubocop (1.69.1)
[convention] 5-5: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem
danger-android_lint
should appear beforedanger-checkstyle_format
.(Bundler/OrderedGems)
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/review_pull_request.yml (1)
27-32
: 🛠️ Refactor suggestionRemove redundant gem caching configuration
The
bundler-cache: true
in the Ruby setup step already handles gem caching. The separate gem caching step is redundant.- - uses: actions/cache@v4 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }} - restore-keys: | - ${{ runner.os }}-gems-
🧹 Nitpick comments (1)
.github/workflows/review_pull_request.yml (1)
Line range hint
57-57
: Update cache action version for consistencyThe workflow uses actions/cache@v4 for gem caching but v2 for Gradle caching. For consistency and to leverage the latest features, update to v4.
- uses: actions/cache@v2 + uses: actions/cache@v4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/review_pull_request.yml
(1 hunks)template-compose/.github/workflows/template_review_pull_request.yml
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- template-compose/.github/workflows/template_review_pull_request.yml
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Review pull request
- GitHub Check: Verify newproject script
- GitHub Check: Run Detekt and unit tests
🔇 Additional comments (1)
.github/workflows/review_pull_request.yml (1)
33-40
: Well-configured Danger setup!The Danger action is properly configured with all necessary parameters and follows security best practices by using GitHub token for authentication.
ecee45a
to
ddd1fb5
Compare
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/review_pull_request.yml (1)
Line range hint
28-28
: Update cache action to latest versionThe workflow uses
actions/cache@v2
which is outdated. Consider updating toactions/cache@v4
for the latest features and security updates.- - name: Cache Gradle - uses: actions/cache@v2 + - name: Cache Gradle + uses: actions/cache@v4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/review_pull_request.yml
(2 hunks)template-compose/.github/workflows/template_review_pull_request.yml
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- template-compose/.github/workflows/template_review_pull_request.yml
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/review_pull_request.yml
65-65: input "run" is not defined in action "ruby/setup-ruby@v1". available inputs are "bundler", "bundler-cache", "cache-version", "ruby-version", "rubygems", "self-hosted", "windows-toolchain", "working-directory"
(action)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Run Detekt and unit tests
- GitHub Check: Review pull request
- GitHub Check: Verify newproject script
🔇 Additional comments (2)
.github/workflows/review_pull_request.yml (2)
66-71
: Remove redundant gem caching configurationThe
bundler-cache: true
in the Ruby setup step already handles gem caching. The separate gem caching step is redundant.- - uses: actions/cache@v4 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('Gemfile') }} - restore-keys: | - ${{ runner.os }}-gems-
72-79
: LGTM! Well-configured Danger integrationThe Danger action is properly configured with all necessary parameters:
- Correct plugin file path
- Appropriate installation directory
- Danger file specification
- Unique danger ID
- Proper GitHub token usage
bda55a8
to
b6a4d6b
Compare
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.
Pull Request Overview
Integrates Danger into the Android template project to automate pull request quality checks via GitHub Actions.
- Adds Gemfiles to manage Danger and related plugins
- Introduces a Dangerfile with rules for PR size, description, labels, linting, and test coverage
- Updates GitHub workflows to set up Ruby, cache dependencies, and run Danger
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
template-compose/Gemfile | New Gemfile listing Danger plugins |
template-compose/Dangerfile | Danger rules for lint, commit checks, and coverage |
template-compose/.github/workflows/template_review_pull_request.yml | Workflow to install Ruby and run Danger |
Gemfile | Root Gemfile updated for CI gems |
.github/workflows/review_pull_request.yml | Streamlined Ruby setup with bundler-cache for Danger |
Comments suppressed due to low confidence (1)
template-compose/Dangerfile:37
- The placeholder
$project
may not interpolate in Danger; use Ruby string interpolation (e.g.,"## Kover report for #{project_name}:"
) or replace with a concrete value.
markdown "## Kover report for $project:"
gem 'danger' | ||
gem 'danger-android_lint' | ||
gem 'danger-commit_lint' | ||
gem 'danger-kotlin_detekt' | ||
gem 'danger-shroud' |
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 pinning gem versions (e.g., gem 'danger', '~> 10.0'
) to ensure reproducible CI builds.
gem 'danger' | |
gem 'danger-android_lint' | |
gem 'danger-commit_lint' | |
gem 'danger-kotlin_detekt' | |
gem 'danger-shroud' | |
gem 'danger', '~> 10.0' | |
gem 'danger-android_lint', '~> 1.0' | |
gem 'danger-commit_lint', '~> 1.0' | |
gem 'danger-kotlin_detekt', '~> 1.0' | |
gem 'danger-shroud', '~> 1.0' |
Copilot uses AI. Check for mistakes.
@@ -0,0 +1,38 @@ | |||
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet | |||
warn("PR is classed as Work in Progress") if github.pr_title.include? "WIP" |
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.
Typo in user-visible warning: replace 'classed' with 'classified' to correct the message.
warn("PR is classed as Work in Progress") if github.pr_title.include? "WIP" | |
warn("PR is classified as Work in Progress") if github.pr_title.include? "WIP" |
Copilot uses AI. Check for mistakes.
#493
What happened 👀
CI/CD pipeline specifically for reviewing pull requests within our Android project template. A total of 76 additions have been made to the
.github/workflows/repiew_pull_request.yml
file, enhancing its capabilities and adding new steps for better code quality checks and environment management.Insight 📝
Proof Of Work 📹
Summary by CodeRabbit
New Features
Gemfile
to manage Ruby gems for enhanced code review processes.Enhancements
Bug Fixes
Chores