Skip to content

Conversation

@vasily-pozdnyakov
Copy link
Contributor

@vasily-pozdnyakov vasily-pozdnyakov commented Mar 20, 2025

Fixes #4206

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

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

Thanks a lot for detecting this and providing the fix @vasily-pozdnyakov we seem to have missed this when we moved to a different package assembly process and model here.

We were only testing the package data parsing here, but not the package assembly here (which is where assign_package_to_resources is called) hence the miss.
Do you mind also adding a test similarly like

def test_end2end_scan_can_detect_bazel(self):
like the following:

def test_end2end_scan_can_detect_bazel(self): test_file = self.get_test_loc('metadatabzl/new-format/METADATA.bzl') expected_file = self.get_test_loc('metadatabzl/new-format/metadatabzl-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json-pp', result_file]) check_json_scan(expected_file, result_file, regen=REGEN_TEST_FIXTURES) 

You also have to create the test file at tests/packagedcode/data/build/metadatabzl/new-format/metadatabzl-expected.json and regen this newly added test to populate this.

Signed-off-by: Vasily Pozdnyakov <vasily.pozdnyakov@tngtech.com>
Signed-off-by: Vasily Pozdnyakov <vasily.pozdnyakov@tngtech.com>
@vasily-pozdnyakov vasily-pozdnyakov force-pushed the fix_metadata_scan_error branch from 30b3167 to bddc5a1 Compare May 9, 2025 16:03
@vasily-pozdnyakov
Copy link
Contributor Author

@AyanSinhaMahapatra
I added a test, as you proposed. Unfortunately I get an error locally, the problem is probably here:
https://github.com/aboutcode-org/scancode-toolkit/blob/4b57a7fe86e60e14694445a63f379b22ecbd7135/src/packagedcode/build.py#L270C6-L270C7

@mstykow
Copy link

mstykow commented Jun 27, 2025

@AyanSinhaMahapatra how can we move this forward?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants