Skip to content

fix: cherry pick form https://github.com/apache/commons-beanutils/com…#1

Merged
kycheng merged 4 commits intoalauda-1.9from
fix/vul
Aug 8, 2025
Merged

fix: cherry pick form https://github.com/apache/commons-beanutils/com…#1
kycheng merged 4 commits intoalauda-1.9from
fix/vul

Conversation

@kycheng
Copy link
Copy Markdown
Collaborator

@kycheng kycheng commented Aug 7, 2025

fix: cherry pick form apache@bd20740 to fix vul CVE-2025-48734

Thanks for your contribution to Apache Commons! Your help is appreciated!

Before you push a pull request, review this list:

  • Read the contribution guidelines for this project.
  • Read the ASF Generative Tooling Guidance if you use Artificial Intelligence (AI).
  • I used AI to create any part of, or all of, this pull request.
  • Run a successful build using the default Maven goal with mvn; that's mvn on the command line by itself.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible, but it is a best-practice.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body. Note that a maintainer may squash commits during the merge process.

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced security by suppressing access to the "declaringClass" property on enums by default, addressing CVE-2025-48734.
  • New Features

    • Added an option to enable access to the "declaringClass" property for advanced scenarios.
  • Tests

    • Included tests verifying both the default suppression and optional access to the "declaringClass" property on enums.
  • Chores

    • Updated project version and Java compatibility settings.
    • Added the new release entry to the release notes.
    • Introduced automated workflows for code analysis, dependency review, multi-version Java builds, supply-chain security analysis, and package publishing.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 7, 2025

Walkthrough

This change updates the project version and Java compatibility in the build configuration, adds a new release entry documenting a security fix, introduces a new introspector to suppress the declaringClass property for enums, and implements related tests to verify this suppression and its security implications. Additionally, several GitHub Actions workflows for CI, security analysis, dependency review, and package publishing are added.

Changes

Cohort / File(s) Change Summary
Build Configuration Update
pom.xml
Project version updated to 1.9.5; Java source/target versions changed from 1.6 to 1.8; added distribution repository for GitHub Packages.
Release Documentation
src/changes/changes.xml
Added release notes for version 1.9.5, documenting a bugfix for CVE-2025-48734 and the addition of SUPPRESS_DECLARING_CLASS.
Property Introspection Logic
src/main/java/org/apache/commons/beanutils/PropertyUtilsBean.java
Added SuppressPropertiesBeanIntrospector.SUPPRESS_DECLARING_CLASS to the default introspectors; fixed minor Javadoc formatting.
Introspector Enhancement
src/main/java/org/apache/commons/beanutils/SuppressPropertiesBeanIntrospector.java
Introduced new public static final instance SUPPRESS_DECLARING_CLASS to suppress the declaringClass property for enums.
Enum Test Fixture
src/test/java/org/apache/commons/beanutils/TestEnum.java
Added new enum TestEnum with constants A, B, and C for testing purposes.
Security Regression Tests
src/test/java/org/apache/commons/beanutils/bugs/EnumDeclaringClassTest.java
Added tests verifying suppression of declaringClass property by default and the ability to opt out, covering both BeanUtilsBean and PropertyUtilsBean scenarios.
GitHub Actions Workflows
.github/workflows/codeql-analysis.yml, .github/workflows/dependency-review.yml, .github/workflows/maven.yaml, .github/workflows/scorecards-analysis.yml, .github/workflows/publish-github-packages.yaml
Added new CI and security workflows for CodeQL analysis, dependency review, Maven builds across multiple Java versions, OSSF Scorecards supply-chain security analysis, and GitHub Packages publishing on release.

Sequence Diagram(s)

sequenceDiagram
    participant Test as EnumDeclaringClassTest
    participant BeanUtils as BeanUtilsBean / PropertyUtilsBean
    participant Introspector as SuppressPropertiesBeanIntrospector
    participant Enum as TestEnum

    Test->>BeanUtils: Request property "testEnum.declaringClass"
    BeanUtils->>Introspector: Check if "declaringClass" is suppressed
    alt Suppression enabled (default)
        Introspector-->>BeanUtils: "declaringClass" suppressed
        BeanUtils-->>Test: Throw NoSuchMethodException
    else Suppression disabled (opt-out)
        Introspector-->>BeanUtils: "declaringClass" allowed
        BeanUtils->>Enum: Access declaringClass
        Enum-->>BeanUtils: Return Class object
        BeanUtils-->>Test: Return Class object
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A hop and a skip, new version in tow,
Java eight’s the path where our beans now grow.
Declaring class hidden, a bug squashed with care,
Security’s tighter, no secrets to share.
Enum tests are hopping—let’s give a cheer,
For safer beans and a bright new year!
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/vul

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests 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
Copy Markdown

@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 (6)
src/changes/changes.xml (1)

31-34: Release entry missing tracking ID

Consider attaching the internal JIRA ticket (if any) or the CVE number directly in an issue attribute so downstream tooling can hyperlink it, e.g.:

-    <action type="add" dev="ggregory" due-to="Gary Gregory">Add org.apache.commons.beanutils.SuppressPropertiesBeanIntrospector.SUPPRESS_DECLARING_CLASS.</action>
+    <action type="add" dev="ggregory" due-to="Gary Gregory" issue="CVE-2025-48734">
+        Add org.apache.commons.beanutils.SuppressPropertiesBeanIntrospector.SUPPRESS_DECLARING_CLASS.
+    </action>

Not mandatory, but improves traceability in generated release notes.

src/test/java/org/apache/commons/beanutils/bugs/EnumDeclaringClassTest.java (3)

96-111: Improve assertion pattern for exception testing.

The test correctly verifies default suppression behavior but uses a suboptimal assertion pattern.

Apply this diff to improve the assertion pattern:

         try {
             bub.getProperty(fixture, "testEnum.declaringClass.classLoader");
-            assertTrue("Expected NoSuchMethodException", false);
+            fail("Expected NoSuchMethodException");
         } catch (NoSuchMethodException e) {
             // Expected
         }
         try {
             bub.getPropertyUtils().getNestedProperty(fixture, "testEnum.declaringClass.classLoader");
-            assertTrue("Expected NoSuchMethodException", false);
+            fail("Expected NoSuchMethodException");
         } catch (NoSuchMethodException e) {
             // Expected
         }

Also add the required import:

 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;

116-126: Improve assertion pattern for exception testing.

Similar to the previous test, this uses a suboptimal assertion pattern for exception verification.

Apply this diff to improve the assertion:

         try {
             propertyUtilsBean.getNestedProperty(fixture, "testEnum.declaringClass.classLoader");
-            assertTrue("Expected NoSuchMethodException", false);
+            fail("Expected NoSuchMethodException");
         } catch (NoSuchMethodException e) {
             // Expected
         }

92-126: Improve test assertion pattern.

The tests correctly verify the default suppression behavior, but the assertion pattern could be improved for better readability.

Replace the assertTrue("Expected NoSuchMethodException", false) pattern with fail():

-            assertTrue("Expected NoSuchMethodException", false);
+            fail("Expected NoSuchMethodException");

This makes the intent clearer and follows standard JUnit practices. Apply this change to lines 101, 107, and 122.

The test logic correctly validates that declaringClass access is blocked by default for security.

src/main/java/org/apache/commons/beanutils/SuppressPropertiesBeanIntrospector.java (2)

51-60: Fix javadoc description for accuracy.

The implementation correctly follows the established pattern and serves the security purpose. However, the javadoc description contains an inaccuracy.

Apply this diff to correct the javadoc:

-     * instance as {@code BeanIntrospector} to an instance of {@code PropertyUtilsBean} suppresses the {@code class} property; it can then no longer be
+     * instance as {@code BeanIntrospector} to an instance of {@code PropertyUtilsBean} suppresses the {@code declaringClass} property; it can then no longer be

The rest of the implementation correctly creates an introspector to suppress the "declaringClass" property for security purposes.


51-60: LGTM! Security constant properly implemented.

The new SUPPRESS_DECLARING_CLASS constant follows the established pattern and correctly addresses the security vulnerability by suppressing access to the declaringClass property of enums.

Consider this minor grammatical improvement for the Javadoc:

-     * A specialized instance which is configured to suppress the special {@code class} properties of Java beans. Unintended access to the call for
-     * {@code declaringClass} (which is common to all Java {@code enum}) can be a security risk because it also allows access to the class loader. Adding this
-     * instance as {@code BeanIntrospector} to an instance of {@code PropertyUtilsBean} suppresses the {@code class} property; it can then no longer be
+     * A specialized instance which is configured to suppress the special {@code declaringClass} property of Java enums. Unintended access to the
+     * {@code declaringClass} property (which is common to all Java {@code enum} types) can be a security risk because it also allows access to the class loader. Adding this
+     * instance as {@code BeanIntrospector} to an instance of {@code PropertyUtilsBean} suppresses the {@code declaringClass} property; it can then no longer be
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 04b7f3f and a9bc9aa.

📒 Files selected for processing (6)
  • pom.xml (1 hunks)
  • src/changes/changes.xml (1 hunks)
  • src/main/java/org/apache/commons/beanutils/PropertyUtilsBean.java (2 hunks)
  • src/main/java/org/apache/commons/beanutils/SuppressPropertiesBeanIntrospector.java (1 hunks)
  • src/test/java/org/apache/commons/beanutils/TestEnum.java (1 hunks)
  • src/test/java/org/apache/commons/beanutils/bugs/EnumDeclaringClassTest.java (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/main/java/org/apache/commons/beanutils/PropertyUtilsBean.java (1)
src/main/java/org/apache/commons/beanutils/SuppressPropertiesBeanIntrospector.java (1)
  • SuppressPropertiesBeanIntrospector (39-101)
🔇 Additional comments (19)
pom.xml (1)

35-36: Java 8 compiler target: OK

Moving the source/target level from 1.6 → 1.8 aligns the build with current ASF guidelines and the new enum-introspector code. No issues spotted.

src/test/java/org/apache/commons/beanutils/TestEnum.java (1)

18-33: LGTM – minimal, purposeful test fixture

The enum is lightweight and scoped to tests only; naming and javadoc are clear. No further action required.

src/main/java/org/apache/commons/beanutils/PropertyUtilsBean.java (6)

192-192: Security enhancement implemented correctly.

The addition of SUPPRESS_DECLARING_CLASS introspector aligns with the security fix for CVE-2025-48734. By default suppressing the declaringClass property on enums prevents unintended access to class loaders, which addresses the identified vulnerability.


360-360: Minor formatting improvement.

The Javadoc indentation has been corrected for better consistency.


192-192: Security enhancement correctly implemented.

The addition of SUPPRESS_DECLARING_CLASS introspector effectively addresses the CVE-2025-48734 vulnerability by preventing unintended access to the declaringClass property on enum objects, which could expose the class loader. The placement in resetBeanIntrospectors() ensures it's applied by default while still allowing opt-out when necessary.


360-360: LGTM!

Minor formatting correction improves javadoc consistency and readability.


192-192: LGTM! Security enhancement correctly implemented.

Adding SUPPRESS_DECLARING_CLASS to the default introspectors follows the established pattern and effectively mitigates CVE-2025-48734 by preventing unintended access to enum's declaringClass property, which could expose the class loader.


360-360: LGTM! Minor formatting improvement.

Fixed indentation in the Javadoc comment for better consistency.

src/test/java/org/apache/commons/beanutils/bugs/EnumDeclaringClassTest.java (11)

32-52: Well-designed test fixture.

The Fixture class provides appropriate test data with both a simple property (name) and an enum property (testEnum) for comprehensive testing scenarios.


57-73: Comprehensive opt-out test for BeanUtilsBean.

The test correctly verifies that removing the SUPPRESS_DECLARING_CLASS introspector allows access to sensitive enum properties, while properly asserting the expected types and non-null values.


78-90: Comprehensive opt-out test for PropertyUtilsBean.

The test correctly verifies the opt-out behavior for PropertyUtilsBean, ensuring consistent behavior across both utility classes.


32-52: LGTM!

The Fixture class provides a clean test fixture following JavaBean conventions, with the necessary enum property to test declaringClass access scenarios.


54-90: LGTM!

These tests effectively verify the opt-out functionality, ensuring users can disable the security restriction when needed. The tests properly validate both direct property access and nested property traversal for both BeanUtilsBean and PropertyUtilsBean scenarios.


30-127: Excellent test coverage for the security feature.

This test class provides comprehensive coverage of the new declaringClass suppression functionality, testing both the default secure behavior and the opt-out capability across both BeanUtilsBean and PropertyUtilsBean scenarios. The test structure is well-organized and clearly demonstrates the security implications of the feature.


30-52: LGTM! Well-designed test fixture.

The Fixture class provides appropriate test data with both a regular property (name) and an enum property (testEnum) to validate the declaringClass suppression functionality.


54-73: LGTM! Comprehensive opt-out test for BeanUtilsBean.

This test properly verifies that when the SUPPRESS_DECLARING_CLASS introspector is removed, access to the declaringClass property and its nested classLoader is permitted. Good coverage of both string and typed access patterns.


75-90: LGTM! Comprehensive opt-out test for PropertyUtilsBean.

This test mirrors the BeanUtilsBean test but focuses on PropertyUtilsBean functionality, ensuring consistent behavior across both utility classes.


92-111: LGTM! Proper validation of default security behavior.

This test correctly verifies that by default, the declaringClass.classLoader property access is blocked and throws NoSuchMethodException, confirming the security fix is active by default.


113-127: LGTM! Complete test coverage for PropertyUtilsBean default behavior.

This test complements the BeanUtilsBean default behavior test, ensuring the security suppression works consistently across both utility classes.

Comment thread pom.xml Outdated
Copy link
Copy Markdown

@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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a9bc9aa and bfe9f68.

📒 Files selected for processing (4)
  • .github/workflows/codeql-analysis.yml (1 hunks)
  • .github/workflows/dependency-review.yml (1 hunks)
  • .github/workflows/maven.yaml (1 hunks)
  • .github/workflows/scorecards-analysis.yml (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/dependency-review.yml
  • .github/workflows/codeql-analysis.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/maven.yaml

[warning] 37-37: wrong indentation: expected 10 but found 12

(indentation)


[error] 41-41: trailing spaces

(trailing-spaces)


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

(indentation)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: Analyze (java)
  • GitHub Check: Analyze (java)

Comment thread .github/workflows/maven.yaml
Comment thread .github/workflows/maven.yaml
Comment on lines +22 to +23
push:
branches: [ $default-branch ]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Undefined branches placeholder will break the trigger

$default-branch is not a GitHub Actions context or environment variable, so the workflow will try to match a literal branch with that name.
Use the repository default branch dynamically or hard-code main/master.

-    branches: [ $default-branch ]
+    # If you want it dynamic
+    branches: [ ${{ github.event.repository.default_branch }} ]
+    # …or just name it explicitly
+#   branches: [ main ]

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .github/workflows/scorecards-analysis.yml at lines 22 to 23, the push trigger
uses an undefined placeholder `$default-branch` for branches, which will not
work as expected. Replace `$default-branch` with either the actual default
branch name like `main` or `master`, or use GitHub Actions' built-in context to
dynamically reference the default branch if supported, ensuring the workflow
triggers correctly on pushes to the intended branch.

Comment on lines +25 to +39
permissions: read-all

jobs:

analysis:

name: "Scorecards analysis"
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to the code-scanning dashboard.
security-events: write
actions: read
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Over-permissive top-level permissions

permissions: read-all grants every possible read scope to every job, defeating least-privilege principles and overriding any stricter defaults you may want elsewhere.
Declare only the scopes really needed (or omit the top-level block entirely and keep the explicit job-level listing).

-permissions: read-all
+# Top-level permissions are optional; delete or scope down
+# permissions:
+#   contents: read
📝 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
permissions: read-all
jobs:
analysis:
name: "Scorecards analysis"
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to the code-scanning dashboard.
security-events: write
actions: read
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
# Top-level permissions are optional; delete or scope down
# permissions:
# contents: read
jobs:
analysis:
name: "Scorecards analysis"
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to the code-scanning dashboard.
security-events: write
actions: read
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
🤖 Prompt for AI Agents
In .github/workflows/scorecards-analysis.yml around lines 25 to 39, remove the
top-level 'permissions: read-all' declaration as it grants excessive read access
to all jobs. Instead, rely solely on the explicit job-level permissions already
defined under the 'analysis' job to enforce least privilege and avoid overriding
stricter defaults.

@@ -0,0 +1,77 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

这个写action 是根据官方内容添加的, publish 需要合并后在测试.

Comment thread pom.xml
<name>Apache Commons Beanutils Site</name>
<url>scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-beanutils</url>
</site>
<repository>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

@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/maven.yaml (1)

41-59: Indent the steps list correctly and remove trailing spaces

The list items under steps: are indented only 4 spaces instead of the required 6, and Line 41 contains stray spaces.
GitHub will refuse to load the workflow until this is corrected.

-        
-    steps:
-    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
-      with:
-        persist-credentials: false
-    - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
-      with:
-        path: ~/.m2/repository
-        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
-        restore-keys: |
-          ${{ runner.os }}-maven-
-    - name: Set up JDK ${{ matrix.java }}
-      uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
-      with:
-        distribution: 'temurin'
-        java-version: ${{ matrix.java }}
-    - name: Build with Maven
-      run: mvn --errors --show-version --batch-mode --no-transfer-progress verify -e
+      steps:
+        - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+          with:
+            persist-credentials: false
+
+        - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
+          with:
+            path: ~/.m2/repository
+            key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+            restore-keys: |
+              ${{ runner.os }}-maven-
+
+        - name: Set up JDK ${{ matrix.java }}
+          uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
+          with:
+            distribution: 'temurin'
+            java-version: ${{ matrix.java }}
+
+        - name: Build with Maven
+          run: mvn --errors --show-version --batch-mode --no-transfer-progress verify -e
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4a12dd9 and 4fc6ecf.

📒 Files selected for processing (3)
  • .github/workflows/maven.yaml (1 hunks)
  • pom.xml (2 hunks)
  • src/main/java/org/apache/commons/beanutils/SuppressPropertiesBeanIntrospector.java (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/main/java/org/apache/commons/beanutils/SuppressPropertiesBeanIntrospector.java
  • pom.xml
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/maven.yaml

19-19: could not parse as YAML: yaml: line 19: did not find expected ',' or ']'

(syntax-check)

🪛 YAMLlint (1.37.1)
.github/workflows/maven.yaml

[error] 41-41: trailing spaces

(trailing-spaces)


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

(indentation)


[error] 20-20: syntax error: expected ',' or ']', but got '{'

(syntax)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (java)
  • GitHub Check: build
  • GitHub Check: Analyze (java)

Comment on lines +18 to +23
on:
push:
branches: [ ${{ github.event.repository.default_branch }} ]
pull_request:
branches: [ ${{ github.event.repository.default_branch }} ]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix YAML parse error in the branches list

actionlint cannot parse the flow-style list that embeds a GitHub expression, causing the whole workflow to be rejected.
Switch to block-style so both YAML and GitHub Actions tooling accept it.

-  push:
-    branches: [ ${{ github.event.repository.default_branch }} ]
-  pull_request:
-    branches: [ ${{ github.event.repository.default_branch }} ]
+  push:
+    branches:
+      - ${{ github.event.repository.default_branch }}
+  pull_request:
+    branches:
+      - ${{ github.event.repository.default_branch }}
📝 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
on:
push:
branches: [ ${{ github.event.repository.default_branch }} ]
pull_request:
branches: [ ${{ github.event.repository.default_branch }} ]
on:
push:
branches:
- ${{ github.event.repository.default_branch }}
pull_request:
branches:
- ${{ github.event.repository.default_branch }}
🧰 Tools
🪛 actionlint (1.7.7)

19-19: could not parse as YAML: yaml: line 19: did not find expected ',' or ']'

(syntax-check)

🪛 YAMLlint (1.37.1)

[error] 20-20: syntax error: expected ',' or ']', but got '{'

(syntax)

🤖 Prompt for AI Agents
In .github/workflows/maven.yaml around lines 18 to 23, the branches list uses
flow-style with embedded GitHub expressions, causing YAML parse errors. Change
the branches list from flow-style (square brackets) to block-style (each branch
on its own line with a dash) to ensure proper parsing by actionlint and GitHub
Actions.

@kycheng kycheng merged commit 120afa5 into alauda-1.9 Aug 8, 2025
6 checks passed
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.

2 participants