diff --git a/tools/github-bot/src/commands/full-suite.ts b/tools/github-bot/src/commands/full-suite.ts deleted file mode 100644 index baec039bd4bb..000000000000 --- a/tools/github-bot/src/commands/full-suite.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Probot, Context } from "probot"; -import { monitorWorkflow } from "../tools/monitorWorkflow"; -import { commands } from "./tools"; - -// Keep this in sync with the workflow file -const ACTION_ID = "lld_full_suite"; - -/** - * Slash command `/full-lld-tests` - * Run the full e2e test suite on LLD - * - * @param app The Probot application. - */ -export function runDesktopTestSuite(app: Probot) { - async function triggerWorkflow({ - context, - login, - }: { - context: Context<"issue_comment.created" | "check_run.requested_action">; - login: string; - full?: boolean; - }) { - const { payload } = context; - let ref; - if ("check_run" in payload) { - ref = payload.check_run.pull_requests[0]?.base.ref; - } else { - const { data: prData } = await context.octokit.rest.pulls.get({ - ...context.repo(), - pull_number: payload.issue.number, - }); - ref = prData.head.repo?.fork ? prData.base.ref : prData.head.ref; - } - - return context.octokit.actions.createWorkflowDispatch({ - ...context.repo(), - workflow_id: "test-desktop.yml", - ref, - inputs: { - login, - }, - }); - } - - commands(app, "full-lld-tests", async (context, _data) => { - const { payload } = context; - - if (context.isBot) return; - - await triggerWorkflow({ - context, - login: `${payload.comment.user.login}`, - }); - }); - - app.on("check_run.requested_action", async context => { - const { payload } = context; - - if (payload.requested_action.identifier !== ACTION_ID) return; - - const login = payload.sender.login; - - await triggerWorkflow({ - context, - login, - }); - }); - - monitorWorkflow(app, { - file: "test-desktop.yml", - checkRunName: "@Desktop • Test App", - description: - "Perform [end to end](https://playwright.dev/) and [unit](https://jestjs.io/fr/) tests, [type checks](https://www.typescriptlang.org/) and run the [linter](https://eslint.org/) on the Ledger Live Desktop application.", - summaryFile: "summary.json", - getInputs: payload => ({ - ref: payload.check_run.head_sha, - login: payload.sender.login, - }), - }); -} diff --git a/tools/github-bot/src/commands/generate-screenshots.ts b/tools/github-bot/src/commands/generate-screenshots.ts index 80755140f1e5..acadc904ddcc 100644 --- a/tools/github-bot/src/commands/generate-screenshots.ts +++ b/tools/github-bot/src/commands/generate-screenshots.ts @@ -68,12 +68,16 @@ export function generateScreenshots(app: Probot) { const number = payload.check_run.pull_requests[0]?.number; const login = payload.sender.login; - const res = await context.octokit.orgs.checkMembershipForUser({ - org: "LedgerHQ", - username: login, - }); + try { + const res = await context.octokit.orgs.checkMembershipForUser({ + org: "LedgerHQ", + username: login, + }); - if (res.status >= 300) return; + if (res.status >= 300) return; + } catch (error) { + return; + } if (!number) return; diff --git a/tools/github-bot/src/commands/regen-doc.ts b/tools/github-bot/src/commands/regen-doc.ts index f7870ed8a5e5..6aaa6c85e3d5 100644 --- a/tools/github-bot/src/commands/regen-doc.ts +++ b/tools/github-bot/src/commands/regen-doc.ts @@ -69,12 +69,16 @@ export function regenDoc(app: Probot) { const number = payload.check_run.pull_requests[0]?.number; const login = payload.sender.login; - const res = await context.octokit.orgs.checkMembershipForUser({ - org: "LedgerHQ", - username: login, - }); + try { + const res = await context.octokit.orgs.checkMembershipForUser({ + org: "LedgerHQ", + username: login, + }); - if (res.status >= 300) return; + if (res.status >= 300) return; + } catch (error) { + return; + } if (!number) return; diff --git a/tools/github-bot/src/commands/regen-pods.ts b/tools/github-bot/src/commands/regen-pods.ts index d58c10508db2..7dac421b1307 100644 --- a/tools/github-bot/src/commands/regen-pods.ts +++ b/tools/github-bot/src/commands/regen-pods.ts @@ -69,12 +69,16 @@ export function regenPods(app: Probot) { const number = payload.check_run.pull_requests[0]?.number; const login = payload.sender.login; - const res = await context.octokit.orgs.checkMembershipForUser({ - org: "LedgerHQ", - username: login, - }); + try { + const res = await context.octokit.orgs.checkMembershipForUser({ + org: "LedgerHQ", + username: login, + }); - if (res.status >= 300) return; + if (res.status >= 300) return; + } catch (error) { + return; + } if (!number) return; diff --git a/tools/github-bot/src/index.ts b/tools/github-bot/src/index.ts index 38c9ec2d0745..5e6fa5bdb931 100644 --- a/tools/github-bot/src/index.ts +++ b/tools/github-bot/src/index.ts @@ -3,7 +3,6 @@ import { upToDate } from "./features/upToDate"; import { orchestrator } from "./features/orchestrator"; import { lintCommits } from "./features/lintCommits"; import { generateScreenshots } from "./commands/generate-screenshots"; -import { runDesktopTestSuite } from "./commands/full-suite"; import { regenPods } from "./commands/regen-pods"; import { regenDoc } from "./commands/regen-doc"; import { autoClose } from "./features/autoClose"; @@ -17,8 +16,6 @@ export default (app: Probot) => { regenPods(app); // /regen-doc command regenDoc(app); - // /full-lld-tests - runDesktopTestSuite(app); /* PR stuff */