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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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 425 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
gazebo-production-system 6.0MB 208 bytes (-0.0%) ⬇️
gazebo-production-system-esm 6.05MB 217 bytes (-0.0%) ⬇️

@codecov-staging
Copy link

codecov-staging bot commented Dec 20, 2024

Bundle Report

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

Detailed changes
Bundle name Size Change
gazebo-staging-system-esm 6.05MB 217 bytes (-0.0%) ⬇️
gazebo-staging-system 6.0MB 208 bytes (-0.0%) ⬇️

@codecov-staging
Copy link

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5641 1 5640 0
View the top 1 failed tests by shortest run time
src/pages/AccountSettings/tabs/OrgUploadToken/OrgUploadToken.test.tsx > OrgUploadToken > when user clicks on Generate button > when mutation is not successful > adds an error notification
Stack Traces | 1.05s run time
AssertionError: expected "spy" to be called with arguments: [ { type: 'error', …(1) } ]

Received: 

  1st spy call:

  Array [
    Object {
-     "text": "Authentication Error",
-     "type": "error",
+     "text": "Global upload token generated.",
+     "type": "success",
    },
  ]


Number of calls: 1


Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div>
      <div
        class="flex flex-col gap-4 lg:w-3/4"
      >
        <div
          class="flex gap-1"
        >
          <h1
            class="text-lg font-semibold"
          >
            Global upload token
          </h1>
          <div
            class="mt-2 text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="orgUploadTokenDoc"
              data-marketing="orgUploadTokenDoc"
              href="https://docs.codecov.com/docs/codecov-uploader#organization-upload-token"
              target="_blank"
            >
              learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </div>
        </div>
        <hr />
        <div
          class="flex flex-col gap-6"
        >
          TokenlessSection
          <div
            class="bg-ds-blue-nonary text-ds-gray-octonary p-4 dark:bg-opacity-20 border-l-4 border-ds-blue-quinary"
          >
            <h2
              class="font-semibold"
            >
              Sensitive credential
            </h2>
            <p>
              This token allows for valid upload of coverage reports to Codecov for any repository in your organization. You should treat it as a sensitive credential and not commit it to source control.
            </p>
          </div>
          <div
            class="border-2 border-ds-gray-primary p-4"
          >
            <div
              class="flex flex-col gap-6"
            >
              <div
                class="flex flex-row"
              >
                <p>
                  Generating a global token allows you to apply the same upload token to all of your repos. This can make configuration easier and more streamlined.
                </p>
                <div>
                  <button
                    class="
  flex items-center gap-1
  rounded py-1 px-4
  transition-colors duration-150 motion-reduce:transition-none

  focus:outline-none focus:ring

  disabled:cursor-not-allowed 
 disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary 
    justify-center font-semibold
    text-white bg-ds-blue-darker dark:bg-ds-blue-nonary border-ds-blue-quinary
    border-solid border shadow

    hover:bg-ds-blue-quinary
  "
                    data-cy="generate-org-upload-token"
                    data-marketing="generate-org-upload-token"
                    data-testid="generate-org-upload-token"
                  >
                    Generate
                  </button>
                </div>
              </div>
              <div
                class="flex gap-1"
              >
                <a
                  class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
                  data-cy="orgUploadTokenDoc"
                  data-marketing="orgUploadTokenDoc"
                  href="https://docs.codecov.com/docs/codecov-uploader#organization-upload-token"
                  target="_blank"
                >
                  Learn more
                  <span
                    class="text-ds-gray-quinary"
                  >
                    <svg
                      class="w-4 h-4"
                      data-icon=""
                      data-testid=""
                      fill="none"
                      stroke="currentColor"
                      viewBox="0 0 24 24"
                      xmlns="http://www.w3.org/2000/svg"
                    >
                      <path
                        d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                        stroke-linecap="round"
                        stroke-linejoin="round"
                        stroke-width="2"
                      />
                    </svg>
                  </span>
                </a>
                <p>
                  how to generate and use the global upload token.
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
 ❯ .../tabs/OrgUploadToken/OrgUploadToken.test.tsx:213:35runWithExpensiveErrorDiagnosticsDisabled node_modules/@.../dom/dist/config.js:47:12checkCallback node_modules/@.../dom/dist/wait-for.js:124:77Timeout.checkRealTimersCallback node_modules/@.../dom/dist/wait-for.js:118:16

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
5641 1 5640 0
View the top 1 failed tests by shortest run time
src/pages/AccountSettings/tabs/OrgUploadToken/OrgUploadToken.test.tsx > OrgUploadToken > when user clicks on Generate button > when mutation is not successful > adds an error notification
Stack Traces | 1.05s run time
AssertionError: expected "spy" to be called with arguments: [ { type: 'error', …(1) } ]

Received: 

  1st spy call:

  Array [
    Object {
-     "text": "Authentication Error",
-     "type": "error",
+     "text": "Global upload token generated.",
+     "type": "success",
    },
  ]


Number of calls: 1


Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div>
      <div
        class="flex flex-col gap-4 lg:w-3/4"
      >
        <div
          class="flex gap-1"
        >
          <h1
            class="text-lg font-semibold"
          >
            Global upload token
          </h1>
          <div
            class="mt-2 text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="orgUploadTokenDoc"
              data-marketing="orgUploadTokenDoc"
              href="https://docs.codecov.com/docs/codecov-uploader#organization-upload-token"
              target="_blank"
            >
              learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </div>
        </div>
        <hr />
        <div
          class="flex flex-col gap-6"
        >
          TokenlessSection
          <div
            class="bg-ds-blue-nonary text-ds-gray-octonary p-4 dark:bg-opacity-20 border-l-4 border-ds-blue-quinary"
          >
            <h2
              class="font-semibold"
            >
              Sensitive credential
            </h2>
            <p>
              This token allows for valid upload of coverage reports to Codecov for any repository in your organization. You should treat it as a sensitive credential and not commit it to source control.
            </p>
          </div>
          <div
            class="border-2 border-ds-gray-primary p-4"
          >
            <div
              class="flex flex-col gap-6"
            >
              <div
                class="flex flex-row"
              >
                <p>
                  Generating a global token allows you to apply the same upload token to all of your repos. This can make configuration easier and more streamlined.
                </p>
                <div>
                  <button
                    class="
  flex items-center gap-1
  rounded py-1 px-4
  transition-colors duration-150 motion-reduce:transition-none

  focus:outline-none focus:ring

  disabled:cursor-not-allowed 
 disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary 
    justify-center font-semibold
    text-white bg-ds-blue-darker dark:bg-ds-blue-nonary border-ds-blue-quinary
    border-solid border shadow

    hover:bg-ds-blue-quinary
  "
                    data-cy="generate-org-upload-token"
                    data-marketing="generate-org-upload-token"
                    data-testid="generate-org-upload-token"
                  >
                    Generate
                  </button>
                </div>
              </div>
              <div
                class="flex gap-1"
              >
                <a
                  class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
                  data-cy="orgUploadTokenDoc"
                  data-marketing="orgUploadTokenDoc"
                  href="https://docs.codecov.com/docs/codecov-uploader#organization-upload-token"
                  target="_blank"
                >
                  Learn more
                  <span
                    class="text-ds-gray-quinary"
                  >
                    <svg
                      class="w-4 h-4"
                      data-icon=""
                      data-testid=""
                      fill="none"
                      stroke="currentColor"
                      viewBox="0 0 24 24"
                      xmlns="http://www.w3.org/2000/svg"
                    >
                      <path
                        d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                        stroke-linecap="round"
                        stroke-linejoin="round"
                        stroke-width="2"
                      />
                    </svg>
                  </span>
                </a>
                <p>
                  how to generate and use the global upload token.
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
 ❯ .../tabs/OrgUploadToken/OrgUploadToken.test.tsx:213:35runWithExpensiveErrorDiagnosticsDisabled node_modules/@.../dom/dist/config.js:47:12checkCallback node_modules/@.../dom/dist/wait-for.js:124:77Timeout.checkRealTimersCallback node_modules/@.../dom/dist/wait-for.js:118:16

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

Copy link

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5641 1 5640 0
View the top 1 failed tests by shortest run time
src/pages/AccountSettings/tabs/OrgUploadToken/OrgUploadToken.test.tsx > OrgUploadToken > when user clicks on Generate button > when mutation is not successful > adds an error notification
Stack Traces | 1.05s run time
AssertionError: expected "spy" to be called with arguments: [ { type: 'error', …(1) } ]

Received: 

  1st spy call:

  Array [
    Object {
-     "text": "Authentication Error",
-     "type": "error",
+     "text": "Global upload token generated.",
+     "type": "success",
    },
  ]


Number of calls: 1


Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div>
      <div
        class="flex flex-col gap-4 lg:w-3/4"
      >
        <div
          class="flex gap-1"
        >
          <h1
            class="text-lg font-semibold"
          >
            Global upload token
          </h1>
          <div
            class="mt-2 text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="orgUploadTokenDoc"
              data-marketing="orgUploadTokenDoc"
              href="https://docs.codecov.com/docs/codecov-uploader#organization-upload-token"
              target="_blank"
            >
              learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </div>
        </div>
        <hr />
        <div
          class="flex flex-col gap-6"
        >
          TokenlessSection
          <div
            class="bg-ds-blue-nonary text-ds-gray-octonary p-4 dark:bg-opacity-20 border-l-4 border-ds-blue-quinary"
          >
            <h2
              class="font-semibold"
            >
              Sensitive credential
            </h2>
            <p>
              This token allows for valid upload of coverage reports to Codecov for any repository in your organization. You should treat it as a sensitive credential and not commit it to source control.
            </p>
          </div>
          <div
            class="border-2 border-ds-gray-primary p-4"
          >
            <div
              class="flex flex-col gap-6"
            >
              <div
                class="flex flex-row"
              >
                <p>
                  Generating a global token allows you to apply the same upload token to all of your repos. This can make configuration easier and more streamlined.
                </p>
                <div>
                  <button
                    class="
  flex items-center gap-1
  rounded py-1 px-4
  transition-colors duration-150 motion-reduce:transition-none

  focus:outline-none focus:ring

  disabled:cursor-not-allowed 
 disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary 
    justify-center font-semibold
    text-white bg-ds-blue-darker dark:bg-ds-blue-nonary border-ds-blue-quinary
    border-solid border shadow

    hover:bg-ds-blue-quinary
  "
                    data-cy="generate-org-upload-token"
                    data-marketing="generate-org-upload-token"
                    data-testid="generate-org-upload-token"
                  >
                    Generate
                  </button>
                </div>
              </div>
              <div
                class="flex gap-1"
              >
                <a
                  class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
                  data-cy="orgUploadTokenDoc"
                  data-marketing="orgUploadTokenDoc"
                  href="https://docs.codecov.com/docs/codecov-uploader#organization-upload-token"
                  target="_blank"
                >
                  Learn more
                  <span
                    class="text-ds-gray-quinary"
                  >
                    <svg
                      class="w-4 h-4"
                      data-icon=""
                      data-testid=""
                      fill="none"
                      stroke="currentColor"
                      viewBox="0 0 24 24"
                      xmlns="http://www.w3.org/2000/svg"
                    >
                      <path
                        d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                        stroke-linecap="round"
                        stroke-linejoin="round"
                        stroke-width="2"
                      />
                    </svg>
                  </span>
                </a>
                <p>
                  how to generate and use the global upload token.
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
 ❯ .../tabs/OrgUploadToken/OrgUploadToken.test.tsx:213:35runWithExpensiveErrorDiagnosticsDisabled node_modules/@.../dom/dist/config.js:47:12checkCallback node_modules/@.../dom/dist/wait-for.js:124:77Timeout.checkRealTimersCallback node_modules/@.../dom/dist/wait-for.js:118:16

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

Copy link

codecov bot commented Dec 20, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
5641 1 5640 0
View the top 1 failed tests by shortest run time
src/pages/AccountSettings/tabs/OrgUploadToken/OrgUploadToken.test.tsx > OrgUploadToken > when user clicks on Generate button > when mutation is not successful > adds an error notification
Stack Traces | 1.05s run time
AssertionError: expected "spy" to be called with arguments: [ { type: 'error', …(1) } ]

Received: 

  1st spy call:

  Array [
    Object {
-     "text": "Authentication Error",
-     "type": "error",
+     "text": "Global upload token generated.",
+     "type": "success",
    },
  ]


Number of calls: 1


Ignored nodes: comments, script, style
<html>
  <head />
  <body>
    <div>
      <div
        class="flex flex-col gap-4 lg:w-3/4"
      >
        <div
          class="flex gap-1"
        >
          <h1
            class="text-lg font-semibold"
          >
            Global upload token
          </h1>
          <div
            class="mt-2 text-xs"
          >
            <a
              class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
              data-cy="orgUploadTokenDoc"
              data-marketing="orgUploadTokenDoc"
              href="https://docs.codecov.com/docs/codecov-uploader#organization-upload-token"
              target="_blank"
            >
              learn more
              <span
                class="text-ds-gray-quinary"
              >
                <svg
                  class="w-4 h-4"
                  data-icon=""
                  data-testid=""
                  fill="none"
                  stroke="currentColor"
                  viewBox="0 0 24 24"
                  xmlns="http://www.w3.org/2000/svg"
                >
                  <path
                    d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    stroke-width="2"
                  />
                </svg>
              </span>
            </a>
          </div>
        </div>
        <hr />
        <div
          class="flex flex-col gap-6"
        >
          TokenlessSection
          <div
            class="bg-ds-blue-nonary text-ds-gray-octonary p-4 dark:bg-opacity-20 border-l-4 border-ds-blue-quinary"
          >
            <h2
              class="font-semibold"
            >
              Sensitive credential
            </h2>
            <p>
              This token allows for valid upload of coverage reports to Codecov for any repository in your organization. You should treat it as a sensitive credential and not commit it to source control.
            </p>
          </div>
          <div
            class="border-2 border-ds-gray-primary p-4"
          >
            <div
              class="flex flex-col gap-6"
            >
              <div
                class="flex flex-row"
              >
                <p>
                  Generating a global token allows you to apply the same upload token to all of your repos. This can make configuration easier and more streamlined.
                </p>
                <div>
                  <button
                    class="
  flex items-center gap-1
  rounded py-1 px-4
  transition-colors duration-150 motion-reduce:transition-none

  focus:outline-none focus:ring

  disabled:cursor-not-allowed 
 disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary 
    justify-center font-semibold
    text-white bg-ds-blue-darker dark:bg-ds-blue-nonary border-ds-blue-quinary
    border-solid border shadow

    hover:bg-ds-blue-quinary
  "
                    data-cy="generate-org-upload-token"
                    data-marketing="generate-org-upload-token"
                    data-testid="generate-org-upload-token"
                  >
                    Generate
                  </button>
                </div>
              </div>
              <div
                class="flex gap-1"
              >
                <a
                  class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
                  data-cy="orgUploadTokenDoc"
                  data-marketing="orgUploadTokenDoc"
                  href="https://docs.codecov.com/docs/codecov-uploader#organization-upload-token"
                  target="_blank"
                >
                  Learn more
                  <span
                    class="text-ds-gray-quinary"
                  >
                    <svg
                      class="w-4 h-4"
                      data-icon=""
                      data-testid=""
                      fill="none"
                      stroke="currentColor"
                      viewBox="0 0 24 24"
                      xmlns="http://www.w3.org/2000/svg"
                    >
                      <path
                        d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"
                        stroke-linecap="round"
                        stroke-linejoin="round"
                        stroke-width="2"
                      />
                    </svg>
                  </span>
                </a>
                <p>
                  how to generate and use the global upload token.
                </p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>
 ❯ .../tabs/OrgUploadToken/OrgUploadToken.test.tsx:213:35runWithExpensiveErrorDiagnosticsDisabled node_modules/@.../dom/dist/config.js:47:12checkCallback node_modules/@.../dom/dist/wait-for.js:124:77Timeout.checkRealTimersCallback node_modules/@.../dom/dist/wait-for.js:118:16

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

@codecov-releaser
Copy link
Contributor

✅ 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 Cloud Enterprise

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
2 participants