Skip to content

WIP: Move release tasks to separate scripts for better reusability #154

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

Closed
wants to merge 10 commits into from

Conversation

tuancoltech
Copy link
Member

@tuancoltech tuancoltech commented Feb 26, 2025

Issue Number

Purpose

  • Move release's related tasks to separate scripts for better reusability.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced a streamlined and automated release preparation process that ensures consistent version updates.
    • Enhanced release management with improved error handling for more reliable versioning in upcoming releases.
    • Added new Gradle tasks for cleaning, preparing, and performing releases, simplifying the release workflow.
    • Implemented a check for a clean Git repository before executing release tasks to prevent errors.
    • Added a new job in the CI/CD pipeline for handling releases of the utils module.

@tuancoltech tuancoltech requested a review from a team as a code owner February 26, 2025 04:40
Copy link

coderabbitai bot commented Feb 26, 2025

Walkthrough

The changes refactor the release preparation process for an Android application by replacing the existing logic in the releaseClean, releasePrepare, and releasePerform tasks within app/build.gradle with calls to external methods: cleanRelease(), prepareRelease(), and performRelease(). New Gradle scripts have been introduced to manage repository cleanliness checks, version handling, and commit operations, which enhances modularity and maintainability.

Changes

File Change Summary
app/build.gradle Removed detailed logic in releaseClean, releasePrepare, and releasePerform tasks, replaced with calls to cleanRelease(), prepareRelease(), and performRelease(). Added method declarations for these new methods.
gradle/prepare_release.gradle Introduced a new Gradle task ext.prepareRelease that retrieves applicationId and versionName, truncates the version name if it contains a hyphen, handles version bumps, updates version details, and commits changes with error handling.
gradle/clean_release.gradle Added a new function ext.cleanRelease that automates the cleanup of git tags associated with specific commit messages, checking for tags and removing them as necessary while handling exceptions.
gradle/perform_release.gradle Introduced a new method ext.performRelease that manages pushing commits to a remote repository, allowing for a forced push option and handling exceptions during the push operation.
.github/workflows/gradle-release.yml Updated Gradle release commands to explicitly target app and utils modules, replacing previous commands with module-specific calls for releasePrepare and releasePerform.
gradle/ensure_clean.gradle Introduced a new closure ext.ensureClean that checks the cleanliness of the Git repository and throws an exception if the repository is not clean.
utils/build.gradle Registered new tasks: ensureCleanRepo, releaseClean, releasePrepare, and releasePerform, which depend on ensureCleanRepo and call the respective external methods for release management.
.github/workflows/gradle-build.yml Added a new job release to the CI/CD pipeline that prepares a release for the utils module using Gradle.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant RC as releaseClean Task
    participant CL as cleanRelease Method
    participant RP as releasePrepare Task
    participant PR as prepareRelease Method
    participant RF as releasePerform Task
    participant PF as performRelease Method
    participant Git as Git Repository

    Dev->>RC: Invoke releaseClean task
    RC->>CL: Call cleanRelease()
    CL->>Git: Check for relevant commit messages
    CL->>Git: Remove git tags if found
    CL-->>RC: Return control

    Dev->>RP: Invoke releasePrepare task
    RP->>PR: Call prepareRelease()
    PR->>PR: Retrieve applicationId and versionName
    PR->>PR: Process versionName (truncate if hyphen present)
    PR->>PR: Determine version bump (bumpVersion / bumpType)
    PR->>Git: Commit changes and tag release
    PR-->>RP: Return control

    Dev->>RF: Invoke releasePerform task
    RF->>PF: Call performRelease()
    PF->>Git: Push commits to remote repository
    PF-->>RF: Return control
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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 (3)
gradle/prepare_release.gradle (3)

1-7: Clarity in Version Name Truncation

The logic for extracting the applicationId and versionName is clear. As an optional improvement, consider using the more idiomatic Groovy string containment method:

if (versionName.contains("-")) {
    versionName = versionName.split("-")[0]
}

This improves readability.


9-18: Robustness of Build File Update and Commit

The code correctly reads the build file's text, applies a regex-based replacement to update the versionName, and commits the change with a descriptive message. One suggestion is to review the regex pattern /versionName(\s+.*)/ to ensure it matches only the intended line and won’t inadvertently replace unexpected content. If the build file format could vary, consider tightening the pattern.


53-65: Finalizing Next Development Iteration Update

The block correctly increments the versionCode and updates both the versionName (adding a -SNAPSHOT suffix) and versionCode in the build file. To maintain consistency with the earlier commit step, consider wrapping the final commit (lines 62–63) within a try-catch block as well. For example:

-    grgit.add(patterns: ['app/build.gradle'])
-    grgit.commit(message: "[gradle-release-task] prepare for next development iteration")
+    grgit.add(patterns: ['app/build.gradle'])
+    try {
+        grgit.commit(message: "[gradle-release-task] prepare for next development iteration")
+    } catch (Exception e) {
+        throw new GradleException("Failed to commit next development iteration changes, error:\n $e")
+    }

This small change will make the process more robust against commit failures.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b500288 and 2fbffb2.

📒 Files selected for processing (2)
  • app/build.gradle (1 hunks)
  • gradle/prepare_release.gradle (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (windows-latest, 17)
🔇 Additional comments (2)
gradle/prepare_release.gradle (1)

19-26: Git Tag Addition with Error Handling

The block that adds a Git tag is well structured with a try-catch that rethrows any exception as a GradleException. This ensures any issues during tagging are explicitly flagged. Good job here.

app/build.gradle (1)

116-120: Simplification of the releasePrepare Task

Refactoring the releasePrepare task to a simple delegation with prepareRelease() is a neat way to offload complex logic and improve maintainability. Please verify that the prepareRelease closure (set in gradle/prepare_release.gradle) is correctly loaded into the project scope at runtime. If not, you might consider explicitly referencing it via the project’s extra properties (e.g. ext.prepareRelease()).

Comment on lines +28 to +51
// Set new version name from input parameters.
def newVersionName
if (project.properties.containsKey("bumpVersion")) {
newVersionName = project.properties["bumpVersion"]
println "Bumping the version directly (bumpVersion=$newVersionName)"
} else if (project.properties.containsKey("bumpType")) {
def (major, minor, patch) = versionName.tokenize('.')
switch (bumpType) {
case "major":
major = major.toInteger() + 1
minor = 0
patch = 0
break
case "minor":
minor = minor.toInteger() + 1
break
case "patch":
patch = patch.toInteger() + 1
break
}
newVersionName = "$major.$minor.$patch"
} else {
throw new GradleException('Either bumpType or bumpVersion parameters should be provided')
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Parameter Handling for Version Bumping

There is a potential issue in the switch-case block: the variable bumpType is referenced without being explicitly defined. This could lead to runtime errors if bumpType is not already available in the scope. To improve clarity and reliability, extract the property into a local variable before using it. For instance:

-    } else if (project.properties.containsKey("bumpType")) {
-        def (major, minor, patch) = versionName.tokenize('.')
-        switch (bumpType) {
+    } else if (project.properties.containsKey("bumpType")) {
+        def bumpType = project.properties["bumpType"]
+        def (major, minor, patch) = versionName.tokenize('.')
+        switch (bumpType) {

This ensures that bumpType is defined and clarifies its provenance.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Set new version name from input parameters.
def newVersionName
if (project.properties.containsKey("bumpVersion")) {
newVersionName = project.properties["bumpVersion"]
println "Bumping the version directly (bumpVersion=$newVersionName)"
} else if (project.properties.containsKey("bumpType")) {
def (major, minor, patch) = versionName.tokenize('.')
switch (bumpType) {
case "major":
major = major.toInteger() + 1
minor = 0
patch = 0
break
case "minor":
minor = minor.toInteger() + 1
break
case "patch":
patch = patch.toInteger() + 1
break
}
newVersionName = "$major.$minor.$patch"
} else {
throw new GradleException('Either bumpType or bumpVersion parameters should be provided')
}
// Set new version name from input parameters.
def newVersionName
if (project.properties.containsKey("bumpVersion")) {
newVersionName = project.properties["bumpVersion"]
println "Bumping the version directly (bumpVersion=$newVersionName)"
} else if (project.properties.containsKey("bumpType")) {
def bumpType = project.properties["bumpType"]
def (major, minor, patch) = versionName.tokenize('.')
switch (bumpType) {
case "major":
major = major.toInteger() + 1
minor = 0
patch = 0
break
case "minor":
minor = minor.toInteger() + 1
break
case "patch":
patch = patch.toInteger() + 1
break
}
newVersionName = "$major.$minor.$patch"
} else {
throw new GradleException('Either bumpType or bumpVersion parameters should be provided')
}

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)
app/build.gradle (1)

120-120: Ensure Existence and Robustness of prepareRelease() Call
The call to prepareRelease() within the releasePrepare task now centralizes the release logic. Verify that the prepareRelease() method is properly defined in your external script and includes sufficient error handling to cover potential edge cases during version bumping and Git operations.

If additional validation or context is needed regarding the implementation inside gradle/prepare_release.gradle, please let me know.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2fbffb2 and 53c6f51.

📒 Files selected for processing (1)
  • app/build.gradle (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (windows-latest, 17)
  • GitHub Check: build (macos-latest, 17)
🔇 Additional comments (1)
app/build.gradle (1)

116-117: Modularize Release Preparation via External Script
Delegating the release preparation logic to a separate Gradle script (gradle/prepare_release.gradle) improves modularity and reusability. Ensure that this external script is maintained in tandem with any future versioning requirements and that its integration is well documented.

@tuancoltech tuancoltech changed the title WIP: Move releasePrepare task to separate script for better reusability Move releasePrepare task to separate script for better reusability Feb 26, 2025
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 (2)
gradle/perform_release.gradle (1)

1-5: Type Conversion for the "force" Parameter

When assigning the value from project.properties["force"] (line 4), consider explicitly converting it to a Boolean (e.g. using .toBoolean()) since Gradle project properties are typically strings. This will help prevent unexpected behavior when the property is set (especially if someone passes "false" accidentally).

Suggested Diff:

-        force = project.properties["force"]
+        force = project.properties["force"].toBoolean()
gradle/clean_release.gradle (1)

5-23: Git Tags Cleaning Loop and Tag Extraction

  • The loop correctly checks for commit messages containing "[gradle-release-task]" and performs the removal and reset operations.
  • Potential Enhancement on Tag Extraction (Line 10):
    The code splits the commit message on "$applicationId-" and immediately accesses the second element. This assumes that the commit message format is always valid. Consider adding a check on the length of the resulting array to prevent potential IndexOutOfBoundsException if the format unexpectedly changes.

Suggested Diff:

-            def tagName = headCommitMessage.split("$applicationId-")[1]
-            println "Removing the git tag: $tagName"
-            try {
-                grgit.tag.remove {
-                    names = [tagName]
-                }
-            } catch (Exception e) {
-                println "Error while removing git tag:\n $e"
-            }
+            def splitParts = headCommitMessage.split("$applicationId-")
+            if(splitParts.length > 1) {
+                def tagName = splitParts[1]
+                println "Removing the git tag: $tagName"
+                try {
+                    grgit.tag.remove {
+                        names = [tagName]
+                    }
+                } catch (Exception e) {
+                    println "Error while removing git tag:\n $e"
+                }
+            } else {
+                println "Warning: Unable to extract tag name from commit message: $headCommitMessage"
+            }

Overall, the loop structure and the use of grgit.reset to update headCommitMessage are appropriate.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dbb3ab0 and cbd643f.

📒 Files selected for processing (3)
  • app/build.gradle (2 hunks)
  • gradle/clean_release.gradle (1 hunks)
  • gradle/perform_release.gradle (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (windows-latest, 17)
🔇 Additional comments (9)
gradle/perform_release.gradle (3)

6-9: Push Operation and Logging

The code prints a clear message before attempting the push and then performs the push using grgit.push(force: force, tags: true). This is concise and well structured.


10-12: Exception Handling and User Guidance

The try-catch block correctly catches any push failures and throws a GradleException with a helpful message, suggesting the use of -Pforce=true to override. This is clear; however, you might consider logging the full exception details (or ensuring they are captured) to aid in debugging.


13-14: Closure Completion

The closing lines print a final "Done!" message to signal the end of the task, which provides a clear completion indicator.

gradle/clean_release.gradle (2)

1-4: Definition of the cleanRelease Closure

The closure is defined as an extra property (ext.cleanRelease) and obtains the applicationId from android.defaultConfig. Ensure that when invoked, the android configuration is already available in the project context.


24-29: Final Status Logging

The final logging (lines 25-29) cleanly informs if the repository was already clean and confirms the process completion. This enhances clarity during task execution.

app/build.gradle (4)

3-5: Modularization via External Script Inclusion

The new apply from: statements (lines 3-5) incorporate the release preparation scripts, which increases modularity and reusability. Ensure that these paths remain correct as the project structure evolves.


84-88: Simplified releaseClean Task

The releaseClean task now depends on ensureCleanRepo and simply calls the cleanRelease() closure. This clean delegation improves maintainability.


94-98: Simplified releasePrepare Task

The releasePrepare task now calls prepareRelease() within its action. This refactoring removes inline complexity, and as long as the external script is correctly implemented, it enhances readability and reuse across the project.


100-104: Simplified releasePerform Task

Similarly, the releasePerform task now delegates the push logic to performRelease(), ensuring consistency in the release process. This abstraction improves clarity and maintainability.

@tuancoltech tuancoltech changed the title Move releasePrepare task to separate script for better reusability Move release tasks to separate scripts for better reusability Feb 26, 2025
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 (3)
.github/workflows/gradle-release.yml (1)

23-29: Module-Specific Release Commands & Trailing Whitespace
The updated commands now target the app and utils modules explicitly, which improves clarity and modularity in the release process. However, note that line 27 contains trailing whitespace as flagged by YAML lint. Removing the extra spaces will help maintain a clean YAML file.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 27-27: trailing spaces

(trailing-spaces)

app/build.gradle (2)

77-81: Task: ensureCleanRepo in App Module
The ensureCleanRepo task implemented here mirrors the functionality in utils/build.gradle by calling ensureClean(). This redundancy is acceptable if the app module requires an independent cleaning check; however, consider whether consolidating to a single declaration might reduce duplication if both modules share identical criteria.


99-103: Task: releasePerform in App Module
The releasePerform task follows the established pattern by ensuring a clean repository before invoking performRelease(), which manages pushing commits. For consistency, consider aligning task registration style across modules (e.g., using tasks.register vs. legacy task definitions).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbd643f and 10c4452.

📒 Files selected for processing (4)
  • .github/workflows/gradle-release.yml (1 hunks)
  • app/build.gradle (2 hunks)
  • gradle/ensure_clean.gradle (1 hunks)
  • utils/build.gradle (2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/gradle-release.yml

[error] 27-27: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (windows-latest, 17)
  • GitHub Check: build (macos-latest, 17)
🔇 Additional comments (9)
gradle/ensure_clean.gradle (1)

1-5: Clean Repository Check Closure Implementation
The new ext.ensureClean closure is straightforward and effectively aborts execution when the repository isn’t clean. Depending on future needs, consider adding logging or more detailed instructions (for example, suggesting a Git command to view the repository status).

utils/build.gradle (5)

6-9: Applying External Release Scripts
The use of apply from: to load external Gradle scripts (prepare_release.gradle, clean_release.gradle, perform_release.gradle, and ensure_clean.gradle) enhances modularity. Please verify that these paths (using ${rootProject.projectDir}) correctly point to the intended scripts in your repository structure.


62-66: Task Registration: ensureCleanRepo
The ensureCleanRepo task is registered to call ensureClean(), ensuring that subsequent release tasks run only on a clean repository. This clear dependency helps prevent accidental releases from a dirty working directory.


68-73: Task Registration: releaseClean
The releaseClean task is properly defined to depend on ensureCleanRepo and to execute cleanRelease(). This encapsulation keeps the release cleanup process modular and ensures safety checks are performed first.


79-84: Task Registration: releasePrepare
The releasePrepare task correctly depends on ensureCleanRepo and then calls prepareRelease(). This abstraction simplifies version handling and commit operations by delegating them to an external script.


86-91: Task Registration: releasePerform
The releasePerform task follows the same good practice by ensuring a clean repository before performing the release through performRelease(). This consistency across tasks is a plus.

app/build.gradle (3)

3-6: Integrating External Release Scripts in App Module
The addition of external script calls via apply from: in the app/build.gradle file (lines 3–6) aligns this module with the modularized release process. Ensure these paths resolve correctly relative to the root project directory.


83-87: Task: releaseClean in App Module
The releaseClean task is defined to depend on ensureCleanRepo and then invoke cleanRelease(). This clear chaining of tasks reinforces safe release practices.


92-97: Task: releasePrepare in App Module
The releasePrepare task correctly leverages the shared pre-release check and delegates version handling and commit operations to prepareRelease().

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 (3)
.github/workflows/gradle-build.yml (1)

31-31: Remove Trailing Whitespace
Static analysis flagged trailing spaces on this line. Please remove any extra spaces to comply with YAML linting guidelines.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 31-31: trailing spaces

(trailing-spaces)

.github/workflows/gradle-release.yml (2)

27-27: Remove Trailing Whitespace
Static analysis indicates trailing whitespace on this line. Removing the extra spaces will help maintain clean YAML formatting.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 27-27: trailing spaces

(trailing-spaces)


33-36: Review the Release Output Directory Reference
The final step prints out the release output by navigating to a hard-coded directory:

cd ~/.m2/repository/ai/elimu/content_provider/utils/1.2.29
ls -lah

While this is useful for verifying the release, note that the version 1.2.29 is hard-coded. If future releases update the version, this path may become outdated. Consider parameterizing the version number or deriving it from project metadata to reduce maintenance overhead.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 10c4452 and 4570733.

📒 Files selected for processing (3)
  • .github/workflows/gradle-build.yml (1 hunks)
  • .github/workflows/gradle-release.yml (1 hunks)
  • utils/build.gradle (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • utils/build.gradle
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/gradle-build.yml

[error] 31-31: trailing spaces

(trailing-spaces)

.github/workflows/gradle-release.yml

[error] 27-27: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (windows-latest, 17)
🔇 Additional comments (2)
.github/workflows/gradle-build.yml (1)

24-32: Addition of a New Release Job for the Utils Module
A new job named release has been added that runs on ubuntu-latest and executes the command

./gradlew utils:releasePrepare -PbumpType=patch
echo "Release utils done!"

This addition neatly isolates release preparation for the utils module from the main build process, aligning well with the objective of achieving better reusability through separate scripts.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 31-31: trailing spaces

(trailing-spaces)

.github/workflows/gradle-release.yml (1)

23-29: Consolidation of Gradle Release Commands
The updated release step now sequentially executes the following commands:

  • ./gradlew releaseClean
  • ./gradlew app:releasePrepare -PbumpType=patch
  • ./gradlew app:releasePerform
  • ./gradlew utils:releasePrepare -PbumpType=patch
  • ./gradlew utils:releasePerform

This consolidation improves clarity and modularity by handling both app and utils releases in one unified step. Please ensure that the ordering of these commands properly reflects the dependencies between the tasks.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 27-27: trailing spaces

(trailing-spaces)

@tuancoltech tuancoltech changed the title Move release tasks to separate scripts for better reusability WIP: Move release tasks to separate scripts for better reusability Feb 27, 2025
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 (3)
.github/workflows/gradle-build.yml (3)

30-31: Update Java Setup Action Version
Static analysis highlights that the runner for actions/setup-java@v3 is outdated. Consider upgrading to a later version (e.g., actions/setup-java@v4) to ensure better compatibility and access to the latest features and security fixes.

-        uses: actions/setup-java@v3
+        uses: actions/setup-java@v4
🧰 Tools
🪛 actionlint (1.7.4)

30-30: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


28-28: Fix Indentation for Checkout Step
YAMLlint reports that line 28 has incorrect indentation (expected 4 spaces instead of 6). Correcting the indentation here will help avoid potential YAML parsing issues.

Please adjust the indentation so that it aligns with the expected YAML structure.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 28-28: wrong indentation: expected 4 but found 6

(indentation)


42-42: Remove Trailing Spaces
There are trailing spaces detected on line 42 which can lead to YAMLlint warnings. Removing these extraneous spaces will clean up the file formatting.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 42-42: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4570733 and 832d91d.

📒 Files selected for processing (1)
  • .github/workflows/gradle-build.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/gradle-build.yml

30-30: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 YAMLlint (1.35.1)
.github/workflows/gradle-build.yml

[warning] 28-28: wrong indentation: expected 4 but found 6

(indentation)


[error] 42-42: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build (windows-latest, 21)
  • GitHub Check: build (windows-latest, 17)
🔇 Additional comments (1)
.github/workflows/gradle-build.yml (1)

25-43: Structured Release Job Implementation
The new release job is well-organized and clearly separates the release-related Gradle calls into its own job. This modularization improves reusability and maintains a clean CI/CD pipeline. Please ensure that the external Gradle scripts (clean_release.gradle, prepare_release.gradle, and perform_release.gradle) referenced via the tasks (utils:releaseClean, etc.) are also updated and well tested.

🧰 Tools
🪛 actionlint (1.7.4)

30-30: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 YAMLlint (1.35.1)

[warning] 28-28: wrong indentation: expected 4 but found 6

(indentation)


[error] 42-42: trailing spaces

(trailing-spaces)

@jo-elimu
Copy link
Member

jo-elimu commented Mar 1, 2025

@tuancoltech Looks like there is an issue with a local Maven repository?: https://github.com/elimu-ai/content-provider/actions/runs/13560106067/job/37901550735?pr=154

ls: cannot access '/home/runner/.m2/repository/ai/elimu/content_provider/utils/1.2.29': No such file or directory

@tuancoltech
Copy link
Member Author

@tuancoltech Looks like there is an issue with a local Maven repository?: https://github.com/elimu-ai/content-provider/actions/runs/13560106067/job/37901550735?pr=154

ls: cannot access '/home/runner/.m2/repository/ai/elimu/content_provider/utils/1.2.29': No such file or directory

@jo-elimu Yes this PR is still in-progress. I'm working on it.

@jo-elimu jo-elimu marked this pull request as draft March 4, 2025 08:47
@jo-elimu jo-elimu mentioned this pull request Apr 29, 2025
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement version bumping via Gradle task for the utils module
2 participants