Skip to content

Conversation

cmillar-trunk
Copy link
Collaborator

Switches over to using the path in the meta_json to find the internal bin file. This does end up loading the whole tarball into memory in order to check for files.

Switches over to using the path in the meta_json to find the internal
bin file. This does end up loading the whole tarball into memory in
order to check for files.
Copy link

trunk-io bot commented Sep 30, 2025

😎 Merged successfully - details.

@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.43%. Comparing base (728e925) to head (06beccf).

Files with missing lines Patch % Lines
bundle/src/bundler.rs 86.00% 14 Missing ⚠️
bundle/src/bundle_meta.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #782      +/-   ##
==========================================
+ Coverage   72.88%   73.43%   +0.54%     
==========================================
  Files          72       72              
  Lines       17369    17415      +46     
==========================================
+ Hits        12660    12788     +128     
+ Misses       4709     4627      -82     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 223 to 233
while let Some(entry) = entries.next().await {
let mut unwrapped_entry = entry?;
let path_str = unwrapped_entry
.path()?
.to_str()
.unwrap_or_default()
.to_owned();
let mut bytes = Vec::new();
unwrapped_entry.read_to_end(&mut bytes).await?;
file_entries.insert(path_str, bytes);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we reading through every file? We know that we care about meta.json and we also know that the internal.bin will have internal in its name (whether that be the directory or the filename. Can we pre-filter based on that so we don't read everything? I'm concerned about some of our customers with large uploads.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was encountering issues passing around the entries, but this actually does cause issues for the context-py tests, so I'm going to need to switch away from it.

Copy link

trunk-staging-io bot commented Sep 30, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Copy link

trunk-io bot commented Oct 1, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

if path_str == target_name {
let mut bytes = Vec::new();
unwrapped_entry.read_to_end(&mut bytes).await?;
println!("bytes read {:?} from {:?}", bytes, path_str);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
println!("bytes read {:?} from {:?}", bytes, path_str);

Copy link
Collaborator

@gnalh gnalh left a comment

Choose a reason for hiding this comment

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

LGTM, need to update the trunk and trunk2 repos next.

) -> anyhow::Result<(TestReport, VersionedBundle)> {
let extracted_files =
extract_files_from_tarball(input, &[META_FILENAME, INTERNAL_BIN_FILENAME]).await?;
println!("a");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
println!("a");

return value


def create_stream_from_meta(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the same test but just moved down?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, git's diff is misinterpreting what I did: the body of the baseMeta function was just a part of the body of test_parse_meta_from_tarball, but when I moved it up, git-diff decided it was a smaller diff to claim these functions had moved down, rather than to claim that the body of baseMeta had moved up.

@trunk-io trunk-io bot merged commit fb77c53 into main Oct 1, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants