Skip to content

feat: prepare "contrib" area#569

Merged
jkowalleck merged 17 commits intomasterfrom
feaf/prep-contrib
Dec 2, 2025
Merged

feat: prepare "contrib" area#569
jkowalleck merged 17 commits intomasterfrom
feaf/prep-contrib

Conversation

@jkowalleck
Copy link
Member

@jkowalleck jkowalleck commented Nov 26, 2025

Added

  • new Entry point CycloneDX\Contrib

Changed

  • Moved non‑standard implementations to Contrib area

Deprecated

  • Certain exports have been deprecated; downstream imports should be updated to the new locations
    Note: the symbols themselves remain supported. See documentation and the "Refactored" section below for details.

Refactored

  • The following symbols were moved.
    The symbols are still import-able through their old location.
    • OLD -> NEW
    • CycloneDX\Core\Factories\LicenseFactory -> CycloneDX\Contrib\License\Factories\LicenseFactory
    • CycloneDX\Core\Utils\BomUtility -> CycloneDX\Contrib\Bom\Utils\BomUtils

⚠️ tests for contribs were not moved yet, to show that all functionality still works.
the tests will be moved in a later step

@jkowalleck jkowalleck requested a review from a team as a code owner November 26, 2025 09:18
@jkowalleck jkowalleck added the enhancement New feature or request label Nov 26, 2025
@codacy-production
Copy link

codacy-production bot commented Nov 26, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% 100.00% (target: 80.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (64e2cb6) 5532 5510 99.60%
Head commit (519516e) 5532 (+0) 5510 (+0) 99.60% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#569) 33 33 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@jkowalleck jkowalleck force-pushed the feaf/prep-contrib branch 5 times, most recently from fad6a8d to b13a2ce Compare November 26, 2025 11:00
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck merged commit 1e70fce into master Dec 2, 2025
54 checks passed
@jkowalleck jkowalleck requested a review from Copilot December 2, 2025 10:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR establishes a new "Contrib" area for non-standard implementations, moving utilities and factories that aren't part of the core CycloneDX specification. The refactoring maintains full backward compatibility through class inheritance-based aliases while directing users to the new locations via deprecation notices.

Key Changes

  • Created CycloneDX\Contrib namespace with separate autoloading configuration for community-contributed functionality
  • Migrated LicenseFactory and BomUtility classes to the Contrib area with new class names (BomUtils)
  • Established deprecation pattern using class inheritance to maintain backward compatibility while directing users to new locations

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
composer.json Added PSR-4 autoload mapping for the new CycloneDX\Contrib\ namespace
src/Contrib/README.md Documented the purpose and guidelines for the Contrib area
src/Contrib/License/Factories/LicenseFactory.php New location for LicenseFactory implementation
src/Contrib/Bom/Utils/BomUtils.php New location for BomUtility implementation with renamed class
src/Core/Factories/LicenseFactory.php Converted to deprecated alias extending the new Contrib class
src/Core/Utils/BomUtility.php Converted to deprecated alias extending the new Contrib class
tests/Core/Factories/LicenseFactoryTest.php Added CoversClass attribute for new Contrib class location
tests/Core/Utils/BomUtilityTest.php Added CoversClass attribute for new Contrib class location
examples/build_and_serialize.php Updated to use new LicenseFactory namespace
HISTORY.md Documented the changes including added, changed, deprecated, and refactored items
tests/Contrib/.gitkeep Placeholder for future Contrib test directory

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

/**
* @throws DomainException when the SPDX license expressions was invalid
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Grammar error in the documentation comment. The phrase "expressions was" should be "expression is" - the word "expression" should be singular to match the parameter name, and the verb should be present tense to match the PHPDoc convention.

Suggested change
* @throws DomainException when the SPDX license expressions was invalid
* @throws DomainException when the SPDX license expression is invalid

Copilot uses AI. Check for mistakes.
/**
* Deprecated — Alias of {@see \CycloneDX\Contrib\License\Factories\LicenseFactory}.
*
* @deprecated use {@see \CycloneDX\Contrib\License\Factories\LicenseFactory} instead
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Inconsistent capitalization in @deprecated tag. The word "use" should be capitalized as "Use" to match the capitalization used in the BomUtility.php deprecation notice (line 31) and follow standard sentence capitalization conventions.

Suggested change
* @deprecated use {@see \CycloneDX\Contrib\License\Factories\LicenseFactory} instead
* @deprecated Use {@see \CycloneDX\Contrib\License\Factories\LicenseFactory} instead

Copilot uses AI. Check for mistakes.
@jkowalleck jkowalleck deleted the feaf/prep-contrib branch December 2, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants