Skip to content

Make transform work - #383

Closed
pombredanne wants to merge 69 commits into
developfrom
361-make-transform-work
Closed

Make transform work#383
pombredanne wants to merge 69 commits into
developfrom
361-make-transform-work

Conversation

@pombredanne

@pombredanne pombredanne commented Dec 10, 2018

Copy link
Copy Markdown
Member

This makes the "transform" CSV to CSV command work for #361 but also replaces entirely the internal custom field validation by the attr library and works on other tickets:

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
- use simpler attr for data models definition: this is simpler and
  cleaner.
- update all commands and tests accordingly
- introduce a proper License objects to hold the "licenses" details
- create new fetch-licenses subcommand to retrieve License objects
  through API calls.
- store reference and API-fetched License as a pair of xxx.yml data file
  and xxx.LICENSE text file
- move all inventory-related ode to inv.py
- update built-in templates to use the new About and License objects

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This is in the inv/check commande

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This guarantees that the same attribution will be generated on
all OSes

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This was not enabled and therefore HTML was not esacped correctly.
Also streamline the default template whitespaces.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This ensure that we will use the /licenses/ end point even if not
provided explicitly.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Python, EPL and AGPL are common enough

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This is: about_resource, name, version
Also remove duplicated field definition code

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Instead use the about_resource<.ABOUT>
Use about_file_path if an only if provided.
Alos remove --quiet option rom

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Instead use the about_resource<.ABOUT>
Use about_file_path if an only if provided.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
 * Add a new "reformat" command to reformat an existing tree of ABOUT
   files to use the new cleaner YAML format and the new standard fields
   ordering. This helps compare ABOUT file generated with 3.3.0 with
   v4.x ABOUT files for verification purpose. This can also help
   normalize existing ABOUT files in general

 * Add a new "--legacy-placement" option to the gen command. With this
   option, the placement of ABOUT files is inside a documented directory
   as opposed to be side-by-side, which is the way in 3.3.0. This helps
   to compare generated trees of ABOUT files between 3.3.0 and 4.x for
   verification

 * Improve handling of paths (about resource vs. about file path)
   in gen.py

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This makes it easier to write templates

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Also rename legacy vartext to vartext_dict to backward compat

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne

Copy link
Copy Markdown
Member Author

At this stage, the features are all tested and working and at least at parity with the v3.3.0. This is ready for merging

The new --unique-fields option is a list of field names separated by
commas. When provided the ABOUT entries provided to a custom
attribution template is dedulicated using the values of these fields
considered together a unique key. When several ABOUT entries have the
same unique key, only the first one is kept.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
 * Also use enterprise.dejacode.com to check connectivity
 * Use .format for string templates

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
 * Add two new template filters to sort and control unicity of list
   items using the values of multiple attributes. The standard sort
   and unique Jinja2 filters only support a single attribute value.
   The new multi_sort and unique_together filters take an "attributes"
   list of attribute names as an argument and use the values of all
   these attributes to sort or deduplicate a list or iterable.
 * Remove --unique-fields command line option from attrib command

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This helps with a backport to the v3 branch

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This helps with a backport to the v3 branch

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@chinyeungli

Copy link
Copy Markdown
Contributor

I am closing this as we already have the transform function working.

@pombredanne
pombredanne deleted the 361-make-transform-work branch May 10, 2022 13:32
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.

2 participants