Skip to content

Generate metadata in distributed rule - #79

Open
furtib wants to merge 7 commits into
Ericsson:mainfrom
furtib:metadata
Open

Generate metadata in distributed rule#79
furtib wants to merge 7 commits into
Ericsson:mainfrom
furtib:metadata

Conversation

@furtib

@furtib furtib commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Why:
We currently do not produce a metadata.json with our distributed rule.

What:
Added metadata output for all steps.

Addresses:
#45

@furtib
furtib requested a review from Szelethus September 12, 2025 12:54
@furtib furtib self-assigned this Sep 12, 2025
@furtib furtib added the enhancement New feature or request label Sep 12, 2025
@Szelethus
Szelethus requested review from dkrupp and nettle September 15, 2025 13:29
Comment thread src/metadata_merge.py Outdated
Comment thread src/metadata_merge.py Outdated
Comment thread src/metadata_merge.py Outdated
Comment thread src/metadata_merge.py Outdated
Comment thread src/metadata_merge.py Outdated
@furtib
furtib force-pushed the metadata branch 2 times, most recently from ddf9607 to 4a7a2be Compare October 7, 2025 09:00

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We need some tests to show the observable behaviour change this patch introduces, or patches this is a part of.

Comment thread src/BUILD Outdated

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have some thoughts. First, we add two new features:

  • Enable metadata generation
  • Add metadata merging

Can we somehow split this PR along that line? Also, with regards to testing, it would be great to have a test where we have two pre-existing metadata files which we merge using the new utility, and thats it.

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alright, looking good! Do you mean to land #254 before this? Can you rebase on it then?

Comment thread src/per_file_script.py Outdated
@furtib
furtib force-pushed the metadata branch 2 times, most recently from 89acada to 8ffb40b Compare July 5, 2026 13:41

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The test looks great, thanks! Sorry for the comments in this round, could've made it earlier.

Comment thread src/per_file_script.py
Comment thread src/per_file_script.py Outdated
if os.path.isfile(os.path.join(DATA_DIR, "metadata.json")):
shutil.move(os.path.join(DATA_DIR, "metadata.json"), METADATA_FILE)
elif plist_exists:
# We do not create the "empty" metadata file, to make bazel fail

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

to make it fail? What does that mean?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, if we are "making it fail", the warning below is actually an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I rephrased the comment

@furtib
furtib requested a review from Szelethus August 4, 2026 09:49

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM! Sorry for being so picky with this one, but I think the PR looks amazing now.

Comment thread src/per_file_script.py
Comment on lines +204 to +210
elif plist_exists:
# We do not create the "empty" metadata file
# this will cause bazel to crash due to a missing output file.
print(
"[WARNING] metadata.json doesn't exists "
"despite successful analysis..."
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry, final comment. Isn't this a should-never-happen case? If so, isn't this severe enough to warrant throwing an exception?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this better?

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants