diff --git a/scripts/set-default-contact/.eslintrc b/scripts/set-default-contact/.eslintrc deleted file mode 100644 index 3a4e653a29..0000000000 --- a/scripts/set-default-contact/.eslintrc +++ /dev/null @@ -1,35 +0,0 @@ -{ - "extends": "@medic", - "parserOptions": { - "ecmaVersion": 8 - }, - "plugins": ["promise", "node"], - "rules": { - "array-bracket-newline": ["error", "consistent"], - "array-callback-return": ["error", { "allowImplicit": true }], - "arrow-spacing": ["error", { "before": true, "after": true }], - "brace-style": ["error", "1tbs"], - "comma-spacing": ["error", { "before": false, "after": true }], - "comma-style": ["error", "last"], - "default-param-last": "error", - "dot-location": ["error", "property"], - "dot-notation": ["error", { "allowKeywords": true }], - "func-call-spacing": ["error", "never"], - "func-style": ["error", "expression"], - "linebreak-style": ["error", "unix"], - "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], - "no-alert": "error", - "no-extra-bind": "error", - "no-lone-blocks": "error", - "no-nested-ternary": "error", - "no-undef-init": "error", - "no-useless-rename": "error", - "no-whitespace-before-property": "error", - "node/no-exports-assign": "error", - "rest-spread-spacing": ["error", "never"], - "semi-spacing": ["error", { "before": false, "after": true }], - "semi-style": ["error", "last"], - "template-curly-spacing": "error", - "unicode-bom": ["error", "never"] - } -} diff --git a/scripts/set-default-contact/readme.md b/scripts/set-default-contact/readme.md index ce854948e2..a69494d25d 100644 --- a/scripts/set-default-contact/readme.md +++ b/scripts/set-default-contact/readme.md @@ -38,12 +38,4 @@ End * If a place had a contact set as default, but that contact was deleted, it is still considered as having a default contact already and will be skipped. The fix to this is to manually set the place to another contact and then unset that to be empty. * If two users are assigned to the same place, the one that is processed first will be set. The second (or Nth) user will be skipped because the place will already have a user -## Development - -This script has it's own ESLint rules found in the `.eslintrc` file. As of Dec 2022, the main difference is that it uses `ecmaVersion` of `8` instead of `6` like in `cht-core`. To ensure any changes comply, use this call before committing: - -```shell -../../node_modules/.bin/eslint index.js -``` - -Otherwise, use Docker Helper to spin up a local instance to test against to ensure contacts are set as default for places when users have them both assigned. +Use Docker Helper to spin up a local instance to test against to ensure contacts are set as default for places when users have them both assigned. diff --git a/tests/e2e/upgrade/wdio.conf.js b/tests/e2e/upgrade/wdio.conf.js index 25af17c387..34d42214a6 100644 --- a/tests/e2e/upgrade/wdio.conf.js +++ b/tests/e2e/upgrade/wdio.conf.js @@ -30,12 +30,12 @@ const MAIN_BRANCH = 'medic:medic:master'; const COMPOSE_FILES = ['cht-core', 'cht-couchdb']; const getUpgradeServiceDockerCompose = async () => { - const response = await fetch('https://raw.githubusercontent.com/medic/cht-upgrade-service/main/docker-compose.yml'); - const contents = await response.text(); - if (response.ok) { - await fs.promises.writeFile(UPGRADE_SERVICE_DC, contents); - } - throw new Error(contents); + const contents = await utils.request({ + uri: 'https://raw.githubusercontent.com/medic/cht-upgrade-service/main/docker-compose.yml', + json: false, + noAuth: true, + }); + await fs.promises.writeFile(UPGRADE_SERVICE_DC, contents); }; const getReleasesQuery = () => { @@ -59,7 +59,12 @@ const getRelease = async () => { } const url = `${MARKET_URL_READ}/${STAGING_SERVER}/_design/builds/_view/releases`; - const releases = await rpn.get({ url: url, qs: getReleasesQuery(), json: true }); + const releases = await utils.request({ + url: url, + qs: getReleasesQuery(), + noAuth: true, + }); + if (!releases.rows.length) { return MAIN_BRANCH; } @@ -71,7 +76,11 @@ const getMainCHTDockerCompose = async () => { const release = await getRelease(); for (const composeFile of COMPOSE_FILES) { const composeFileUrl = `${MARKET_URL_READ}/${STAGING_SERVER}/${release}/docker-compose/${composeFile}.yml`; - const contents = await rpn.get(composeFileUrl); + const contents = await utils.request({ + uri: composeFileUrl, + json: false, + noAuth: true, + }); const filePath = path.join(CHT_DOCKER_COMPOSE_FOLDER, `${composeFile}.yml`); await fs.promises.writeFile(filePath, contents); }