From 24cb06285cf8d4fdfa0ca3190db84074b987f458 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 13 Mar 2024 16:26:48 -0700 Subject: [PATCH] feat(supersetbot): introduce `supersetbot` as its own npm package, CLI and comment-operated bot (#27046) --- .github/supersetbot/.eslintrc.json | 22 + .github/supersetbot/README.md | 37 + .github/supersetbot/jest.config.js | 8 + .github/supersetbot/package-lock.json | 11020 +++++++++++++++++++++++ .github/supersetbot/package.json | 36 + .github/supersetbot/src/cli.js | 175 + .github/supersetbot/src/context.js | 152 + .github/supersetbot/src/docker.js | 140 + .github/supersetbot/src/docker.test.js | 244 + .github/supersetbot/src/git.js | 120 + .github/supersetbot/src/git_release.js | 50 + .github/supersetbot/src/github.js | 252 + .github/supersetbot/src/index.js | 39 + .github/supersetbot/src/index.test.js | 51 + .github/supersetbot/src/metadata.js | 35 + .github/supersetbot/src/supersetbot | 27 + .github/supersetbot/src/utils.js | 78 + .github/workflows/docker-release.yml | 26 +- .github/workflows/docker.yml | 40 +- .github/workflows/supersetbot.yml | 57 + 20 files changed, 12577 insertions(+), 32 deletions(-) create mode 100644 .github/supersetbot/.eslintrc.json create mode 100644 .github/supersetbot/README.md create mode 100644 .github/supersetbot/jest.config.js create mode 100644 .github/supersetbot/package-lock.json create mode 100644 .github/supersetbot/package.json create mode 100755 .github/supersetbot/src/cli.js create mode 100644 .github/supersetbot/src/context.js create mode 100644 .github/supersetbot/src/docker.js create mode 100644 .github/supersetbot/src/docker.test.js create mode 100644 .github/supersetbot/src/git.js create mode 100644 .github/supersetbot/src/git_release.js create mode 100644 .github/supersetbot/src/github.js create mode 100644 .github/supersetbot/src/index.js create mode 100644 .github/supersetbot/src/index.test.js create mode 100644 .github/supersetbot/src/metadata.js create mode 100755 .github/supersetbot/src/supersetbot create mode 100644 .github/supersetbot/src/utils.js create mode 100644 .github/workflows/supersetbot.yml diff --git a/.github/supersetbot/.eslintrc.json b/.github/supersetbot/.eslintrc.json new file mode 100644 index 0000000000000..22f0d26d28384 --- /dev/null +++ b/.github/supersetbot/.eslintrc.json @@ -0,0 +1,22 @@ +{ + "extends": "airbnb-base", + "rules": { + "import/extensions": 0, + "import/prefer-default-export": 0, + "func-names": 0, + "no-console": 0, + "class-methods-use-this": 0 + }, + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module", + "requireConfigFile": false + }, + "env": { + "jest": true + } +} diff --git a/.github/supersetbot/README.md b/.github/supersetbot/README.md new file mode 100644 index 0000000000000..4042e985ce3fc --- /dev/null +++ b/.github/supersetbot/README.md @@ -0,0 +1,37 @@ +# supersetbot + +supersetbot is a utility bot that can be used to help around GitHub, CI and beyond. + +The bot can be used as a local CLI OR, for a subset of fitted use cases, can be invoked directly +from GitHub comments. + +Because it's its own npm app, it can be tested/deployed/used in isolation from the rest of +Superset, and take on some of the complexity from GitHub actions and onto a nifty +utility that can be used in different contexts. + +## Features + +```bash +$ use nvm 20 +$ npm i -g supersetbot +$ supersetbot +Usage: supersetbot [options] [command] + +Options: + -v, --verbose Output extra debugging information + -r, --repo The GitHub repo to use (ie: "apache/superset") + -d, --dry-run Run the command in dry-run mode + -a, --actor The actor + -h, --help display help for command + +Commands: + label [options]