(from: string, to: string)
| 714 | } |
| 715 | |
| 716 | async getDifferences(from: string, to: string): Promise<ForgejoCompareResponse> { |
| 717 | // For OA, try the fork repo first, then fall back to origin |
| 718 | const repoURL = this.useOpenAuthoring ? this.repoURL : this.originRepoURL; |
| 719 | try { |
| 720 | return await this.request( |
| 721 | `${repoURL}/compare/${encodeURIComponent(from)}...${encodeURIComponent(to)}`, |
| 722 | ); |
| 723 | } catch (e) { |
| 724 | if (this.useOpenAuthoring) { |
| 725 | // Retry with origin repo |
| 726 | return this.request( |
| 727 | `${this.originRepoURL}/compare/${encodeURIComponent(from)}...${encodeURIComponent(to)}`, |
| 728 | ); |
| 729 | } |
| 730 | throw e; |
| 731 | } |
| 732 | } |
| 733 | |
| 734 | async updatePullRequestLabels(number: number, labels: number[]): Promise<ForgejoLabel[]> { |
| 735 | return this.request(`${this.originRepoURL}/issues/${number}/labels`, { |
no test coverage detected