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

feat(license): add struct with types for licenses #5211

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

DmitriyLewen
Copy link
Contributor

@DmitriyLewen DmitriyLewen commented Sep 19, 2023

Description

Add new License struct to exclude prefixes for licenses.

TODO:

Related issues

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@DmitriyLewen DmitriyLewen self-assigned this Sep 19, 2023
@lior-orca
Copy link

@DmitriyLewen is this PR stale or do you intend to continue with it in the near future?

@DmitriyLewen
Copy link
Contributor Author

Hello @lior-orca
This PR is ready, but aquasecurity/go-dep-parser#256 needs to be merged first.

Copy link

This PR is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Dec 25, 2023
@DmitriyLewen DmitriyLewen removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Dec 25, 2023
@dus7eh
Copy link
Contributor

dus7eh commented Feb 7, 2024

Please check my comments in #5204

Comment on lines +105 to +126
// MarshalJSON customizes the JSON encoding of Licenses.
func (ll *Licenses) MarshalJSON() ([]byte, error) {
return json.Marshal(ll.ToStringSlice())
}

// UnmarshalJSON customizes the JSON decoding of License.
func (ll *Licenses) UnmarshalJSON(data []byte) error {
var stringLicenses []string
if err := json.Unmarshal(data, &stringLicenses); err != nil {
return err
}
licenses := Licenses{}
for _, l := range stringLicenses {
licenses = append(licenses, License{
Type: LicenseTypeName,
Value: l,
})
}

*ll = licenses
return nil
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like we don't need to save license types for convert mode.

@DmitriyLewen DmitriyLewen changed the title fix(python): don't split licenses with non-separable prefix feat(license): add struct with types for licenses Feb 14, 2024
@Rafcu90
Copy link

Rafcu90 commented Feb 20, 2024

Hello @DmitriyLewen I would like to ask is there any estimation when this can be delivered ? My team is strongly interested in ignoring python packages by their paths as it was discussed under: #6117. Thank you in advance, Regards Rafał :)

@DmitriyLewen
Copy link
Contributor Author

Hello @Rafcu90
Unfortunately, I can't give a time frame.

This PR changes base structure (I mean Package). The necessary time to review and test these changes.
We've also combined go-dep-parser with Trivy. I need time to move aquasecurity/go-dep-parser#256 to this PR.

Copy link

This PR is stale because it has been labeled with inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Apr 21, 2024
@DmitriyLewen DmitriyLewen removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and will be auto-closed. label Apr 22, 2024
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.

don't split licenses from License field from python packaging
4 participants