From 9599ea3b853005290b95a09cd74a8179424691c0 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Mon, 25 Mar 2024 13:03:24 -0700 Subject: [PATCH] feat: move supersetbot out of repo and make it dependabot --- .github/actions/setup-supersetbot/action.yml | 38 +- .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/cli.test.js | 12 - .github/supersetbot/src/context.js | 152 - .github/supersetbot/src/docker.js | 142 - .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 | 36 - .github/supersetbot/src/supersetbot | 27 - .github/supersetbot/src/utils.js | 78 - .github/workflows/bump-python-package.yml | 65 + .github/workflows/docker-release.yml | 8 - .github/workflows/docker.yml | 10 - .github/workflows/issue_creation.yml | 5 +- .github/workflows/no-op.yml | 8 +- .github/workflows/supersetbot.yml | 10 +- .gitignore | 1 + pyproject.toml | 198 + requirements/base.txt | 4 +- requirements/development.in | 24 +- requirements/development.txt | 66 +- setup.py | 147 +- 31 files changed, 342 insertions(+), 12743 deletions(-) delete mode 100644 .github/supersetbot/.eslintrc.json delete mode 100644 .github/supersetbot/README.md delete mode 100644 .github/supersetbot/jest.config.js delete mode 100644 .github/supersetbot/package-lock.json delete mode 100644 .github/supersetbot/package.json delete mode 100755 .github/supersetbot/src/cli.js delete mode 100644 .github/supersetbot/src/cli.test.js delete mode 100644 .github/supersetbot/src/context.js delete mode 100644 .github/supersetbot/src/docker.js delete mode 100644 .github/supersetbot/src/docker.test.js delete mode 100644 .github/supersetbot/src/git.js delete mode 100644 .github/supersetbot/src/git_release.js delete mode 100644 .github/supersetbot/src/github.js delete mode 100644 .github/supersetbot/src/index.js delete mode 100644 .github/supersetbot/src/index.test.js delete mode 100644 .github/supersetbot/src/metadata.js delete mode 100755 .github/supersetbot/src/supersetbot delete mode 100644 .github/supersetbot/src/utils.js create mode 100644 .github/workflows/bump-python-package.yml create mode 100644 pyproject.toml diff --git a/.github/actions/setup-supersetbot/action.yml b/.github/actions/setup-supersetbot/action.yml index 155af26c08e4..1374a367e402 100644 --- a/.github/actions/setup-supersetbot/action.yml +++ b/.github/actions/setup-supersetbot/action.yml @@ -1,11 +1,39 @@ name: 'Setup supersetbot' -description: 'Sets up supersetbot npm lib from the repo' +description: 'Sets up supersetbot npm lib from the repo or npm' +inputs: + from-npm: + description: 'Install from npm instead of local setup' + required: false + default: 'false' # Defaults to using the local setup runs: using: 'composite' steps: - - name: Install dependencies + + - name: Setup Node Env + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install supersetbot from npm + if: ${{ inputs.from-npm == 'true' }} shell: bash + run: npm install -g supersetbot + + - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" + if: ${{ inputs.from-npm != 'true' }} + repository: apache-superset/supersetbot + uses: actions/checkout@v4 + path: supersetbot + + - name: Setup supersetbot from repo + if: ${{ inputs.from-npm != 'true' }} + shell: bash + working-directory: supersetbot run: | - cd .github/supersetbot - npm install - npm link + # simple trick to install globally with dependencies + npm pack + npm install -g ./supersetbot*.tgz + + - name: supersetbot version + shell: bash + run: supersetbot version diff --git a/.github/supersetbot/.eslintrc.json b/.github/supersetbot/.eslintrc.json deleted file mode 100644 index 22f0d26d2838..000000000000 --- a/.github/supersetbot/.eslintrc.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "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 deleted file mode 100644 index 4042e985ce3f..000000000000 --- a/.github/supersetbot/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# 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]