Skip to content

Write test collection bundle metadata into uploads#1089

Open
dfrankland wants to merge 9 commits into
mainfrom
codex/test-collection-upload-contract
Open

Write test collection bundle metadata into uploads#1089
dfrankland wants to merge 9 commits into
mainfrom
codex/test-collection-upload-contract

Conversation

@dfrankland
Copy link
Copy Markdown
Member

Summary

  • send testCollectionShortId during upload init and accept prefixed canonical test-collection bundle metadata fields in the response
  • write test_collection_bundle_meta_id and test_collection_bundle_meta_created_at into bundle metadata only for test-collection uploads
  • update upload and mock-server tests for the new request and bundle fields

Testing

  • cargo test -p trunk-analytics-cli upload_bundle -- --nocapture

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 11, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.04%. Comparing base (e2604f0) to head (db75bb4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1089      +/-   ##
==========================================
+ Coverage   81.75%   82.04%   +0.28%     
==========================================
  Files          69       69              
  Lines       14917    14939      +22     
==========================================
+ Hits        12195    12256      +61     
+ Misses       2722     2683      -39     

☔ 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.

@trunk-staging-io
Copy link
Copy Markdown

trunk-staging-io Bot commented May 11, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented May 11, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Comment thread api/src/message.rs Outdated
Comment on lines +27 to +30
#[serde(rename = "testCollectionBundleMetaId")]
pub test_collection_bundle_meta_id: Option<String>,
#[serde(rename = "testCollectionBundleMetaCreatedAt")]
pub test_collection_bundle_meta_created_at: Option<String>,
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.

👍

Comment thread api/src/message.rs
Comment on lines +6 to +13
#[serde(rename_all = "camelCase")]
pub struct CreateBundleUploadRequest {
pub repo: RepoUrlParts,
#[serde(rename = "orgUrlSlug")]
pub org_url_slug: String,
#[serde(rename = "clientVersion")]
pub client_version: String,
#[serde(rename = "remoteUrls")]
pub remote_urls: Vec<String>,
#[serde(rename = "externalId")]
pub external_id: Option<String>,
pub test_collection_short_id: Option<String>,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure why we were doing the conversion by hand. Serde makes it easy

Comment thread bundle/src/bundle_meta.rs
Comment on lines +48 to +49
#[serde(flatten, default)]
pub test_collection: Option<TestCollectionProps>,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm putting this directly in the base props because:

  • this is backwards compatible
  • base props are the easiest to access

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.

3 participants