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

[AndroidManifest] Reveal Manifest Changes in PR #13582

Draft
wants to merge 15 commits into
base: trunk
Choose a base branch
from

Conversation

ParaskP7
Copy link
Contributor

Project Thread: paaHJt-7Tl-p2
Depends On: a8c-ci-toolkit#152


Description

TODO


Testing information

TODO


  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@ParaskP7 ParaskP7 added status: do not merge Dependent on another PR, ready for review but not ready for merge. category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. Core labels Feb 18, 2025
@ParaskP7 ParaskP7 force-pushed the manifest/reveal-changes-in-pr branch 19 times, most recently from 4a8b9a6 to a2993ee Compare February 21, 2025 14:47
@woocommerce woocommerce deleted a comment from wpmobilebot Feb 21, 2025
@ParaskP7 ParaskP7 force-pushed the manifest/reveal-changes-in-pr branch from f962e5d to 3bbd5e2 Compare February 21, 2025 15:27
@woocommerce woocommerce deleted a comment from wpmobilebot Feb 21, 2025
@woocommerce woocommerce deleted a comment from wpmobilebot Feb 21, 2025
@ParaskP7 ParaskP7 force-pushed the manifest/reveal-changes-in-pr branch from 3bbd5e2 to b8d0a8c Compare February 21, 2025 15:53
@ParaskP7 ParaskP7 force-pushed the manifest/reveal-changes-in-pr branch from b8d0a8c to 545e874 Compare February 26, 2025 15:48
Copy link

coderabbitai bot commented Feb 26, 2025

📝 Walkthrough

Walkthrough

This pull request introduces several new build scripts for managing merged manifests. The new scripts (for diffing, restoring, and saving manifests) use a build variant argument and invoke associated functions and Fastlane commands. The Buildkite pipeline is updated to replace multiple linting and testing steps with a manifest diff step, and a new schedule for storing merged manifests is added. Additionally, the CI toolkit version is updated. The pull request also adds the Singular library as a dependency to both WooCommerce projects, along with corresponding version and repository configurations in Gradle.

Changes

File(s) Change Summary
.buildkite/commands/diff-merged-manifest.sh
.buildkite/commands/restore-merged-manifest.sh
.buildkite/commands/save-merged-manifest.sh
New shell scripts introduced for diffing, restoring, and saving merged manifests using a build variant argument and invoking associated functions and Fastlane commands.
.buildkite/pipeline.yml
.buildkite/schedules/merged-manifest-storage.yml
.buildkite/shared-pipeline-vars
Buildkite pipeline updated: removed several linting/test steps; added a manifest diff step and a merged manifest storage schedule; updated CI toolkit version.
WooCommerce/build.gradle
WooCommerce-Wear/build.gradle
Added a new dependency (implementation(libs.singular)) to include the Singular library in both projects.
gradle/libs.versions.toml
settings.gradle
Added a new version entry and library declaration for Singular in the Gradle configuration; added a Maven repository URL for singular artifacts.

Sequence Diagram(s)

sequenceDiagram
    participant BK as Buildkite Pipeline
    participant Diff as diff-merged-manifest.sh
    participant Restore as restore-merged-manifest.sh
    participant Cache as restore-cache.sh
    participant Gem as install_gems
    participant Fastlane as Fastlane
    participant Gradle as Gradle

    BK->>Diff: Trigger with BUILD_VARIANT
    Diff->>Restore: Run for "WooCommerce" module with BUILD_VARIANT
    Diff->>Restore: Run for "WooCommerce-Wear" module with BUILD_VARIANT
    Diff->>Cache: Execute restore-cache.sh
    Diff->>Gem: Install Ruby gems
    Diff->>Fastlane: Run Fastlane command to apply configuration secrets
    Diff->>Gradle: Execute process"${BUILD_VARIANT^}"Manifest
    Gradle-->>Diff: Return merged manifest
    Diff->>BK: Output merged manifest differences
Loading
sequenceDiagram
    participant Scheduler as Buildkite Schedule
    participant Save as save-merged-manifest.sh
    participant Cache as restore-cache.sh
    participant Gem as install_gems
    participant Fastlane as Fastlane
    participant Gradle as Gradle
    participant SaveMF as save_android_merged_manifest

    Scheduler->>Save: Trigger with BUILD_VARIANT
    Save->>Cache: Execute restore-cache.sh
    Save->>Gem: Install Ruby gems
    Save->>Fastlane: Run Fastlane command for configuration secrets
    Save->>Gradle: Run Gradle assemble command for merged manifest
    Gradle-->>Save: Merged manifest created
    Save->>SaveMF: Save merged manifest for "WooCommerce"
    Save->>SaveMF: Save merged manifest for "WooCommerce-Wear"
    Save->>Scheduler: Complete manifest storage process
Loading

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

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.

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Feb 26, 2025

Project manifest changes

The following changes in WooCommerce AndroidManifest.xml were detected (build variant: jalapenoDebug):

--- ./build/reports/diff_manifest/WooCommerce/jalapenoDebug/trunk_AndroidManifest.txt	2025-02-26 16:04:50.181552385 +0000
+++ ./build/reports/diff_manifest/WooCommerce/jalapenoDebug/pr_AndroidManifest.txt	2025-02-26 16:04:50.191552366 +0000
@@ -56,6 +56,12 @@
         <intent>
             <action android:name="android.intent.action.GET_CONTENT" />
         </intent>
+        <intent>
+            <action android:name="com.singular.preinstall.READ_PERMISSION_SINGULAR" />
+        </intent>
+
+        <package android:name="com.facebook.katana" />
+        <package android:name="com.instagram.android" />
     </queries>
 
     <uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
@@ -80,6 +86,7 @@
     <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- Required by older versions of Google Play services to create IID tokens -->
     <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
     <uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
+    <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
 
     <permission

@wpmobilebot
Copy link
Collaborator

Project manifest changes

The following changes in WooCommerce-Wear AndroidManifest.xml were detected (build variant: jalapenoDebug):

--- ./build/reports/diff_manifest/WooCommerce-Wear/jalapenoDebug/trunk_AndroidManifest.txt	2025-02-26 16:04:51.241550361 +0000
+++ ./build/reports/diff_manifest/WooCommerce-Wear/jalapenoDebug/pr_AndroidManifest.txt	2025-02-26 16:04:51.241550361 +0000
@@ -20,10 +20,18 @@
         <intent>
             <action android:name="androidx.wear.tiles.action.BIND_UPDATE_REQUESTER" />
         </intent>
+        <intent>
+            <action android:name="com.singular.preinstall.READ_PERMISSION_SINGULAR" />
+        </intent>
+
+        <package android:name="com.facebook.katana" />
+        <package android:name="com.instagram.android" />
     </queries>
 
     <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
     <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
+    <uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
+    <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
 
     <permission
         android:name="com.woocommerce.android.prealpha.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"

@ParaskP7
Copy link
Contributor Author

@coderabbitai review

Copy link

coderabbitai bot commented Feb 26, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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: 2

🧹 Nitpick comments (4)
.buildkite/schedules/merged-manifest-storage.yml (1)

7-10: Manifest Storage Step Configuration
The step (lines 7–10) defines the command to invoke .buildkite/commands/save-merged-manifest.sh with the argument jalapenoDebug and attaches the $CI_TOOLKIT plugin. Please verify that the referenced script exists in the proper directory and that the argument aligns with your build configuration.

.buildkite/commands/restore-merged-manifest.sh (1)

1-7: Clarify Error Handling in the Restore Script
The script correctly uses #!/bin/bash -e for immediate exit on errors; however, the use of || true after the call to restore_android_merged_manifest may be non-obvious to new readers. Consider adding a brief inline comment to clarify that any errors from the restore command are intentionally ignored so that the script does not fail the build.

.buildkite/commands/save-merged-manifest.sh (1)

5-5: Execution of restore-cache.sh
The line

"$(dirname "${BASH_SOURCE[0]}")/restore-cache.sh"

executes the restore-cache.sh script. For clarity and maintainability, adding a short comment to explain what cache is being restored and why would be beneficial.

.buildkite/commands/diff-merged-manifest.sh (1)

5-7: Consistent Invocation of Restore Functions
The script invokes restore-merged-manifest.sh for both "WooCommerce" and "WooCommerce-Wear" modules. It would be helpful to add brief comments indicating the purpose of these calls—such as “Restoring merged manifest for module X”—to make the script easier to follow.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8a9057 and a0cce29.

📒 Files selected for processing (10)
  • .buildkite/commands/diff-merged-manifest.sh (1 hunks)
  • .buildkite/commands/restore-merged-manifest.sh (1 hunks)
  • .buildkite/commands/save-merged-manifest.sh (1 hunks)
  • .buildkite/pipeline.yml (1 hunks)
  • .buildkite/schedules/merged-manifest-storage.yml (1 hunks)
  • .buildkite/shared-pipeline-vars (1 hunks)
  • WooCommerce-Wear/build.gradle (1 hunks)
  • WooCommerce/build.gradle (1 hunks)
  • gradle/libs.versions.toml (2 hunks)
  • settings.gradle (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .buildkite/shared-pipeline-vars
🔇 Additional comments (10)
.buildkite/schedules/merged-manifest-storage.yml (2)

1-3: New Buildkite Schedule File Introduced
This YAML file sets up a new Buildkite schedule for storing merged manifests. The header (lines 1–3) correctly specifies the schema for YAML validation.


4-6: Agents Block Configuration
The agents block (lines 4–6) configures the pipeline to use the "android" queue. This clearly directs the job to the correct agent pool.

WooCommerce-Wear/build.gradle (1)

209-211: Singular Dependency Addition
A new dependency (implementation(libs.singular)) has been appended at line 210. Ensure that the version declared in your gradle/libs.versions.toml (set to "12.6.1") and the corresponding Maven repository (defined in settings.gradle) are in sync. This change looks consistent with the modifications in the WooCommerce module.

WooCommerce/build.gradle (1)

440-442: Singular Dependency Addition in WooCommerce Module
The addition of implementation(libs.singular) in the dependencies block (around line 441) integrates the Singular SDK into this module. Confirm that this dependency meets the module’s requirements and that any related configuration (e.g., ProGuard rules if needed) is appropriately updated.

settings.gradle (1)

70-73: New Maven Repository for Singular SDK
Lines 70–73 add a new Maven repository with the URL https://maven.singular.net. This repository is essential for resolving the Singular SDK dependency. Please confirm that this URL is correct and that access permissions (if any) are properly configured.

gradle/libs.versions.toml (2)

91-93: Singular Version Declaration Added
A new version entry for the Singular SDK (singular = "12.6.1") has been added. Ensure that this version is tested and compatible with your project’s requirements.


254-256: Singular Library Entry Defined
A matching library declaration (singular = { module = "com.singular.sdk:singular_sdk", version.ref = "singular" }) has been added in the libraries section. This entry helps manage the dependency centrally via the version defined above.

.buildkite/commands/save-merged-manifest.sh (1)

1-24: Overall Script Flow and Error Handling
This script follows a clear sequence—from setting the build variant, restoring the cache, and configuring tools, to assembling and saving merged manifests for both modules. The use of set -euo pipefail (starting at line 7) enhances robustness. Double-check that the Gradle command with the uppercase conversion ("${BUILD_VARIANT^}") behaves as expected on your target environments.

.buildkite/pipeline.yml (1)

8-12: CI Pipeline Step Configuration
The new "💾 Restore and Diff Merged Manifest" step is well defined. The command references the correct script and passes the expected jalapenoDebug argument. The use of artifact paths for diff reports looks consistent. Just verify that all referenced scripts (e.g. diff-merged-manifest.sh) are present and executable within the repository.

.buildkite/commands/diff-merged-manifest.sh (1)

13-28: Manifest Diff Process and External Function Reliance
The remaining steps—setting up Ruby gems, installing secrets, creating the merged manifest, and diffing the manifests for both modules—are clearly structured. Please ensure that helper functions like install_gems and comment_with_manifest_diff are defined and available in the environment. Also, verify that the Bash string expansion ("${BUILD_VARIANT^}") for capitalizing the first letter works consistently in your target shell environments.

Comment on lines +1 to +3
#!/bin/bash

BUILD_VARIANT=$1
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Position Strict Error Handling Early
The script currently sets the strict error handling (set -euo pipefail) on line 11. To ensure that all commands (including the initial restore commands) are executed with strict error handling, consider moving this setting immediately after the shebang, at the top of the script.

Comment on lines +9 to +11
"$(dirname "${BASH_SOURCE[0]}")/restore-cache.sh"

set -euo pipefail
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Ordering and Error Handling of Cache Restoration
The call to restore-cache.sh (line 9) is executed before setting strict error handling on line 11. Relocating the set -euo pipefail to the very top (as suggested above) will ensure that any error during cache restoration is caught.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. Core status: do not merge Dependent on another PR, ready for review but not ready for merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants