mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-19 22:43:38 +00:00
🪣 feat: Look Up Bitbucket Cloud Pull Requests (#16987)
* feat: Look Up Bitbucket Cloud Pull Requests * fix: Keep the Pull Request Host Out of Overrides and Per-Host Keys A role, group, user or tenant override can no longer change or remove pullRequests.host, so feature gating and link recording see the operator's host. Links are recorded only from the configured host, and the batch share key and the rate limit cooldown are scoped by host. * fix: Compare Pull Request Link Hosts Through the Host Resolver * test: Add Pull Request Scenarios Against a Fake GitHub Enterprise Host * fix: Keep the Pull Request Provider Out of Overrides and the Batch Share Key A role, group, user or tenant override can no longer change pullRequests.provider, so feature gating and link recording agree with the lookup, and a batch lookup for one provider is never joined by a request for another. * fix: Read GitLab History Apart From Open Merge Requests Merged and closed merge requests are listed on their own, so open fork merge requests on the branch name cannot crowd them out. Rate limit cooldowns are scoped by provider, and a workspace repository with a dot segment is rejected. * fix: Revalidate Bitbucket Pull Requests and Skip Ones Without a Source Commit Read a full closed page so a newer closed fork cannot hide an older pull request from the repository, recheck the source branch and fork status on the detail, and treat a pull request without a source commit as unmatchable instead of failing the lookup. * fix: Follow Bitbucket's Next Link When Listing Pull Requests * fix: Record the Lane Pull Request Without an Aggregation Pipeline Update * fix: Match an Empty Lane Repository as Unknown * fix: List Locked GitLab Merge Requests With the Open Ones * fix: Replace an Expiring Fake Git Host Certificate
This commit is contained in:
parent
5ee091e99d
commit
5de60f36b9
29 changed files with 1746 additions and 86 deletions
|
|
@ -119,6 +119,12 @@ describe('createLaneGitRecorder', () => {
|
|||
);
|
||||
});
|
||||
|
||||
it('records only a link on the configured host', async () => {
|
||||
const { record, setConvoLaneGit } = make({ repo: 'o/r', host: 'ghe.example.com' });
|
||||
await record?.(laneGit, 'https://ghe.example.com/o/r/pull/5 https://github.com/o/r/pull/9');
|
||||
expect(setConvoLaneGit).toHaveBeenCalledWith(expect.objectContaining({ pullRequest: 5 }));
|
||||
});
|
||||
|
||||
it.each([
|
||||
['output without a link', 'nothing to see', 'o/r', laneGit],
|
||||
['a link to another repository', 'https://github.com/x/y/pull/42', 'o/r', laneGit],
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ const reservationTails = new Map<string, Promise<unknown>>();
|
|||
*/
|
||||
export async function createLaneGitRecorder({
|
||||
enabled,
|
||||
host,
|
||||
user,
|
||||
conversationId,
|
||||
repo,
|
||||
|
|
@ -89,6 +90,8 @@ export async function createLaneGitRecorder({
|
|||
}: {
|
||||
/** Whether the deployment shows pull requests; when it does not, nothing is read or recorded. */
|
||||
enabled: boolean;
|
||||
/** The configured pull request host; a link to any other host is not recorded. */
|
||||
host?: string;
|
||||
user: string | undefined;
|
||||
conversationId: string | undefined;
|
||||
repo?: string;
|
||||
|
|
@ -177,7 +180,7 @@ export async function createLaneGitRecorder({
|
|||
return (laneGit, output) => {
|
||||
const pullRequest =
|
||||
safeRepo != null && output != null && laneGit.branch != null
|
||||
? findPullRequestLink(output, safeRepo)
|
||||
? findPullRequestLink(output, safeRepo, host)
|
||||
: null;
|
||||
const previous = reservationTails.get(queueKey) ?? Promise.resolve();
|
||||
const reservation = previous.then(() => reserve());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue