Skip to content

feat: include user agent in headers #262

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
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

joseph-sentry
Copy link
Contributor

this will be helpful in the future for debugging customer issues since it will tell us what version of the plugins (at least the bundler core) they're using

this will be helpful in the future for debugging customer issues since
it will tell us what version of the plugins (at least the bundler
core) they're using
Copy link

codecov bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.74%. Comparing base (9c514a9) to head (58232ef).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
Components Coverage Δ
Plugin core 98.05% <100.00%> (+<0.01%) ⬆️
Rollup plugin 8.42% <ø> (ø)
Vite plugin 8.42% <ø> (ø)
Webpack plugin 56.84% <ø> (ø)

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

@codecov-notifications
Copy link

codecov-notifications bot commented May 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Components Coverage Δ
Plugin core 98.05% <100.00%> (+<0.01%) ⬆️
Rollup plugin 8.42% <ø> (ø)
Vite plugin 8.42% <ø> (ø)
Webpack plugin 56.84% <ø> (ø)

📢 Thoughts on this report? Let us know!

@codecov-staging
Copy link

codecov-staging bot commented May 26, 2025

Bundle Report

Changes will increase total bundle size by 14.68kB (0.19%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@codecov/bundler-plugin-core-cjs 314.01kB 81 bytes (0.03%) ⬆️
@codecov/bundle-analyzer-esm 6.9kB 3.79kB (122.05%) ⬆️
@codecov/solidstart-plugin-esm 949 bytes -2.08kB (-68.72%) ⬇️
@codecov/remix-vite-plugin-esm 3.02kB 2.06kB (215.05%) ⬆️
@codecov/example-next-15-app-client-array-push 1.05MB 10.83kB (1.05%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @codecov/bundler-plugin-core-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 14.67kB 14.67kB 100.0% 🚀
index.d.cts (Deleted) -14.67kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/remix-vite-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs (New) 3.02kB 3.02kB 100.0% 🚀
index.d.ts (Deleted) -957 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-next-15-app-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/media/8e9860b6e62d6359-*.woff2 (New) 85.27kB 85.27kB 100.0% 🚀
static/media/e4af272ccee01ff0-*.p.woff2 (New) 48.43kB 48.43kB 100.0% 🚀
server/middleware-*.js -873 bytes 36 bytes -96.04%
server/middleware-*.js 873 bytes 909 bytes 2425.0% ⚠️
static/qUR8azefpc_pv8Owup1LR/_buildManifest.js (New) 540 bytes 540 bytes 100.0% 🚀
static/qUR8azefpc_pv8Owup1LR/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/media/6d93bde91c0c2823-*.woff2 (Deleted) -74.32kB 0 bytes -100.0% 🗑️
static/media/a34f9d1faa5f3315-*.p.woff2 (Deleted) -48.56kB 0 bytes -100.0% 🗑️
static/u3i2v4D7yt5o2TrqxJgX2/_buildManifest.js (Deleted) -540 bytes 0 bytes -100.0% 🗑️
static/u3i2v4D7yt5o2TrqxJgX2/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/rollup-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 1.3kB 1.3kB 100.0% 🚀
index.d.ts (Deleted) -1.3kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/bundler-plugin-core-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.cjs 81 bytes 314.01kB 0.03%

Files in index.cjs:

  • ./src/utils/getPreSignedURL.ts → Total Size: 4.62kB
view changes for bundle: @codecov/sveltekit-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 891 bytes 891 bytes 100.0% 🚀
index.d.ts (Deleted) -891 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-astro-5-app-server-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
manifest_Bj1OpDKp.mjs (New) 3.37kB 3.37kB 100.0% 🚀
manifest_ywSiwne9.mjs (Deleted) -3.37kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/vite-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.cts (New) 1.24kB 1.24kB 100.0% 🚀
index.d.mts (Deleted) -1.24kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/solidstart-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 949 bytes 949 bytes 100.0% 🚀
index.mjs (Deleted) -3.03kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/bundle-analyzer-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs (New) 3.92kB 3.92kB 100.0% 🚀
cli.mjs (New) 2.98kB 2.98kB 100.0% 🚀
index.d.ts (Deleted) -2.77kB 0 bytes -100.0% 🗑️
cli.d.ts (Deleted) -342 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-astro-app-server-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
manifest_DQkxZD9m.mjs (New) 3.34kB 3.34kB 100.0% 🚀
manifest_BGspVYXq.mjs (Deleted) -3.34kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/webpack-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 3.45kB 3.45kB 100.0% 🚀
index.d.cts (Deleted) -3.45kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-next-app-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/sa_5vCaHYpzArjoglKG5D/_buildManifest.js (New) 224 bytes 224 bytes 100.0% 🚀
static/sa_5vCaHYpzArjoglKG5D/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/CdJhhV4Nm9mZ4a1j0IDn7/_buildManifest.js (Deleted) -224 bytes 0 bytes -100.0% 🗑️
static/CdJhhV4Nm9mZ4a1j0IDn7/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Copy link

codecov bot commented May 26, 2025

Bundle Report

Changes will increase total bundle size by 23.56kB (0.3%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@codecov/bundler-plugin-core-cjs 314.01kB 81 bytes (0.03%) ⬆️
@codecov/rollup-plugin-esm 6.41kB 5.11kB (392.55%) ⬆️
@codecov/example-sveltekit-app-client-esm 727.67kB -2 bytes (-0.0%) ⬇️
@codecov/example-sveltekit-app-server-esm 984.06kB -1 bytes (-0.0%) ⬇️
@codecov/nextjs-webpack-plugin-esm 4.86kB 3.74kB (336.0%) ⬆️
@codecov/example-next-15-app-client-array-push 1.05MB 10.83kB (1.05%) ⬆️
@codecov/bundle-analyzer-esm 6.9kB 3.79kB (122.05%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @codecov/remix-vite-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 957 bytes 957 bytes 100.0% 🚀
index.d.ts (Deleted) -957 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/bundler-plugin-core-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 14.67kB 14.67kB 100.0% 🚀
index.d.cts (Deleted) -14.67kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/webpack-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.ts (New) 3.45kB 3.45kB 100.0% 🚀
index.d.cts (Deleted) -3.45kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/sveltekit-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 891 bytes 891 bytes 100.0% 🚀
index.d.ts (Deleted) -891 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/nuxt-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.mts (New) 855 bytes 855 bytes 100.0% 🚀
index.d.ts (Deleted) -855 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-next-15-app-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/media/8e9860b6e62d6359-*.woff2 (New) 85.27kB 85.27kB 100.0% 🚀
static/media/e4af272ccee01ff0-*.p.woff2 (New) 48.43kB 48.43kB 100.0% 🚀
static/nojEx8mS4p8RZhyx7vpin/_buildManifest.js (New) 540 bytes 540 bytes 100.0% 🚀
static/nojEx8mS4p8RZhyx7vpin/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/media/6d93bde91c0c2823-*.woff2 (Deleted) -74.32kB 0 bytes -100.0% 🗑️
static/media/a34f9d1faa5f3315-*.p.woff2 (Deleted) -48.56kB 0 bytes -100.0% 🗑️
static/gX2Ir9rKnW7qImXwS9wpU/_buildManifest.js (Deleted) -540 bytes 0 bytes -100.0% 🗑️
static/gX2Ir9rKnW7qImXwS9wpU/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-next-app-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
server/middleware-*.js -852 bytes 36 bytes -95.95%
server/middleware-*.js 852 bytes 888 bytes 2366.67% ⚠️
static/p4i2uF7hUFFueuLJ6wW6Y/_buildManifest.js (New) 224 bytes 224 bytes 100.0% 🚀
static/p4i2uF7hUFFueuLJ6wW6Y/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/bh7tw4vdvemM1nU2Yu7ey/_buildManifest.js (Deleted) -224 bytes 0 bytes -100.0% 🗑️
static/bh7tw4vdvemM1nU2Yu7ey/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/vite-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.d.cts (New) 1.24kB 1.24kB 100.0% 🚀
index.d.ts (Deleted) -1.24kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-sveltekit-app-server-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
chunks/internal.js -1 bytes 18.48kB -0.01%
view changes for bundle: @codecov/rollup-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs (New) 6.41kB 6.41kB 100.0% 🚀
index.d.ts (Deleted) -1.3kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/bundle-analyzer-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs (New) 3.92kB 3.92kB 100.0% 🚀
cli.mjs (New) 2.98kB 2.98kB 100.0% 🚀
index.d.ts (Deleted) -2.77kB 0 bytes -100.0% 🗑️
cli.d.ts (Deleted) -342 bytes 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-astro-5-app-server-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
manifest_BtNXjlnV.mjs (New) 3.37kB 3.37kB 100.0% 🚀
manifest_C6_HwCp6.mjs (Deleted) -3.37kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/bundler-plugin-core-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.cjs 81 bytes 314.01kB 0.03%

Files in index.cjs:

  • ./src/utils/getPreSignedURL.ts → Total Size: 4.62kB
view changes for bundle: @codecov/example-astro-app-server-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
manifest_B0lf-STt.mjs (New) 3.34kB 3.34kB 100.0% 🚀
manifest_7Ip_uUuP.mjs (Deleted) -3.34kB 0 bytes -100.0% 🗑️
view changes for bundle: @codecov/example-sveltekit-app-client-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
_app/immutable/chunks/entry.*.js -2 bytes 31.45kB -0.01%
view changes for bundle: @codecov/nextjs-webpack-plugin-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
index.mjs (New) 4.86kB 4.86kB 100.0% 🚀
index.d.cts (Deleted) -1.11kB 0 bytes -100.0% 🗑️

@@ -53,6 +54,7 @@ export const getPreSignedURL = async ({
}: GetPreSignedURLArgs) => {
const headers = new Headers({
"Content-Type": "application/json",
"User-Agent": `codecov-bundler_plugin/${version}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason behind using this mixed casing instead of like codecov-bundler-plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it's not a great reason, but shelter has some code that splits out the User-Agent by '-' and indexes by 1:
user_agent.split('-')[1] so if i did codecov-bundler-plugin everything after the second - wouldn't be captured

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh got it, thanks for the context. It sounds like the current setup in shelter is a bit restrictive - thoughts on tweaking the logic there to handle User-Agent parsing more flexibly? That way, we won't be tied down by the format and can keep things cleaner going forward

Something like:
https://github.com/codecov/shelter/blob/5f7c3ecee45cc50085f8e97cc5647ca7b17f0c8b/libs/helpers.py#L611C1-L622C1
return headers["User-Agent"].split("/")[0].split("-",1)[1]

Do you know why we strip the codecov- in the first place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤷 i don't think there's a reason necessarily, i think it was just to keep the logs more short instead of including the "codecov-" prefix in all the log context

i think it should be fine to change the shelter handling to accommodate this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants