Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix errors when scanning METADATA.bzl #4207

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

Open
vasily-pozdnyakov wants to merge 2 commits into aboutcode-org:develop
base: develop
Choose a base branch
Loading
from vasily-pozdnyakov:fix_metadata_scan_error

Conversation

@vasily-pozdnyakov
Copy link
Contributor

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

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
edited
Loading

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.

vasily-pozdnyakov reacted with thumbs up emoji
Signed-off-by: Vasily Pozdnyakov <vasily.pozdnyakov@tngtech.com>
Signed-off-by: Vasily Pozdnyakov <vasily.pozdnyakov@tngtech.com>
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

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

Reviewers

@AyanSinhaMahapatra AyanSinhaMahapatra AyanSinhaMahapatra requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Errors when scanning METADATA.bzl

AltStyle によって変換されたページ (->オリジナル) /