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

[#493] Integrate Danger to the generated project #579

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

thawzintoe-ptut
Copy link

@thawzintoe-ptut thawzintoe-ptut commented Jun 5, 2024

#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 📝

  • Detekt and Android Lint: Ensure code quality and styling compliance.
  • Kover for Unit Tests: Enforce test coverage metrics.
  • Danger: Manage PR annotations for common issues like big PRs or missing descriptions.

Proof Of Work 📹

Screenshot 2567-06-05 at 22 07 10

Summary by CodeRabbit

  • New Features

    • Introduced a new GitHub Actions workflow for automated pull request reviews.
    • Added a Gemfile to manage Ruby gems for enhanced code review processes.
  • Enhancements

    • Improved caching for Ruby gems and Gradle dependencies to optimize build times.
    • Implemented warning mechanisms in the Dangerfile for PR titles, descriptions, labels, and code size.
    • Added test coverage reporting to ensure quality standards are met.
  • Bug Fixes

    • Modified commit linting process to provide warnings instead of failing outright.
  • Chores

    • Updated workflow configurations to streamline Ruby setup and caching processes.
    • Removed unnecessary gem dependencies from the project.

Copy link

github-actions bot commented Jun 5, 2024

8 Warnings
⚠️ Uh oh! Your project is under 80% coverage!
⚠️ template-compose/gradle/libs.versions.toml#L10 - A newer version of androidx.compose:compose-bom than 2023.09.02 is available: 2024.12.01
⚠️ template-compose/gradle/libs.versions.toml#L11 - A newer version of androidx.navigation:navigation-compose than 2.5.3 is available: 2.8.5
⚠️ template-compose/gradle/libs.versions.toml#L12 - A newer version of androidx.core:core-ktx than 1.10.1 is available: 1.15.0
⚠️ template-compose/gradle/libs.versions.toml#L13 - A newer version of androidx.datastore:datastore-preferences than 1.0.0 is available: 1.1.1
⚠️ template-compose/gradle/libs.versions.toml#L17 - A newer version of androidx.hilt:hilt-navigation-compose than 1.0.0 is available: 1.2.0
⚠️ template-compose/gradle/libs.versions.toml#L24 - A newer version of androidx.lifecycle:lifecycle-runtime-compose than 2.6.1 is available: 2.8.7
⚠️ template-compose/gradle/libs.versions.toml#L24 - A newer version of androidx.lifecycle:lifecycle-runtime-ktx than 2.6.1 is available: 2.8.7

Kover report for template-compose:

🧛 Template - Compose Unit Tests Code Coverage: 61.54%

Coverage of Modified Files:

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

@thawzintoe-ptut thawzintoe-ptut force-pushed the feature/493-integrate-danger-to-the-generated-project branch from 8c6984f to db8238c Compare June 26, 2024 11:03
@thawzintoe-ptut thawzintoe-ptut force-pushed the feature/493-integrate-danger-to-the-generated-project branch from db8238c to 003bb3b Compare June 26, 2024 11:05
@coderabbitai coderabbitai bot temporarily deployed to template-compose December 3, 2024 08:43 Inactive
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Outside diff range and nitpick comments (1)
template-compose/Dangerfile (1)

4-5: Consider adjusting the line threshold for "Big PR" warning

The current threshold of 500 lines might be too high for effective code review. Consider lowering it to 300-400 lines to encourage smaller, more focused PRs.

-warn("Big PR") if git.lines_of_code > 500
+warn("Big PR, please consider breaking it down into smaller ones") if git.lines_of_code > 300
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ecbd6e1 and 4d15ea8.

⛔ Files ignored due to path filters (1)
  • template-compose/Gemfile.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • .github/workflows/review_pull_request.yml (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 due to trivial changes (1)
  • template-compose/Gemfile
🧰 Additional context used
🪛 yamllint (1.35.1)
template-compose/.github/workflows/template_review_pull_request.yml

[error] 41-41: syntax error: expected , but found ''

(syntax)

🔇 Additional comments (2)
template-compose/Dangerfile (1)

17-22: Verify Detekt report path and consider adding failure threshold

The current configuration only warns but doesn't fail on serious issues. Consider adding severity thresholds.

template-compose/.github/workflows/template_review_pull_request.yml (1)

47-63: 🛠️ Refactor suggestion

Remove redundant gem caching and version checks

Similar to the main workflow, the gem caching is redundant. Additionally, the version checks are unnecessary when using setup-ruby action.

Remove both the cache and version check steps:

-      - name: Cache gems
-        uses: actions/cache@v2
-        with:
-          path: vendor/bundle
-          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-gems-
-
-      - name: Install Bundle and check environment versions
-        run: |
-          echo 'Install Bundle'
-          bundle config path vendor/bundle
-          bundle install
-          echo 'Check environment setup versions'
-          ruby --version
-          gem --version
-          bundler --version

Likely invalid or redundant comment.

thawzintoe-ptut and others added 3 commits January 10, 2025 15:06
[#498] Added JDK setup in github action

[#493] Update code according to PR comment for template_review_pull_request.yml
@thawzintoe-ptut thawzintoe-ptut force-pushed the feature/493-integrate-danger-to-the-generated-project branch from 4d15ea8 to 54f5f56 Compare January 10, 2025 08:26
Copy link

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4d15ea8 and 54f5f56.

⛔ 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 and danger-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 before danger-checkstyle_format.

(Bundler/OrderedGems)

Copy link

@coderabbitai coderabbitai bot left a 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 suggestion

Remove 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 consistency

The 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

📥 Commits

Reviewing files that changed from the base of the PR and between 54f5f56 and ecee45a.

📒 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.

.github/workflows/review_pull_request.yml Outdated Show resolved Hide resolved
@thawzintoe-ptut thawzintoe-ptut force-pushed the feature/493-integrate-danger-to-the-generated-project branch from ecee45a to ddd1fb5 Compare January 10, 2025 08:39
Copy link

@coderabbitai coderabbitai bot left a 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 version

The workflow uses actions/cache@v2 which is outdated. Consider updating to actions/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

📥 Commits

Reviewing files that changed from the base of the PR and between ecee45a and 16b0865.

📒 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 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-

72-79: LGTM! Well-configured Danger integration

The 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

.github/workflows/review_pull_request.yml Outdated Show resolved Hide resolved
@thawzintoe-ptut thawzintoe-ptut force-pushed the feature/493-integrate-danger-to-the-generated-project branch from bda55a8 to b6a4d6b Compare January 10, 2025 09:37
@ryan-conway ryan-conway modified the milestones: 3.31.0, 3.32.0 Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Danger to the generated project
6 participants