fix(buck): stop defaulting METADATA.bzl package types#754
Merged
Conversation
Keep Buck METADATA.bzl files identified by datasource ownership instead of inventing a fallback package type when the file does not declare one. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Allow Buck METADATA.bzl entries with names but no package type to assemble into top-level packages so scans still emit package records after the parser fallback is removed. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Generate internal package UIDs for assembled packages that still lack a PURL so Buck metadata packages keep stable linkage without reintroducing a fake package type. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Keep parser-supplied PURLs as the canonical package identity when present so qualifiers such as Alpine arch survive assembly and file-reference matching. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai> Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
METADATA.bzlpackages totype: buckwhen the file does not declare an ecosystem or package URLbuck_metadataas the source identity, preserve explicitecosystem/type/package_typeandpackage_urloverrides, and still assemble a top-level packagepackage_uidvalues for assembled typeless packages sofor_packageslinkage stays populated without inventing a fake PURL typeScope and exclusions
PackageTypetaxonomy cleanup outside Buck metadataIntentional differences from Python
METADATA.bzlastype: buckby default. This branch intentionally leavestypeunset unless the metadata declares a real ecosystem orpackage_url, while preservingbuck_metadataas the datasource identity.package_uidso top-level package linkage still works.Expected-output fixture changes
testdata/buck/metadata/METADATA.bzl.expected.json"type": "buck"because the parser now distinguishes Buck file ownership from declared package ecosystem, while still preservingdatasource_id: "buck_metadata"and producing an assembled package with a non-empty internal UID at scan time.