Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KPM: refactor BaseArtifact to provide a uniform artifact_info #26

Open
sbrossie opened this issue Dec 22, 2015 · 2 comments
Open

KPM: refactor BaseArtifact to provide a uniform artifact_info #26

sbrossie opened this issue Dec 22, 2015 · 2 comments
Labels

Comments

@sbrossie
Copy link
Member

We currently construct the artifact_info with a a lot of useful fields such as:

  • dir_name
  • bundle_dir
  • file_path
  • repository_path

However the definition for those entries is not consistent across artifacts:

  • For ruby plugin:
    • dir_name = file_path = pluginDir/ruby
    • repository_path points to the tar.gz (e.g /org/kill-bill/billing/plugin/ruby/payment-test-plugin/1.8.7/payment-test-plugin-1.8.7.tar.gz)
    • bundle_dir = pluginDir/ruby/plugin_name/plugin_version (BUT ONLY AFTER it has been successfully installed).
  • For java plugin:
    • dir_name = pluginDir/java/plugin_name/plugin_version
    • repository_path points to the jar (e.g /org/kill-bill/billing/plugin/java/analytics-plugin/0.7.1/analytics-plugin-0.7.1.jar)
    • file_name = jar
    • file_path = dir_name/file_name
    • bundle_dir = dir_name (BUT ONLY AFTER it has been successfully installed).

Did not investigate the case for pure OSGI default bundles, kaui or killbill war, but that should also be consistent so we can extract clear definition from those fields.

@sbrossie sbrossie added the KPM label Dec 22, 2015
@sbrossie
Copy link
Member Author

We should also address other maintainability issues in the file:

  • For instance update_destination_path extract plugin_dir, version_dir = File.split(destination_path) but that is only true for java plugins
  • In populate_fs_info what is path_looks_like_a_directory and what do we try to do?

@sbrossie
Copy link
Member Author

Suggestion for improvement:

Since BaseArtifact is the base class, we could hide magic detail for how those fields are computed in the KillbillPluginArtifact, KillbillServerArtifact, ...

Might even be useful to distinguish between KillbillJavaPluginArtifact and KillbillRubyPluginArtifact since they are so different and then all the logic with 'tgz',... could be hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant