-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
883acf8
commit 0a35431
Showing
17 changed files
with
211 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** | ||
* Format of the .github/ops-bot.yaml file that can be | ||
* set in each repository | ||
*/ | ||
export type OpsBotConfig = { | ||
auto_merger: boolean; | ||
branch_checker: boolean; | ||
label_checker: boolean; | ||
release_drafter: boolean; | ||
external_contributors: boolean; | ||
}; | ||
|
||
/** | ||
* Default configuration options if no config is present in repository | ||
*/ | ||
export const DefaultOpsBotConfig: OpsBotConfig = { | ||
auto_merger: false, | ||
branch_checker: false, | ||
label_checker: false, | ||
release_drafter: false, | ||
external_contributors: true, | ||
}; | ||
|
||
/** | ||
* Configuration file path in repositories | ||
*/ | ||
export const OpsBotConfigPath = ".github/ops-bot.yaml"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { LabelChecker } from "../src/plugins/LabelChecker/label_checker"; | ||
import { makePRContext } from "./fixtures/contexts/pull_request"; | ||
import { mockConfigGet, mockContextRepo, mockExit } from "./mocks"; | ||
import { default as repoResp } from "./fixtures/responses/context_repo.json"; | ||
import { makeConfigReponse } from "./fixtures/responses/get_config"; | ||
|
||
const context = makePRContext({ labels: [] }); | ||
mockContextRepo.mockReturnValue(repoResp); | ||
|
||
describe("Config Checker", () => { | ||
beforeEach(() => { | ||
mockExit.mockReset(); | ||
}); | ||
|
||
test.each([ | ||
{ enabled: true, mockExitCalls: 0 }, | ||
{ enabled: false, mockExitCalls: 1 }, | ||
])("label_checker: $enabled", async ({ enabled, mockExitCalls }) => { | ||
mockConfigGet.mockResolvedValueOnce( | ||
makeConfigReponse({ label_checker: enabled }) | ||
); | ||
await new LabelChecker(context).checkLabels(); | ||
expect(mockExit).toBeCalledTimes(mockExitCalls); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"owner": "rapidsai", | ||
"repo": "cudf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { OpsBotConfig } from "../../../src/config"; | ||
|
||
export const makeConfigReponse = <E extends Partial<OpsBotConfig>>( | ||
opsBotConfig: E | ||
): { config: E } => { | ||
return { config: opsBotConfig }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.