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

fix: build wallet_app example with java 21 #437

Merged

Conversation

ptisserand
Copy link
Collaborator

@ptisserand ptisserand commented Jan 10, 2025

  • Add job to build wallet_app example on Android

Summary by CodeRabbit

  • New Features

    • Added GitHub Actions workflow for Android application build process
    • Introduced environment configuration for Java version 21
    • Created automated setup for Android development environment
  • Chores

    • Configured CI/CD pipeline for building Android examples
    • Set up Flutter and Android dependency management

Copy link

docs-page bot commented Jan 10, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/focustree/starknet.dart~437

Documentation is deployed and generated using docs.page.

Copy link
Contributor

coderabbitai bot commented Jan 10, 2025

Warning

Rate limit exceeded

@ptisserand has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 41 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7f26a7d and e0ff890.

📒 Files selected for processing (3)
  • .github/actions/android-setup/action.yaml (1 hunks)
  • .github/workflows/build-android-examples.yaml (1 hunks)
  • examples/wallet_app/android/settings.gradle (1 hunks)

Walkthrough

This pull request introduces a comprehensive setup for building Android examples in a GitHub Actions workflow. It adds a new environment configuration with Java version 21, creates a custom GitHub Actions workflow for Android environment setup, and establishes a workflow to build Android wallet app examples. The changes focus on standardizing and automating the Android build process across the project's continuous integration environment.

Changes

File Change Summary
.env.ci Added new environment variable JAVA_VERSION=21
.github/actions/android-setup/action.yaml Created new composite action for Android environment setup, including loading .env.ci variables and configuring Java and Android SDK
.github/workflows/build-android-examples.yaml Added new workflow to build Android wallet app examples, triggered manually, with steps for repository checkout, Flutter setup, Android environment configuration, and app building

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Actions
    participant Env as .env.ci
    participant Java as Java Setup
    participant Android as Android SDK Setup
    participant Flutter as Flutter Setup
    participant App as Wallet App

    GH->>Env: Load environment variables
    Env-->>Java: Provide Java version
    Java->>Java: Configure Java 21
    Java-->>Android: Java ready
    Android->>Android: Configure SDK
    Flutter->>Flutter: Setup Flutter
    App->>App: Build appbundle
Loading

Possibly related PRs

Poem

🐰 In the realm of code so bright,
Java twenty-one takes flight!
Android builds with GitHub's might,
Workflows dancing left and right,
A rabbit's build, a pure delight! 🚀


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. (Beta)
  • @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
Contributor

@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: 3

🧹 Nitpick comments (1)
.github/workflows/build-android-examples.yaml (1)

16-18: Consider adding build type options.

The workflow only builds an app bundle. Consider adding options to build different variants (debug, release) or APK format.

Example implementation:

      - name: Build wallet_app example
        run: |
          flutter build appbundle --release
          flutter build apk --debug
          flutter build apk --release
        working-directory: ./examples/wallet_app
🧰 Tools
🪛 yamllint (1.35.1)

[warning] 17-17: too many spaces before colon

(colons)


[error] 18-18: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between cf98696 and 7f26a7d.

📒 Files selected for processing (3)
  • .env.ci (1 hunks)
  • .github/actions/android-setup/action.yaml (1 hunks)
  • .github/workflows/build-android-examples.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .env.ci
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/build-android-examples.yaml

12-12: description is required in metadata of "Setup Flutter Environment from environment" action at "/inmem/22/2b951b0b-e2b6-4473-998c-cdec5d1346f5/home/jailuser/git/.github/actions/flutter-setup/action.yaml"

(action)


14-14: description is required in metadata of "Setup environment to build Android application" action at "/inmem/22/2b951b0b-e2b6-4473-998c-cdec5d1346f5/home/jailuser/git/.github/actions/android-setup/action.yaml"

(action)

🪛 yamllint (1.35.1)
.github/workflows/build-android-examples.yaml

[warning] 17-17: too many spaces before colon

(colons)


[error] 18-18: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: test-integration
  • GitHub Check: analyze
  • GitHub Check: lint
🔇 Additional comments (3)
.github/actions/android-setup/action.yaml (2)

11-15: Verify Java version configuration.

The Java version is dynamically loaded from .env.ci. Let's verify if this file exists and contains the correct version.

✅ Verification successful

Java version configuration is correctly implemented

The setup properly loads Java version 21 from .env.ci using dotenv-action and correctly passes it to setup-java action.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if .env.ci exists and contains JAVA_VERSION=21
if [ -f ".env.ci" ]; then
    grep "JAVA_VERSION=" .env.ci
else
    echo ".env.ci file not found"
fi

Length of output: 65


Script:

#!/bin/bash
# Check the load-env step implementation
cat .github/actions/android-setup/action.yaml

Length of output: 495


6-10: Verify the dotenv-action version for security.

The action uses a fixed version of dotenv-action (v1.1.4). Let's verify if this is the latest secure version.

✅ Verification successful

The dotenv-action version v1.1.4 is secure and up-to-date

The current version is the latest release from July 2024, and there are no reported security vulnerabilities. The project is actively maintained.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check the latest release and security advisories for falti/dotenv-action
gh api repos/falti/dotenv-action/releases/latest --jq .tag_name

# Check for any security advisories
gh api graphql -f query='
{
  securityVulnerabilities(first: 5, ecosystem: ACTIONS, package: "dotenv-action") {
    nodes {
      advisory {
        summary
        severity
        publishedAt
      }
    }
  }
}'

Length of output: 339


Script:

#!/bin/bash
# Check the latest release date and recent commit activity
gh api repos/falti/dotenv-action/releases/latest --jq '.published_at'
gh api repos/falti/dotenv-action/commits --jq '.[0].commit.author.date'

Length of output: 185

.github/workflows/build-android-examples.yaml (1)

11-14: Verify local action configurations.

The workflow uses local actions for Flutter and Android setup. Let's verify their existence and configurations.

✅ Verification successful

Local actions are properly configured and functional

Both Flutter and Android setup actions exist with proper configurations, using established third-party actions and following GitHub Actions best practices.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the local actions exist and have proper configurations
for action in "flutter-setup" "android-setup"; do
    if [ -f ".github/actions/$action/action.yaml" ]; then
        echo "Found $action action"
        grep -A 5 "name:" ".github/actions/$action/action.yaml"
    else
        echo "Missing $action action"
    fi
done

Length of output: 1240

🧰 Tools
🪛 actionlint (1.7.4)

12-12: description is required in metadata of "Setup Flutter Environment from environment" action at "/inmem/22/2b951b0b-e2b6-4473-998c-cdec5d1346f5/home/jailuser/git/.github/actions/flutter-setup/action.yaml"

(action)


14-14: description is required in metadata of "Setup environment to build Android application" action at "/inmem/22/2b951b0b-e2b6-4473-998c-cdec5d1346f5/home/jailuser/git/.github/actions/android-setup/action.yaml"

(action)

@ptisserand ptisserand force-pushed the fix/build_example_wallet_app_java_21 branch from 33f9bdf to e0ff890 Compare January 10, 2025 20:03
@ptisserand ptisserand merged commit 97c67ed into focustree:main Jan 10, 2025
8 checks passed
@ptisserand ptisserand deleted the fix/build_example_wallet_app_java_21 branch January 10, 2025 20:08
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.

1 participant