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

Add field for source license and condition for subscription #355

Merged
merged 2 commits into from
Jun 29, 2022

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Jun 15, 2022

What does this PR do?

  • Add a new source.license field, with the actual license of the package.
  • Add a new elastic.subscription condition, that allows to optionally declare a required subscription to install a package.
  • Deprecate the current license field.

Why is it important?

Current "license" field is referring to the subscription level, and there is no way to indicate the actual license of the package.

See #298 for more information.

Checklist

Related issues

@jsoriano jsoriano requested a review from a team as a code owner June 15, 2022 09:42
@jsoriano jsoriano self-assigned this Jun 15, 2022
@elasticmachine
Copy link

elasticmachine commented Jun 15, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-06-20T14:11:36.222+0000

  • Duration: 2 min 6 sec

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

jlind23
jlind23 previously approved these changes Jun 15, 2022
Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

A few comments to consider to keep license/subscription options together.

@@ -4,8 +4,11 @@ title: Good package
description: This package is good.
version: 1.0.0
type: integration
source:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need specifically a source property? Do you expect other properties included in the source?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not needed, but also we cannot use license as is the current problematic name.

We could have other metadata about the source, for example the url.

@@ -4,8 +4,11 @@ title: Good package
description: This package is good.
version: 1.0.0
type: integration
source:
license: "Apache-2.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Single license property violates this comment. How about creating licensing structure and keeping an array of licenses with path refs there?

Copy link
Member Author

@jsoriano jsoriano Jun 20, 2022

Choose a reason for hiding this comment

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

Umm, I consider this property implements this comment. This is a value, from an enum of allowed values. How does it violate the comment? (The enum would be the one here https://github.com/elastic/package-spec/pull/355/files#diff-fb1ef845cdf5e9bd952636bf029c091248cedcccee3645a86c909c2b21ea3acaR137)

Copy link
Member Author

Choose a reason for hiding this comment

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

How would the licensing structure be? Something like this?

licensing:
  license: 'Apache-2.0'
  subscription: 'basic'

Copy link
Contributor

Choose a reason for hiding this comment

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

In case we have multiple licenses per package we could use that structure:

licensing:
   licenses: [
      name: Apache-2.0,
      path: LICENSE.txt
   ]
   subscription: basic

Sometimes there is also NOTICE.txt file, which seems to be related to package license.

Copy link
Member Author

Choose a reason for hiding this comment

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

I would avoid having multiple licenses in the same package. What would be the use case of this? To have packages with Apache licensed code and Elastic licensed one? Is this something we want to support?
If we support this we also need some way to indicate what parts of the package are licensed with each license.

Regarding the links to text files, this comment talks against this, and I think I agree. We can have a limited list of supported licenses and elastic-package (or fleet in the UI) can be used to provide the full texts where needed.

conditions:
kibana.version: '^7.9.0'
elastic.subscription: 'basic'
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm... it's a tough one. It is a condition or requirement to have a basic subscription. On the other hand, conditions will become a bag with various properties, which isn't great too. Maybe it can be moved to the licensing structure I proposed above?

Copy link
Member Author

Choose a reason for hiding this comment

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

We need different fields for license and subscription.

The subscription is a requirement, this is why I thought that putting it as condition could make sense. I am ok with moving it to its own field though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Both options sound good, conditions may also contain regular expressions, for example, basic || special. Maybe we can ask other folks about their preferences. @joshdover

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer we keep it simple for now and not allow packages to define any special licensing structure. Kibana's existing licensing logic assumes a very basic, hierarchical structure where each tier includes all the features of the tier below it, expressed as a license.hasAtLeast('platinum') API. I don't think we should allow packages to do anything more sophisticated at this point, but leave the spec open to modification later.

I think if we start with an enum today, we should be able to expand it to more sophisticated things like regex in the future.

Shouldn't we go ahead and add the other enum values: basic, gold, platinum, enterprise?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was also thinking on the "at least" semantics.

Regarding basic || special, do we have any feature now that is included on different subscriptions? This would be for example to have something in gold and enterprise that is not included in platinum. This sounds confusing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Shouldn't we go ahead and add the other enum values: basic, gold, platinum, enterprise?

👍 added.

Copy link
Contributor

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

LGTM

I guess that you have to update other projects (elastic-package, package-registry, etc.).

@jsoriano jsoriano requested a review from a team June 23, 2022 08:59
Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

Model LGTM from Fleet side

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.

6 participants