celix icon indicating copy to clipboard operation
celix copied to clipboard

Feature/685 refactor manifest format

Open pnoltes opened this issue 1 year ago • 2 comments

Refactor Manifest Format to JSON

This PR refactors the MANIFEST format to JSON. Consequently, the custom manifest parsing is removed, and the properties JSON format is now used.

Additional Changes

This PR has grown considerably larger than initially intended due to the following additional changes:

  • Deprecation Clean-Up: Some of the framework deprecated APIs have been moved to the framework src directory, and deprecated code that was no longer used has been removed. This cleanup primarily focused on bundle and module api.
  • Source File Updates: Many source files were updated, mostly to adjust include statements. In some cases, usage of deprecated bundle api has been replaced.

Manifest Attribute Definitions

  • Private Defines: Mandatory and recognized optional manifest attribute names are no longer defined in celix_constants.h. Instead, they are private defines within the bundle manifest source file.
  • New Functions: Functions were added to explicitly retrieve the values of mandatory or recognized optional manifest attributes.
  • Manifest Attribute Names: The used manifest attribute names has changed to be more aligned with the naming scheme of config properties.

CMake Function Names

The CMake function celix_bundle_headers remains unchanged, ensuring no breaking changes. i.e.:

celix_bundle_headers(my_bundle "Attribute1: Value1" "Attribute2: Value2")

still works.

This is the same approach was done for the container config properties (e.g., celix_container_runtime_properties and celix_container_embedded_properties are backwards compatible). However, because celix_bundle_headers is not as heavily used, it might be beneficial to introduce a new CMake function that accepts separated arguments for attribute names and values, such as:

celix_bundle_manifest(my_bundle "Attribute1" "Value1")

Bundle Packaging

  • Currently, a bundle zip can be created with jar if the jar executable is available. This was beneficial for ensuring the MANIFEST.MF file was the first file in the zip.
  • With the JSON format, this benefit is no longer relevant.
  • We can keep the support for using jar to package a bundle, but we could also drop jar support.

Future Work

After this PR is merged, my plan is to continue with #509 by:

  1. Moving all deprecated API headers (except those used in remote services) to the framework src directory.
  2. Renaming, refactoring, or removing the deprecated functions.

In a subsequent pull request, the remote services implementation will be refactored to remove the usage of the remaining deprecated APIs.

pnoltes avatar Jul 27 '24 10:07 pnoltes

Codecov Report

Attention: Patch coverage is 96.71533% with 9 lines in your changes missing coverage. Please review.

Project coverage is 90.67%. Comparing base (bba867a) to head (c29d9e6). Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
libs/framework/src/module.c 89.55% 7 Missing :warning:
libs/framework/src/dm_dependency_manager_impl.c 66.66% 1 Missing :warning:
libs/framework/src/framework.c 95.23% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #765      +/-   ##
==========================================
+ Coverage   90.27%   90.67%   +0.40%     
==========================================
  Files         226      226              
  Lines       26323    26604     +281     
==========================================
+ Hits        23762    24124     +362     
+ Misses       2561     2480      -81     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jul 27 '24 10:07 codecov-commenter

I’ve been busy with other commitments, but I plan to pick this up again in the coming weeks. Thanks for the patience!

pnoltes avatar Oct 06 '24 17:10 pnoltes

I updated the PR and processed al comments, except the remark that the revision can be removed. That last one I would like to do in separate PR.

pnoltes avatar Nov 10 '24 18:11 pnoltes