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 Jun 21, 2024
1 parent ee6d537 commit 9d164e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 115 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,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 Expand Up @@ -72,7 +71,7 @@ When config option omitted, default for config file will be local `config.json`.
"org": "myOrg",
"daysUntilStale": 90, // If omitted, 365 will be used as default
"ghAuthToken": "my-GH-auth-token",
"pkgName": "myPkg",
"pkgName": "myPkg"
}
```

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 9d164e4

Please sign in to comment.