Skip to content

Prevent docs gulp build from scanning target directories#21996

Open
gnodet wants to merge 1 commit intomainfrom
fix-docs-gulp-target-race
Open

Prevent docs gulp build from scanning target directories#21996
gnodet wants to merge 1 commit intomainfrom
fix-docs-gulp-target-race

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Mar 13, 2026

Summary

  • Exclude **/target/** from gulp.src() glob scanning in createSymlinks and createExampleSymlinks functions
  • The others.asciidoc source pattern uses ../dsl/**/src/main/docs/*.adoc which causes recursive scanning of all directories under dsl/, including target/ directories

Rationale

This is a preventive change, not a fix for a specific observed failure. The ** glob pattern in the others source configuration causes the glob library to recursively scan all directories under ../dsl/, including Maven target/ directories. These directories:

  1. Never contain documentation source files, so scanning them is wasted work
  2. Can contain ephemeral temp directories (e.g. templates-tmp*) created by Maven plugins during parallel builds, which could cause ENOENT race conditions if a directory appears in a listing but is deleted before scandir reads it

Excluding **/target/** is a safe, no-functional-change improvement that avoids unnecessary I/O and eliminates a potential source of flakiness during parallel CI builds.

…canning

The gulp `symlink:asciidoc:others` task uses a `**` glob pattern to scan
DSL module directories. During parallel CI builds, temp directories under
`target/` (e.g. `templates-tmp87842628`) can appear and disappear while
the glob is scanning, causing ENOENT race conditions.

Exclude `**/target/**` from `gulp.src()` calls in both `createSymlinks`
and `createExampleSymlinks` functions, since build output directories
should never contain documentation source files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions bot added the docs label Mar 13, 2026
@gnodet gnodet changed the title Fix flaky docs gulp build by excluding target directories Prevent docs gulp build from scanning target directories Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant