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

chore: Migrate orgUploadToken to ts #3602

Merged
merged 7 commits into from
Jan 2, 2025
Merged

chore: Migrate orgUploadToken to ts #3602

merged 7 commits into from
Jan 2, 2025

Conversation

suejung-sentry
Copy link
Contributor

@suejung-sentry suejung-sentry commented Dec 20, 2024

Migrate orgUploadToken related files to TS

Closes codecov/engineering-team#2859

Copy link

codecov bot commented Dec 20, 2024

Bundle Report

Changes will decrease total bundle size by 204 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.0MB 172 bytes (-0.0%) ⬇️
gazebo-production-system-esm 6.06MB 32 bytes (-0.0%) ⬇️

@codecov-staging
Copy link

codecov-staging bot commented Dec 20, 2024

Bundle Report

Changes will decrease total bundle size by 204 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 6.06MB 32 bytes (-0.0%) ⬇️
gazebo-staging-system 6.0MB 172 bytes (-0.0%) ⬇️

@codecov-staging
Copy link

codecov-staging bot commented Dec 20, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5633 1 5632 0
View the top 1 failed tests by shortest run time
src/pages/RepoPage/CoverageTab/OverviewTab/OverviewTab.test.tsx > Coverage overview tab > renders the coverage area chart
Stack Traces | 1.03s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="chart-container"]

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="mx-4 flex flex-col gap-4 divide-y border-solid border-ds-gray-secondary pt-4 sm:mx-0"
    >
      Summary
      <div
        class="flex flex-col"
      >
        <div
          class="hidden lg:block"
        >
          <div
            class="flex items-center justify-between py-4"
          >
            <button
              class="flex cursor-pointer items-center text-ds-secondary-text hover:underline [&[data-state=open]>span:first-child]:rotate-90"
              data-cy="toggle-chart"
              data-marketing="toggle-chart"
              data-state="open"
            >
              <span
                class="transition-transform duration-200"
              >
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
                    fill-rule="evenodd"
                  />
                </svg>
              </span>
              Hide charts
            </button>
          </div>
          <div
            class=""
            data-testid="toggle-element-contents"
          >
            <div
              class="mt-2 grid grid-cols-12 gap-4 pl-4"
            >
              <div
                class="inline-table col-span-9"
              />
              <div
                class="sticky top-32 col-span-3 flex aspect-square flex-col justify-center gap-4 px-8 py-4"
              >
                Sunburst
              </div>
            </div>
          </div>
        </div>
        <div
          class="flex items-center justify-center py-16"
        >
          <svg
            class="size-3 animate-spin"
            data-testid="spinner"
            fill="none"
            role="presentation"
            viewBox="0 0 24 24"
            xmlns="http://www.w3.org/2000/svg"
          >
            <circle
              class="opacity-25"
              cx="12"
              cy="12"
              r="10"
              stroke="currentColor"
              stroke-width="4"
            />
            <path
              class="opacity-75"
              d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
              fill="currentColor"
            />
          </svg>
        </div>
      </div>
    </div>
  </div>
</body>

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="mx-4 flex flex-col gap-4 divide-y border-solid border-ds-gray-secondary pt-4 sm:mx-0"
    >
      Summary
      <div
        class="flex flex-col"
      >
        <div
          class="hidden lg:block"
        >
          <div
            class="flex items-center justify-between py-4"
          >
            <button
              class="flex cursor-pointer items-center text-ds-secondary-text hover:underline [&[data-state=open]>span:first-child]:rotate-90"
              data-cy="toggle-chart"
              data-marketing="toggle-chart"
              data-state="open"
            >
              <span
                class="transition-transform duration-200"
              >
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
                    fill-rule="evenodd"
                  />
                </svg>
              </span>
              Hide charts
            </button>
          </div>
          <div
            class=""
            data-testid="toggle-element-contents"
          >
            <div
              class="mt-2 grid grid-cols-12 gap-4 pl-4"
            >
              <div
                class="inline-table col-span-9"
              />
              <div
                class="sticky top-32 col-span-3 flex aspect-square flex-col justify-center gap-4 px-8 py-4"
              >
                Sunburst
              </div>
            </div>
          </div>
        </div>
        <div
          class="flex items-center justify-center py-16"
        >
          <svg
            class="size-3 animate-spin"
            data-testid="spinner"
            fill="none"
            role="presentation"
            viewBox="0 0 24 24"
            xmlns="http://www.w3.org/2000/svg"
          >
            <circle
              class="opacity-25"
              cx="12"
              cy="12"
              r="10"
              stroke="currentColor"
              stroke-width="4"
            />
            <path
              class="opacity-75"
              d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
              fill="currentColor"
            />
          </svg>
        </div>
      </div>
    </div>
  </div>
</body>waitForWrapper node_modules/@.../dom/dist/wait-for.js:163:27node_modules/@.../dom/dist/query-helpers.js:86:33
 ❯ .../CoverageTab/OverviewTab/OverviewTab.test.tsx:456:44

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-qa
Copy link

codecov-qa bot commented Dec 20, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5633 1 5632 0
View the top 1 failed tests by shortest run time
src/pages/RepoPage/CoverageTab/OverviewTab/OverviewTab.test.tsx > Coverage overview tab > renders the coverage area chart
Stack Traces | 1.03s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="chart-container"]

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="mx-4 flex flex-col gap-4 divide-y border-solid border-ds-gray-secondary pt-4 sm:mx-0"
    >
      Summary
      <div
        class="flex flex-col"
      >
        <div
          class="hidden lg:block"
        >
          <div
            class="flex items-center justify-between py-4"
          >
            <button
              class="flex cursor-pointer items-center text-ds-secondary-text hover:underline [&[data-state=open]>span:first-child]:rotate-90"
              data-cy="toggle-chart"
              data-marketing="toggle-chart"
              data-state="open"
            >
              <span
                class="transition-transform duration-200"
              >
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
                    fill-rule="evenodd"
                  />
                </svg>
              </span>
              Hide charts
            </button>
          </div>
          <div
            class=""
            data-testid="toggle-element-contents"
          >
            <div
              class="mt-2 grid grid-cols-12 gap-4 pl-4"
            >
              <div
                class="inline-table col-span-9"
              />
              <div
                class="sticky top-32 col-span-3 flex aspect-square flex-col justify-center gap-4 px-8 py-4"
              >
                Sunburst
              </div>
            </div>
          </div>
        </div>
        <div
          class="flex items-center justify-center py-16"
        >
          <svg
            class="size-3 animate-spin"
            data-testid="spinner"
            fill="none"
            role="presentation"
            viewBox="0 0 24 24"
            xmlns="http://www.w3.org/2000/svg"
          >
            <circle
              class="opacity-25"
              cx="12"
              cy="12"
              r="10"
              stroke="currentColor"
              stroke-width="4"
            />
            <path
              class="opacity-75"
              d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
              fill="currentColor"
            />
          </svg>
        </div>
      </div>
    </div>
  </div>
</body>

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="mx-4 flex flex-col gap-4 divide-y border-solid border-ds-gray-secondary pt-4 sm:mx-0"
    >
      Summary
      <div
        class="flex flex-col"
      >
        <div
          class="hidden lg:block"
        >
          <div
            class="flex items-center justify-between py-4"
          >
            <button
              class="flex cursor-pointer items-center text-ds-secondary-text hover:underline [&[data-state=open]>span:first-child]:rotate-90"
              data-cy="toggle-chart"
              data-marketing="toggle-chart"
              data-state="open"
            >
              <span
                class="transition-transform duration-200"
              >
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
                    fill-rule="evenodd"
                  />
                </svg>
              </span>
              Hide charts
            </button>
          </div>
          <div
            class=""
            data-testid="toggle-element-contents"
          >
            <div
              class="mt-2 grid grid-cols-12 gap-4 pl-4"
            >
              <div
                class="inline-table col-span-9"
              />
              <div
                class="sticky top-32 col-span-3 flex aspect-square flex-col justify-center gap-4 px-8 py-4"
              >
                Sunburst
              </div>
            </div>
          </div>
        </div>
        <div
          class="flex items-center justify-center py-16"
        >
          <svg
            class="size-3 animate-spin"
            data-testid="spinner"
            fill="none"
            role="presentation"
            viewBox="0 0 24 24"
            xmlns="http://www.w3.org/2000/svg"
          >
            <circle
              class="opacity-25"
              cx="12"
              cy="12"
              r="10"
              stroke="currentColor"
              stroke-width="4"
            />
            <path
              class="opacity-75"
              d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
              fill="currentColor"
            />
          </svg>
        </div>
      </div>
    </div>
  </div>
</body>waitForWrapper node_modules/@.../dom/dist/wait-for.js:163:27node_modules/@.../dom/dist/query-helpers.js:86:33
 ❯ .../CoverageTab/OverviewTab/OverviewTab.test.tsx:456:44

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

codecov-public-qa bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.99%. Comparing base (a1e07ef) to head (9826704).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3602   +/-   ##
=======================================
  Coverage   98.98%   98.99%           
=======================================
  Files         810      810           
  Lines       14553    14556    +3     
  Branches     4136     4140    +4     
=======================================
+ Hits        14406    14409    +3     
  Misses        140      140           
  Partials        7        7           
Files with missing lines Coverage Δ
...ngs/tabs/OrgUploadToken/GenerateOrgUploadToken.tsx 100.00% <100.00%> (ø)
...untSettings/tabs/OrgUploadToken/OrgUploadToken.tsx 100.00% <100.00%> (ø)
...s/tabs/OrgUploadToken/RegenerateOrgUploadToken.tsx 100.00% <100.00%> (ø)
...ttings/tabs/OrgUploadToken/RegenrateTokenModal.tsx 100.00% <100.00%> (ø)
...s/tabs/OrgUploadToken/useGenerateOrgUploadToken.ts 100.00% <100.00%> (ø)
...ces/orgUploadToken/useRegenerateOrgUploadToken.tsx 100.00% <100.00%> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.72% <100.00%> (-0.01%) ⬇️
Services 99.36% <100.00%> (+<0.01%) ⬆️
Shared 99.37% <ø> (ø)
UI 99.14% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1e07ef...9826704. Read the comment docs.

Copy link

codecov bot commented Dec 20, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5633 1 5632 0
View the top 1 failed tests by shortest run time
src/pages/RepoPage/CoverageTab/OverviewTab/OverviewTab.test.tsx > Coverage overview tab > renders the coverage area chart
Stack Traces | 1.03s run time
TestingLibraryElementError: Unable to find an element by: [data-testid="chart-container"]

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="mx-4 flex flex-col gap-4 divide-y border-solid border-ds-gray-secondary pt-4 sm:mx-0"
    >
      Summary
      <div
        class="flex flex-col"
      >
        <div
          class="hidden lg:block"
        >
          <div
            class="flex items-center justify-between py-4"
          >
            <button
              class="flex cursor-pointer items-center text-ds-secondary-text hover:underline [&[data-state=open]>span:first-child]:rotate-90"
              data-cy="toggle-chart"
              data-marketing="toggle-chart"
              data-state="open"
            >
              <span
                class="transition-transform duration-200"
              >
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
                    fill-rule="evenodd"
                  />
                </svg>
              </span>
              Hide charts
            </button>
          </div>
          <div
            class=""
            data-testid="toggle-element-contents"
          >
            <div
              class="mt-2 grid grid-cols-12 gap-4 pl-4"
            >
              <div
                class="inline-table col-span-9"
              />
              <div
                class="sticky top-32 col-span-3 flex aspect-square flex-col justify-center gap-4 px-8 py-4"
              >
                Sunburst
              </div>
            </div>
          </div>
        </div>
        <div
          class="flex items-center justify-center py-16"
        >
          <svg
            class="size-3 animate-spin"
            data-testid="spinner"
            fill="none"
            role="presentation"
            viewBox="0 0 24 24"
            xmlns="http://www.w3.org/2000/svg"
          >
            <circle
              class="opacity-25"
              cx="12"
              cy="12"
              r="10"
              stroke="currentColor"
              stroke-width="4"
            />
            <path
              class="opacity-75"
              d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
              fill="currentColor"
            />
          </svg>
        </div>
      </div>
    </div>
  </div>
</body>

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="mx-4 flex flex-col gap-4 divide-y border-solid border-ds-gray-secondary pt-4 sm:mx-0"
    >
      Summary
      <div
        class="flex flex-col"
      >
        <div
          class="hidden lg:block"
        >
          <div
            class="flex items-center justify-between py-4"
          >
            <button
              class="flex cursor-pointer items-center text-ds-secondary-text hover:underline [&[data-state=open]>span:first-child]:rotate-90"
              data-cy="toggle-chart"
              data-marketing="toggle-chart"
              data-state="open"
            >
              <span
                class="transition-transform duration-200"
              >
                <svg
                  class="w-6 h-6"
                  data-icon=""
                  data-testid=""
                  fill="currentColor"
                  viewBox="0 0 20 20"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    clip-rule="evenodd"
                    d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
                    fill-rule="evenodd"
                  />
                </svg>
              </span>
              Hide charts
            </button>
          </div>
          <div
            class=""
            data-testid="toggle-element-contents"
          >
            <div
              class="mt-2 grid grid-cols-12 gap-4 pl-4"
            >
              <div
                class="inline-table col-span-9"
              />
              <div
                class="sticky top-32 col-span-3 flex aspect-square flex-col justify-center gap-4 px-8 py-4"
              >
                Sunburst
              </div>
            </div>
          </div>
        </div>
        <div
          class="flex items-center justify-center py-16"
        >
          <svg
            class="size-3 animate-spin"
            data-testid="spinner"
            fill="none"
            role="presentation"
            viewBox="0 0 24 24"
            xmlns="http://www.w3.org/2000/svg"
          >
            <circle
              class="opacity-25"
              cx="12"
              cy="12"
              r="10"
              stroke="currentColor"
              stroke-width="4"
            />
            <path
              class="opacity-75"
              d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
              fill="currentColor"
            />
          </svg>
        </div>
      </div>
    </div>
  </div>
</body>waitForWrapper node_modules/@.../dom/dist/wait-for.js:163:27node_modules/@.../dom/dist/query-helpers.js:86:33
 ❯ .../CoverageTab/OverviewTab/OverviewTab.test.tsx:456:44

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-releaser
Copy link
Contributor

codecov-releaser commented Dec 20, 2024

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
a234f31 Fri, 20 Dec 2024 04:45:31 GMT Expired Expired
de6466e Mon, 23 Dec 2024 21:12:27 GMT Expired Expired
be5de6c Tue, 24 Dec 2024 00:36:51 GMT Expired Expired
9030cf0 Thu, 02 Jan 2025 06:29:35 GMT Expired Expired
8fb2df0 Thu, 02 Jan 2025 09:11:48 GMT Expired Expired
9826704 Thu, 02 Jan 2025 09:47:33 GMT Cloud Enterprise

@@ -82,7 +87,7 @@ function RegenerateOrgUploadToken({ orgUploadToken }) {
{showModal && (
<RegenerateTokenModal
closeModal={() => setShowModal(false)}
regenerateToken={regenerateToken}
regenerateToken={() => Promise.resolve(regenerateToken())}
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious as to why you're wrapping this in a Promise.resolve?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was incorrect - I fixed it in the revised version with mutateAsync because the RegenerateTokenModal wants to await regenerateToken() before closing the modal here

Copy link
Contributor

@nicholas-codecov nicholas-codecov left a comment

Choose a reason for hiding this comment

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

LGTM

@suejung-sentry suejung-sentry added this pull request to the merge queue Jan 2, 2025
Merged via the queue into main with commit 0e9f64a Jan 2, 2025
56 of 62 checks passed
@suejung-sentry suejung-sentry deleted the sshin/2859 branch January 2, 2025 17:43
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.

org upload token
3 participants