Skip to content
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

feat: Add in better debugging logs #132

Merged
merged 31 commits into from
May 17, 2024
Merged

Conversation

nicholas-codecov
Copy link
Collaborator

@nicholas-codecov nicholas-codecov commented May 16, 2024

Description

This PR adds back in debug logs for to inform the user of what commit sha has been chosen, as well as some extra logs around which commit sha is being chosen in cases like GH merge commits, so we can debug some issues around the wrong commit being selected.

Closes codecov/engineering-team#1751

Notable Changes

  • Allow debug log util to be enabled/disabled depending on passed in debug setting
  • Update CI providers to log out how the commit sha is chosen and which sha is being used
  • Update tests
  • Small tweaks

@codecov-notifications
Copy link

codecov-notifications bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 99.82669% with 1 lines in your changes are missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files Patch % Lines
...ndler-plugin-core/src/utils/providers/CodeBuild.ts 97.05% 1 Missing ⚠️
Components Coverage Δ
Plugin core 97.87% <99.82%> (+0.46%) ⬆️
Rollup plugin 10.56% <ø> (ø)
Vite plugin 10.72% <ø> (ø)
Webpack plugin 26.44% <ø> (ø)

📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 99.82669% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 79.51%. Comparing base (3ed9e97) to head (abb7db0).

✅ All tests successful. No failed tests found.

Files Patch % Lines
...ndler-plugin-core/src/utils/providers/CodeBuild.ts 97.05% 1 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
Plugin core 97.87% <99.82%> (+0.46%) ⬆️
Rollup plugin 10.56% <ø> (ø)
Vite plugin 10.72% <ø> (ø)
Webpack plugin 26.44% <ø> (ø)

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

@codecov-staging
Copy link

codecov-staging bot commented May 16, 2024

Bundle Report

Changes will decrease total bundle size by 992.73kB ⬇️

Bundle name Size Change
@codecov/webpack-plugin-cjs 3.56kB 0 bytes
@codecov/nuxt-plugin-cjs 1.38kB 0 bytes
@codecov/webpack-plugin-esm 1.29kB 0 bytes
@codecov/rollup-plugin-esm 2.4kB 1.24kB ⬆️
@codecov/bundler-plugin-core-esm 6.56kB 0 bytes
@codecov/example-webpack-app-array-push 71.19kB 71.19kB ⬆️
@codecov/nuxt-plugin-esm 855 bytes 0 bytes
@codecov/vite-plugin-esm 2.41kB 0 bytes
@codecov/example-next-app-edge-server-array-push 306 bytes 0 bytes
@codecov/example-rollup-app-iife 95.45kB 0 bytes
@codecov/example-vite-app-esm 150.61kB 150.61kB ⬆️
@codecov/rollup-plugin-cjs 2.93kB 0 bytes
@codecov/bundler-plugin-core-cjs 41.95kB 4.1kB ⬆️
@codecov/vite-plugin-cjs 2.92kB 0 bytes
@codecov/example-next-app-server-cjs (removed) 325.59kB ⬇️
@codecov/example-next-app-client-array-push (removed) 894.27kB ⬇️

Copy link

codecov bot commented May 16, 2024

Bundle Report

Changes will decrease total bundle size by 24.6kB ⬇️

Bundle name Size Change
@codecov/nuxt-plugin-cjs 1.38kB 0 bytes
@codecov/nuxt-plugin-esm 855 bytes 0 bytes
@codecov/webpack-plugin-cjs 3.56kB 0 bytes
@codecov/bundler-plugin-core-cjs 41.95kB 4.1kB ⬆️
@codecov/webpack-plugin-esm 1.29kB 1.56kB ⬇️
@codecov/bundler-plugin-core-esm 6.56kB 27.13kB ⬇️
@codecov/example-rollup-app-iife 95.45kB 0 bytes
@codecov/example-next-app-server-cjs 325.59kB 0 bytes
@codecov/example-next-app-edge-server-array-push 306 bytes 0 bytes
@codecov/vite-plugin-cjs 2.92kB 0 bytes
@codecov/example-webpack-app-array-push 71.19kB 0 bytes
@codecov/vite-plugin-esm 1.1kB 0 bytes
@codecov/rollup-plugin-cjs 2.93kB 0 bytes
@codecov/rollup-plugin-esm 1.17kB 0 bytes
@codecov/example-next-app-client-array-push 894.27kB 0 bytes
@codecov/example-vite-app-esm 150.61kB 0 bytes

Choose a reason for hiding this comment

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

What is the purpose of all these provider files?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They detect environment variables present in different CI providers so we can collect them and send them to the API such as branch, commit sha, etc.

Copy link

Choose a reason for hiding this comment

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

I haven't configured BA myself yet (probably ought to give it a go though), but this is really cool, but also seems like a PITA to maintain lol. Is there testing and/or monitoring in place to detect breaking changes by CI providers? Why have these providers been selected? I hadn't heard of half of these before lol. Are they actually users on each of these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You see ... Codecov already wrote (almost) all of these utilities in the Node uploader ... so most of them I myself didn't write. Yea it's understandable that there's lots, however I don't think many companies would do well changing CI env vars without a long run time notification ahead of time since many systems could break if they changed them

Copy link

@spalmurray-codecov spalmurray-codecov left a comment

Choose a reason for hiding this comment

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

Looks fine! I think I understand more or less what you've done here. Left a couple of curiosity questions. Missing coverage on a few lines too.

@nicholas-codecov nicholas-codecov merged commit a34fb57 into main May 17, 2024
33 checks passed
@nicholas-codecov nicholas-codecov deleted the feat-add-in-debugging-logs branch May 17, 2024 10:42
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.

Enhance Plugin Debug Logs
2 participants