Skip to content

Commit

Permalink
- refactor: remove slower scan workaround, issue was fixed on octokit…
Browse files Browse the repository at this point in the history
  • Loading branch information
smellai committed Jul 5, 2024
1 parent fe5d4b8 commit a0052b8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 114 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Archived repositories are filtered out.
> :warning: GitHub API are rate limited, and search API in particular has the additional [secondary rate limit](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#secondary-rate-limits). _package-adoption_ implements the [best practices guidelines](https://docs.github.com/en/rest/guides/best-practices-for-integrators#dealing-with-secondary-rate-limits) to deal with it, but you should know that limitations could happen in any case.
> :warning: GitHub search API are not 100% reliable and sometimes return deleted / outdated files or multiple versions of the same file. The library version in the output could be inaccurate for this reason.
> There is a [known issue](https://github.com/community/community/discussions/20633#discussioncomment-3735796) with package names with a scope containing hyphen character, e.g. `@typescript-eslint/parser`. A slower version of the main scan function will be automatically used to handle this case.
## Install

Expand Down
8 changes: 1 addition & 7 deletions src/getFilteredReposWithPackageForOrg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { readPackageJson } from './readPackageJson.js';
import { init, octokit } from './octokitInit.js';
import { isStale } from './isRepoStale.js';
import { validateConfig } from './validateConfig.js';
import { getFilteredReposWithPackageForOrgSlower } from './getFilteredReposWithPackageForOrgSlower.js';

/**
* It takes an organization name and a package name, and returns a list of all the repositories in that
Expand Down Expand Up @@ -46,12 +45,7 @@ export const getFilteredReposWithPackageForOrg = async (
);

if (foundPackageJsonFiles.length === 0) {
// workaround to address github search issue https://github.com/community/community/discussions/20633#discussioncomment-3735796
const repositoriesWithPackage =
await getFilteredReposWithPackageForOrgSlower({ ...config }, octokit);
if (repositoriesWithPackage?.length === 0) {
console.log(`[package-adoption]: No results for ${pkgName}`);
}
console.log(`[package-adoption]: No results for ${pkgName}`);
return repositoriesWithPackage;
}

Expand Down
106 changes: 0 additions & 106 deletions src/getFilteredReposWithPackageForOrgSlower.ts

This file was deleted.

0 comments on commit a0052b8

Please sign in to comment.