Skip to content

Conversation

@ongdisheng
Copy link
Contributor

@ongdisheng ongdisheng commented Nov 22, 2025

Related: #703

Purpose of the pull request

This PR optimizes CI workflows to skip unnecessary Java tests when only documentation files are changed.

What's changed?

This PR added paths filtering to ci.yml and codeql-scan.yml so they only run when Java code or Maven configs change.

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

@ongdisheng ongdisheng marked this pull request as ready for review November 22, 2025 15:26
@delei delei requested a review from alaahong November 22, 2025 16:58
@GOODBOY008
Copy link
Member

Hi @ongdisheng, I think using an ignore-based approach would be cleaner than the include logic.
Feel free to adopt the implementation from my PR: #711.

@ongdisheng
Copy link
Contributor Author

Hi @GOODBOY008, thank you for working on this optimization! I do agree that the paths-ignore approach is simpler and easier to maintain for future changes. However, I noticed it would still trigger CI for several configuration files in our current repository

  1. Configuration files: .asf.yaml, .gitignore, licenserc.toml, lombok.config, logo.svg
  2. GitHub files: .github/dependabot.yml, .github/ISSUE_TEMPLATE/*.yml
  3. Other workflow files: .github/workflows/deploy-docs.yml, markdownlint.yml, etc.
  4. Tools: tools/spotless/license-header.txt, mvnw, mvnw.cmd

That's about 20+ files that would still run Java CI builds unnecessarily while the include approach ensures CI only runs for actual code and build changes. I think both approaches have their own trade-offs. Feel free to let me know what do you think?

@GOODBOY008
Copy link
Member

GOODBOY008 commented Nov 24, 2025

@ongdisheng The scenarios you listed will still run the CI pipeline and it's very necessary with my implement.Just like action file, if add new one you need to trigger as your implement you will modify the action conditions? It's too complexity.

@GOODBOY008
Copy link
Member

@ongdisheng For example, if someone accidentally modifies the mvnw file incorrectly, the CI won’t run and the change could be merged into main, causing CI failures later. Because the PR CI is skipped, this kind of issue cannot be detected in time.

Comment on lines +26 to +30
- '.github/workflows/codeql-scan.yml'
- '**/pom.xml'
- 'fesod/**'
- 'fesod-*/**'
- '!**.md'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- '.github/workflows/codeql-scan.yml'
- '**/pom.xml'
- 'fesod/**'
- 'fesod-*/**'
- '!**.md'
- "**.java"

Only java file to trigger ci.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @GOODBOY008, Thanks for the suggestion! Just wondering, would "**.java" actually cover everything we need here? From what I can see, it would only match Java source files, but we also have test resources like Excel and CSV files in src/test/resources/ that our tests depend on. If someone updates those test files, we probably want CI to run and make sure the tests still pass. Also, "**.java" wouldn't catch changes to pom.xml or the CI workflow itself and it would possibly still have the same mvnw issue you pointed out earlier. Just wondering if we just add mvnw on top of the existing list to cover the Maven wrapper case, would this actually be better?

Copy link
Member

Choose a reason for hiding this comment

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

Thank you all for your discussion.

IMO, I think this setting should simplify the scene rather than make it more complicated. If in a PR only the resources file or the mvnw file is modified separately, this PR may be directly rejected during the review process.

Comment on lines +34 to +38
- '.github/workflows/codeql-scan.yml'
- '**/pom.xml'
- 'fesod/**'
- 'fesod-*/**'
- '!**.md'
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

@delei
Copy link
Member

delei commented Nov 25, 2025

I recommend seeking consensus. Both PRs share the same underlying premise, though they approach it differently. We welcome both proposals.

At present, I believe the paths-ignore proposal is the more suitable option.

@ongdisheng
Copy link
Contributor Author

Hi @delei, Thank you for the feedback. I understand you prefer the paths-ignore approach from #711. I'm happy to close my PR as what matters most is improving the CI efficiency for the project, regardless of whose implementation we use.
@GOODBOY008, thank you for your work on this as well.

@ongdisheng ongdisheng closed this Nov 25, 2025
@ongdisheng ongdisheng deleted the feat/optimize-ci-workflow-paths branch November 27, 2025 22:26
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.

3 participants