Skip to content

Commit

Permalink
update versioned_branch check to allow ucxx/py branches (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
AyodeAwe authored Jul 25, 2024
1 parent bacc3c5 commit 9880f8c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugins/ForwardMerger/forward_merger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { OpsBotPlugin } from "../../plugin";
import { PayloadRepository } from "../../types";
import { isVersionedBranch, getVersionFromBranch } from "../../shared";
import { isVersionedBranch, getVersionFromBranch, isVersionedUCXBranch } from "../../shared";
import { basename } from "path";
import { Context } from "probot";
import { Octokit } from "@octokit/rest"
Expand All @@ -40,7 +40,7 @@ export class ForwardMerger extends OpsBotPlugin {
async mergeForward(): Promise<void> {
if (await this.pluginIsDisabled()) return;

if (!isVersionedBranch(this.currentBranch)) {
if (!isVersionedBranch(this.currentBranch) && !isVersionedUCXBranch(this.currentBranch)) {
this.logger.info("Will not merge forward on non-versioned branch");
return;
}
Expand Down
10 changes: 10 additions & 0 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ export const isVersionedBranch = (branchName: string): boolean => {
return Boolean(branchName.match(versionedBranchExp));
};

/**
* Returns true if the provided string is a versioned branch that follows the ucxx/py versioning scheme
* (i.e. "branch-0.36", "branch-0.40", etc.)
* @param branchName
*/
export const isVersionedUCXBranch = (branchName: string): boolean => {
const regex = "/^branch-\d{1,2}\.\d\d$/";
return Boolean(branchName.match(regex));
};

/**
* Returns the RAPIDS version from a versioned branch name
*/
Expand Down

0 comments on commit 9880f8c

Please sign in to comment.