Skip to content

Commit

Permalink
fix(gitea): fetch both open and closed issues (#6604)
Browse files Browse the repository at this point in the history
  • Loading branch information
CirnoT committed Jun 27, 2020
1 parent dd636ed commit 72c86c7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/platform/gitea/__snapshots__/gitea-helper.spec.ts.snap
Expand Up @@ -571,7 +571,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate",
},
"method": "GET",
"url": "https://gitea.renovatebot.com/api/v1/repos/some/repo/issues?",
"url": "https://gitea.renovatebot.com/api/v1/repos/some/repo/issues?type=issues",
},
]
`;
Expand All @@ -586,7 +586,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate",
},
"method": "GET",
"url": "https://gitea.renovatebot.com/api/v1/repos/some/repo/issues?state=open",
"url": "https://gitea.renovatebot.com/api/v1/repos/some/repo/issues?state=open&type=issues",
},
]
`;
Expand Down
4 changes: 2 additions & 2 deletions lib/platform/gitea/gitea-helper.spec.ts
Expand Up @@ -461,7 +461,7 @@ describe('platform/gitea/gitea-helper', () => {
it('should call /api/v1/repos/[repo]/issues endpoint', async () => {
httpMock
.scope(baseUrl)
.get(`/repos/${mockRepo.full_name}/issues`)
.get(`/repos/${mockRepo.full_name}/issues?type=issues`)
.reply(200, [mockIssue]);

const res = await ght.searchIssues(mockRepo.full_name, {});
Expand All @@ -472,7 +472,7 @@ describe('platform/gitea/gitea-helper', () => {
it('should construct proper query parameters', async () => {
httpMock
.scope(baseUrl)
.get(`/repos/${mockRepo.full_name}/issues?state=open`)
.get(`/repos/${mockRepo.full_name}/issues?state=open&type=issues`)
.reply(200, [mockIssue]);

const res = await ght.searchIssues(mockRepo.full_name, {
Expand Down
2 changes: 1 addition & 1 deletion lib/platform/gitea/gitea-helper.ts
Expand Up @@ -379,7 +379,7 @@ export async function searchIssues(
params: IssueSearchParams,
options?: GiteaHttpOptions
): Promise<Issue[]> {
const query = queryParams(params).toString();
const query = queryParams({ ...params, type: 'issues' }).toString();
const url = `repos/${repoPath}/issues?${query}`;
const res = await giteaHttp.getJson<Issue[]>(url, {
...options,
Expand Down
4 changes: 2 additions & 2 deletions lib/platform/gitea/index.ts
Expand Up @@ -467,7 +467,7 @@ const platform: Platform = {
getPrList(): Promise<Pr[]> {
if (config.prList === null) {
config.prList = helper
.searchPRs(config.repository, {}, { useCache: false })
.searchPRs(config.repository, { state: 'all' }, { useCache: false })
.then((prs) => {
const prList = prs.map(toRenovatePR).filter(Boolean);
logger.debug(`Retrieved ${prList.length} Pull Requests`);
Expand Down Expand Up @@ -632,7 +632,7 @@ const platform: Platform = {
getIssueList(): Promise<Issue[]> {
if (config.issueList === null) {
config.issueList = helper
.searchIssues(config.repository, {}, { useCache: false })
.searchIssues(config.repository, { state: 'all' }, { useCache: false })
.then((issues) => {
const issueList = issues.map(toRenovateIssue);
logger.debug(`Retrieved ${issueList.length} Issues`);
Expand Down

0 comments on commit 72c86c7

Please sign in to comment.