Conversation
| sigs.k8s.io/yaml v1.3.0 // indirect | ||
| ) | ||
|
|
||
| replace github.com/elastic/package-spec => github.com/elastic/package-spec v1.12.2-0.20220629092545-9ee240e557a5 |
There was a problem hiding this comment.
To be removed before merging, once elastic/package-spec#355 is included in the used package-spec.
mtojek
left a comment
There was a problem hiding this comment.
I think that you may want to take a look also at the create command and add an option to select licenses there.
| License string `config:"license" json:"license" yaml:"license"` | ||
| Categories []string `config:"categories" json:"categories" yaml:"categories"` | ||
| Source struct { | ||
| License string `config:"license" json:"license" yaml:"license"` |
There was a problem hiding this comment.
Do you plan to deprecate the license field in this PR?
There was a problem hiding this comment.
It is deprecated in the package-spec.
I think we are not doing anything with deprecations in elastic-package, do you have a proposal for something that we could do here?
There was a problem hiding this comment.
I would drop a comment in the source in this place as both fields are modeled. Frankly speaking, it's another argument for switching to a common place with business/model structures.
There was a problem hiding this comment.
Frankly speaking, it's another argument for switching to a common place with business/model structures.
Yep, another +1 for something like elastic/package-spec#322.
| } | ||
| if license := m.Source.License; license != "" { | ||
| logger.Debugf("Write license text for %q", license) | ||
| err := licenses.WriteTextToFile(license, filepath.Join(destinationDir, "LICENSE.txt")) |
There was a problem hiding this comment.
Is there an option to use your own license? Will it break the building logic here?
There was a problem hiding this comment.
Not at the moment, do we want to support it?
If we want, we could relax the check of unknown licenses, and include whatever the developer places in the source.license field and the LICENSE.txt file.
There was a problem hiding this comment.
(it will break the current logic because it assumes that source.license if set, is set to one of the values enumerated in the spec)
There was a problem hiding this comment.
Passing this to @akshay-saraswat. From developer's point of view, we may end up with an edge case, when a developer/team/customer needs to slightly modify the LICENSE text. For example, add an extra paragraph.
internal/builder/packages.go
Outdated
| if options.buildDir == "" { | ||
| destinationDir, err = BuildPackagesDirectory(options.PackageRoot) | ||
| if err != nil { | ||
| return "", errors.Wrap(err, "can't locate build directory") | ||
| } | ||
| } else { | ||
| destinationDir, err = buildPackagesDirectory(options.buildDir, options.PackageRoot) | ||
| if err != nil { | ||
| return "", errors.Wrap(err, "can't locate build directory") | ||
| } |
There was a problem hiding this comment.
Why exactly do you need this if-else block? It looks like it complicated the current logic.
There was a problem hiding this comment.
I added options.buildDir to have a predictable place where packages are built for testing.
I can move this logic to the new internal method. I didn't modify the behaviour or interface of BuildPackagesDirectory because it is a exposed method, though it is in an internal package.
There was a problem hiding this comment.
Moved logic to the current BuildPackagesDirectory and changed the other use we have of this.
🌐 Coverage report
|
| same "printed page" as the copyright notice for easier | ||
| identification within third-party archives. | ||
|
|
||
| Copyright [yyyy] [name of copyright owner] |
There was a problem hiding this comment.
Should we render this data or remove the entry?
There was a problem hiding this comment.
This comment elastic/package-spec#367 (comment) applies here.
mtojek
left a comment
There was a problem hiding this comment.
Recent changes look good to me, but will hold my "approval" until we clarify this point.
|
@mtojek I am thinking on closing this, and leaving developers the responsibility of properly licensing their code. Reasons:
The plan would still be:
|
|
SGTM, maybe you can focus on the spec profiles and forbid using deprecated properties, or enable |
Include a new
LICENSE.txtfile when building packages that include thesource.licensefield in their manifests.Follow up of elastic/package-spec#355.
Part of elastic/package-spec#298.