Skip to content

Commit

Permalink
fix(repos): remove restriction on last repo update days in list of re…
Browse files Browse the repository at this point in the history
…pos - hypothetical fix for #300 (#305)

* fix(repo-list): remove date-based filter for list of repos for a given token

hoping to fix #300

* fix(workflow-runs): increase test timeout
  • Loading branch information
tsimbalar authored May 11, 2022
1 parent f162840 commit a3af79f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions src/infra/github/RepoRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,9 @@ export class RepoRepository implements IRepoRepository {
public async listForToken(token: string): Promise<ReadonlyArray<Repo>> {
const octokit = this.octokitFactory(token);

const thirtyDaysAgo = new Date();
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);

const allRepos = await octokit.paginate(octokit.repos.listForAuthenticatedUser, {
sort: 'full_name',
direction: 'asc',
// ignore things that haven't been updated recently
// for me this allows to go from 200+ repos to ~75
since: thirtyDaysAgo.toISOString(),
});

const workflowsPerRepo = await this.getWorkflowsPerRepo(
Expand Down
2 changes: 1 addition & 1 deletion src/infra/github/__tests__/RepoRepository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ describe('RepoRepository', () => {

const spacesWithWorkflows = spacesWithoutTsimbalar.filter((s) => s.workflows.length > 0);
expect(spacesWithWorkflows).not.toHaveLength(0);
}, 20000 /* this may take a while */);
}, 60000 /* this may take a while */);
});
});
2 changes: 1 addition & 1 deletion src/infra/github/__tests__/WorkflowRunRepository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ describe('WorkflowRunRepository', () => {
([branch, runs]) => runs.length > maxRunsPerBranch
);
expect(branchRunsWithMoreThanNBuilds).toHaveLength(0);
}, 15000 /* timeout - can take a while */);
}, 60000 /* timeout - can take a while */);
});
});

0 comments on commit a3af79f

Please sign in to comment.