Skip to content

BUILD-8083 Fix javadoc publication when multiple javadocs are available#330

Merged
SamirM-BE merged 1 commit intomasterfrom
fix/smarini/BUILD-8083-fixJavaDoc
Jul 28, 2025
Merged

BUILD-8083 Fix javadoc publication when multiple javadocs are available#330
SamirM-BE merged 1 commit intomasterfrom
fix/smarini/BUILD-8083-fixJavaDoc

Conversation

@SamirM-BE
Copy link
Copy Markdown
Contributor

@SamirM-BE SamirM-BE commented Jul 25, 2025

Problem

The javadoc publication workflow failed for repositories like sonar-plugin-api that generate multiple javadoc artifacts:

  • sonar-plugin-api-13.0.0.3026-javadoc.jar (main API docs)
  • sonar-plugin-api-test-fixtures-13.0.0.3026-javadoc.jar (test utilities)

The existing logic mv *javadoc.jar javadoc.zip failed with "No such file or directory" when multiple files matched the pattern.

Solution

Enhanced the javadoc extraction step with intelligent file selection:

  • Single javadoc file: Uses original simple logic (preserves backward compatibility)
  • Multiple javadoc files: Automatically filters out test/fixture variants and selects main javadoc
  • No clear main javadoc: Fails with clear error message directing users to Engineering Experience team

Tested scenarios: 7/7 unit tests pass, covering single javadoc, multiple with test/fixture variants, edge cases, and error conditions. As there are no unit tests in the repo, I kept them locally

@SamirM-BE SamirM-BE requested a review from a team as a code owner July 25, 2025 14:00
@SamirM-BE SamirM-BE force-pushed the fix/smarini/BUILD-8083-fixJavaDoc branch 2 times, most recently from fdeaa51 to 64db46e Compare July 25, 2025 17:30
@SamirM-BE SamirM-BE force-pushed the fix/smarini/BUILD-8083-fixJavaDoc branch from 64db46e to d60d009 Compare July 25, 2025 17:31
@sonarqubecloud
Copy link
Copy Markdown

🤖 Pull Request summary

Refactors javadoc extraction in CI workflow to use dedicated script with testing.

• Adds checkout step to javadoc-publication workflow
• Replaces inline javadoc extraction commands with external script extract-javadoc.sh
• Removes manual directory creation and zip extraction steps
• Adds new CI workflow to test javadoc extraction logic using shellspec
• Includes comprehensive test suite for single and multiple javadoc file scenarios

💬 Please send your feedback

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@SamirM-BE SamirM-BE merged commit e9182a5 into master Jul 28, 2025
15 of 16 checks passed
@SamirM-BE SamirM-BE deleted the fix/smarini/BUILD-8083-fixJavaDoc branch July 28, 2025 12:03
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