Skip to content

feat(Codecov): add Codecov repository picker #92068

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

Merged
merged 4 commits into from
May 22, 2025

Conversation

adrianviquez
Copy link
Contributor

This PR adds the RepoPicker and RepoSelector components as well as adding them to the Test page.

Notes

  • Add RepoSelector component
  • Add RepoPicker component
  • Add RepoPicker component to Tests page

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@adrianviquez adrianviquez requested a review from a team as a code owner May 21, 2025 21:18
@adrianviquez adrianviquez changed the title feat: add Codecov repository picker feat(Codecov): add Codecov repository picker May 21, 2025
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 21, 2025
Copy link

codecov bot commented May 21, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
10339 1 10338 9
View the top 1 failed test(s) by shortest run time
CoveragePageWrapper when the wrapper is used renders the passed children
Stack Traces | 0.204s run time
Error: Expected test not to call console.error().

If the error is expected, test for it explicitly by mocking it out using jest.spyOn(console, 'error').mockImplementation() and test that the warning occurs.

An update to Control inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
    at console.captureMessage [as error] (.../node_modules/jest-fail-on-console/index.js:83:25)
    at .../react-dom/cjs/react-dom-client.development.js:16023:19
    at runWithFiberInDEV (.../react-dom/cjs/react-dom-client.development.js:1522:13)
    at warnIfUpdatesNotWrappedWithActDEV (.../react-dom/cjs/react-dom-client.development.js:16022:9)
    at scheduleUpdateOnFiber (.../react-dom/cjs/react-dom-client.development.js:14396:11)
    at dispatchSetStateInternal (.../react-dom/cjs/react-dom-client.development.js:6969:13)
    at dispatchSetState (.../react-dom/cjs/react-dom-client.development.js:6927:7)
    at .../lib/cjs/usePopper.js:64:11
    at Object.<anonymous>.process.env.NODE_ENV.exports.flushSync (.../react-dom/cjs/react-dom.development.js:136:18)
    at fn (.../lib/cjs/usePopper.js:63:18)
    at Object.fn [as forceUpdate] (.../sentry/sentry/node_modules/@.../core/src/createPopper.js:235:21)
    at forceUpdate (.../sentry/sentry/node_modules/@.../core/src/createPopper.js:245:22)
    at new Promise (<anonymous>)
    at .../sentry/sentry/node_modules/@.../core/src/createPopper.js:244:11
    at fn (.../sentry/sentry/node_modules/@.../src/utils/debounce.js:10:19)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at flushUnexpectedConsoleCalls (.../sentry/sentry/node_modules/jest-fail-on-console/index.js:48:13)
    at Object.<anonymous> (.../sentry/sentry/node_modules/jest-fail-on-console/index.js:139:7)
    at Promise.then.completed (.../sentry/sentry/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (.../sentry/sentry/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusHook (.../sentry/sentry/node_modules/jest-circus/build/run.js:281:40)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at _runTest (.../sentry/sentry/node_modules/jest-circus/build/run.js:254:5)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (.../sentry/sentry/node_modules/jest-circus/build/run.js:121:9)
    at run (.../sentry/sentry/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (.../sentry/sentry/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (.../sentry/sentry/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (.../sentry/sentry/node_modules/jest-runner/build/testWorker.js:106:12)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

export interface RepoSelectorProps {
onChange: (data: string) => void;
/**
* Repository date value
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong comment right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🙃

Comment on lines 15 to 17
const currentParams = new URLSearchParams(location.search);
currentParams.set('repository', newRepository);
navigate(`${location.pathname}?${currentParams.toString()}`, {replace: true});
Copy link
Contributor

Choose a reason for hiding this comment

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

Would using the const [searchParams, setSearchParams] = useSearchParams(); hook work for you here? It looks like only the search params are being changed right? I think the hook is slightly lighter weight. I used it for my radio selector switching but I'm trying to decide if one is better than the other for both cases or if they should be different.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sgtm, I'll change that in a sec!

@adrianviquez adrianviquez merged commit 59943b2 into master May 22, 2025
41 checks passed
@adrianviquez adrianviquez deleted the adrian/add-codecov-repo-picker branch May 22, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants