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] Add rule to make provider casing more consistent #3640

Merged
merged 15 commits into from
Jan 8, 2025

Conversation

rohitvinnakota-codecov
Copy link
Contributor

@rohitvinnakota-codecov rohitvinnakota-codecov commented Jan 8, 2025

The linter will now warn if we use Github instead of GitHub, same for GitLab. Also fixes casing errors for Bitbucket.

This closes codecov/engineering-team#3175

Screenshot 2025-01-08 at 11 18 59 AM

@codecov-staging
Copy link

Bundle Report

Bundle size has no change ✅

@codecov-staging
Copy link

codecov-staging bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3640   +/-   ##
=======================================
  Coverage   98.95%   98.95%           
=======================================
  Files         811      811           
  Lines       14575    14575           
  Branches     4145     4145           
=======================================
  Hits        14422    14422           
  Misses        146      146           
  Partials        7        7           
Files with missing lines Coverage Δ
...hubIntegrationSection/GithubIntegrationSection.jsx 100.00% <ø> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...e/CommitCoverage/BotErrorBanner/BotErrorBanner.jsx 100.00% <100.00%> (ø)
.../RepoPage/FailedTestsTab/CodecovCLI/CodecovCLI.tsx 100.00% <ø> (ø)
...age/FailedTestsTab/GitHubActions/GitHubActions.tsx 100.00% <ø> (ø)
...ateLimitExceeded/GitHubRateLimitExceededBanner.tsx 100.00% <ø> (ø)
...rgControlTable/RepoOrgNotFound/RepoOrgNotFound.tsx 100.00% <ø> (ø)
src/shared/utils/loginProviders.ts 100.00% <ø> (ø)
src/shared/utils/provider.ts 100.00% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.66% <100.00%> (ø)
Services 99.33% <ø> (ø)
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 b598ce1...c3acdd8. Read the comment docs.

@codecov-qa
Copy link

codecov-qa bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.95%. Comparing base (b598ce1) to head (c3acdd8).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main    #3640   +/-   ##
=======================================
  Coverage   98.95%   98.95%           
=======================================
  Files         811      811           
  Lines       14575    14575           
  Branches     4138     4138           
=======================================
  Hits        14422    14422           
  Misses        146      146           
  Partials        7        7           
Files with missing lines Coverage Δ
...hubIntegrationSection/GithubIntegrationSection.jsx 100.00% <ø> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...e/CommitCoverage/BotErrorBanner/BotErrorBanner.jsx 100.00% <100.00%> (ø)
.../RepoPage/FailedTestsTab/CodecovCLI/CodecovCLI.tsx 100.00% <ø> (ø)
...age/FailedTestsTab/GitHubActions/GitHubActions.tsx 100.00% <ø> (ø)
...ateLimitExceeded/GitHubRateLimitExceededBanner.tsx 100.00% <ø> (ø)
...rgControlTable/RepoOrgNotFound/RepoOrgNotFound.tsx 100.00% <ø> (ø)
src/shared/utils/loginProviders.ts 100.00% <ø> (ø)
src/shared/utils/provider.ts 100.00% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.66% <100.00%> (ø)
Services 99.33% <ø> (ø)
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 b598ce1...c3acdd8. Read the comment docs.

Copy link

codecov-public-qa bot commented Jan 8, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2147 1 2146 0
View the top 1 failed tests by shortest run time
src/shared/GlobalBanners/GitHubRateLimitExceeded/GitHubRateLimitExceededBanner.test.tsx > GitHubRateLimitExceededBanner > provider is GH > renders the banner
Stack Traces | 0.11s run time
TestingLibraryElementError: Unable to find an accessible element with the role "link" and name "Github documentation."

Here are the accessible roles:

  alert:

  Name "":
  <div
    class="relative w-full border-l-4 p-4 border-orange-500 bg-orange-100 dark:bg-opacity-20"
    role="alert"
  />

  --------------------------------------------------
  heading:

  Name "Rate limit exceeded":
  <h5
    class="mb-1 font-semibold"
  />

  --------------------------------------------------
  paragraph:

  Name "":
  <p
    class="text-sm"
  />

  --------------------------------------------------
  link:

  Name "GitHub documentation.":
  <a
    class="
    font-sans cursor-pointer

    hover:underline

    focus:ring-2
   text-ds-blue-default inline-flex items-center gap-1"
    data-cy="githubRateLimitExceeded"
    data-marketing="githubRateLimitExceeded"
    data-testid="codecovGithubApp-link"
    href="https://docs.github..../rest/using-the-rest-api/rate-limits-for-the-rest-api"
    target="_blank"
  />

  --------------------------------------------------

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="mb-2"
    >
      <div
        class="relative w-full border-l-4 p-4 border-orange-500 bg-orange-100 dark:bg-opacity-20"
        role="alert"
      >
        <svg
          class="stroke-orange-500 float-left -mt-1 mr-2 align-middle w-6 h-6"
          data-icon="exclamationTriangle"
          data-testid="exclamationTriangle"
          fill="none"
          stroke="currentColor"
          stroke-width="1.5"
          viewBox="0 0 24 24"
          xmlns="http://www.w3.org/2000/svg"
        >
          <path
            d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"
            stroke-linecap="round"
            stroke-linejoin="round"
          />
        </svg>
        <h5
          class="mb-1 font-semibold"
        >
          Rate limit exceeded
        </h5>
        <p
          class="text-sm"
        >
          Unable to calculate coverage due to GitHub rate limit exceeded. Please retry later. More info on rate limits:
           
          <a
            class="
  font-sans cursor-pointer

  hover:underline

  focus:ring-2
 text-ds-blue-default inline-flex items-center gap-1"
            data-cy="githubRateLimitExceeded"
            data-marketing="githubRateLimitExceeded"
            data-testid="codecovGithubApp-link"
            href="https://docs.github..../rest/using-the-rest-api/rate-limits-for-the-rest-api"
            target="_blank"
          >
            GitHub documentation.
            <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>
      </div>
    </div>
  </div>
</body>Object.getElementError node_modules/@.../dom/dist/config.js:37:19node_modules/@.../dom/dist/query-helpers.js:76:38node_modules/@.../dom/dist/query-helpers.js:52:17node_modules/@.../dom/dist/query-helpers.js:95:19
 ❯ .../GlobalBanners/GitHubRateLimitExceeded/GitHubRateLimitExceededBanner.test.tsx:27:27

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 Jan 8, 2025

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
23172b1 Wed, 08 Jan 2025 16:33:35 GMT Expired Expired
23172b1 Wed, 08 Jan 2025 16:33:40 GMT Expired Expired
23172b1 Wed, 08 Jan 2025 16:33:52 GMT Expired Expired
23172b1 Wed, 08 Jan 2025 16:37:33 GMT Expired Expired
eb68a13 Wed, 08 Jan 2025 16:55:37 GMT Expired Expired
eb68a13 Wed, 08 Jan 2025 16:56:15 GMT Expired Expired
eb68a13 Wed, 08 Jan 2025 16:56:48 GMT Expired Expired
9cf93e9 Wed, 08 Jan 2025 17:16:14 GMT Expired Expired
9cf93e9 Wed, 08 Jan 2025 17:16:31 GMT Expired Expired
c3acdd8 Wed, 08 Jan 2025 17:26:53 GMT Cloud Enterprise

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.95%. Comparing base (b598ce1) to head (c3acdd8).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3640   +/-   ##
=======================================
  Coverage   98.95%   98.95%           
=======================================
  Files         811      811           
  Lines       14575    14575           
  Branches     4138     4138           
=======================================
  Hits        14422    14422           
  Misses        146      146           
  Partials        7        7           
Files with missing lines Coverage Δ
...hubIntegrationSection/GithubIntegrationSection.jsx 100.00% <ø> (ø)
...bs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx 100.00% <ø> (ø)
...e/CommitCoverage/BotErrorBanner/BotErrorBanner.jsx 100.00% <100.00%> (ø)
.../RepoPage/FailedTestsTab/CodecovCLI/CodecovCLI.tsx 100.00% <ø> (ø)
...age/FailedTestsTab/GitHubActions/GitHubActions.tsx 100.00% <ø> (ø)
...ateLimitExceeded/GitHubRateLimitExceededBanner.tsx 100.00% <ø> (ø)
...rgControlTable/RepoOrgNotFound/RepoOrgNotFound.tsx 100.00% <ø> (ø)
src/shared/utils/loginProviders.ts 100.00% <ø> (ø)
src/shared/utils/provider.ts 100.00% <ø> (ø)
Components Coverage Δ
Assets 100.00% <ø> (ø)
Layouts 99.71% <ø> (ø)
Pages 98.66% <100.00%> (ø)
Services 99.33% <ø> (ø)
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 b598ce1...c3acdd8. Read the comment docs.

Copy link

codecov bot commented Jan 8, 2025

Bundle Report

Bundle size has no change ✅

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.

Small addition to the eslint rule 👀

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to include Bitbucket with these rules, we may mis-case it in the opposite direction BitBucket 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I definitely did that before

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome thank you!

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.

Looks all good to me, pending the failing test (could be a flake)

@rohitvinnakota-codecov rohitvinnakota-codecov added this pull request to the merge queue Jan 8, 2025
Copy link
Contributor

@adrian-codecov adrian-codecov left a comment

Choose a reason for hiding this comment

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

🙌

Merged via the queue into main with commit 1eaa0d6 Jan 8, 2025
62 checks passed
@rohitvinnakota-codecov rohitvinnakota-codecov deleted the rvinnakota/lint-rules branch January 8, 2025 17:34
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.

[gazebo] Add an eslint rule enforcing provider casing
4 participants