Skip to content

Commit

Permalink
Merge branch 'master' into v2.46.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gniezen committed Jul 11, 2022
2 parents a811d18 + 9502210 commit 6f755a5
Show file tree
Hide file tree
Showing 27 changed files with 100 additions and 3,307 deletions.
39 changes: 37 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
jobs:
build:
build-macos:
working_directory: ~/tidepool-org/chrome-uploader
parallelism: 1
# CircleCI 2.0 does not support environment variables that refer to each other the same way as 1.0 did.
Expand All @@ -11,6 +11,8 @@ jobs:
xcode: '12.5.1'
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- run: echo 'export PATH=${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin' >> $BASH_ENV
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
Expand All @@ -36,13 +38,46 @@ jobs:
- run: yarn test
# Package
- run: if [ -z "$CIRCLE_PR_NUMBER" ]; then yarn package; else echo "Forked repo; no package built."; fi
build-windows:
machine:
# see https://circleci.com/developer/machine/image/windows-server-2019 for details
image: windows-server-2019-vs2019:stable
resource_class: windows.medium
shell: bash.exe
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: nvm install v12.13.0
- run: nvm use v12.13.0
- run: node -v
- run: npm install --global yarn
- run: yarn config set cache-folder ~/.cache/yarn
- run: yarn --frozen-lockfile
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- ~/.cache/yarn
- ./node_modules
# Test
- run: yarn lint
- run: yarn test
# Package
- run: if [ -z "$CIRCLE_PR_NUMBER" ]; then yarn package; else echo "Forked repo; no package built."; fi
- run: if [ -n "$CIRCLE_TAG" ]; then yarn av-whitelist; else echo "Not a tagged release."; fi

# runs build for all branches and all tags starting with v.
workflows:
version: 2
build-release:
jobs:
- build:
- build-macos:
filters:
tags:
only: /^v.*/
- build-windows:
filters:
tags:
only: /^v.*/
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"no-use-before-define": 0,
"max-len": ["warn", { "code": 100 }],
"prefer-destructuring": "warn",
"linebreak-style": 0,
"no-buffer-constructor": "warn"
},
"plugins": [
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/drivers/tandem"]
path = lib/drivers/tandem
url = [email protected]:tidepool-org/tandem-driver.git
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@


[![CircleCI](https://circleci.com/gh/tidepool-org/uploader/tree/master.svg?style=shield)](https://circleci.com/gh/tidepool-org/uploader/tree/master)
[![Build status](https://ci.appveyor.com/api/projects/status/jj71uykxm27s3mla/branch/master?svg=true)](https://ci.appveyor.com/project/krystophv/uploader/branch/master)


This is an [Electron App](https://electron.atom.io/) that acts as an uploader client for Tidepool. It is intended to allow you to plug diabetes devices into your computer's USB port, read the data stored on them, and upload a standardized version of the data to the Tidepool cloud.
Expand Down Expand Up @@ -89,7 +88,7 @@ All debug options are turned *off* by default in `config/local.sh`.

## Tests

To run the tests in this repository as they are run on CircleCI and Appveyor use:
To run the tests in this repository as they are run on CircleCI use:

```bash
$ yarn test
Expand All @@ -103,7 +102,7 @@ $ yarn test

We use [ESLint](http://eslint.org/) to lint our JavaScript code. We try to use the same linting options across all our client apps, but there are a few exceptions in this application, noted with comments in the `.eslintrc` configuration file.

To run the linter (which also runs on CircleCI and Appveyor with every push, along with `npm test`), use:
To run the linter (which also runs on CircleCI with every push, along with `npm test`), use:

```
$ npm run lint
Expand All @@ -124,7 +123,7 @@ See [this guidance on our use of GitBook at Tidepool](http://developer.tidepool.
This section is Tidepool-specific. Release management and application updates are handled via the Github provider in the `electron-builder` project. The recommended workflow for a new production release is as follows:

1. When you're working on what might become a new release, increment the version number in `package.json` and `app/package.json` and commit/push (on the branch)
1. The CI server(s) will create a draft release in Github with the title of the version from the `package.json` file and will automatically attach the distribution artifacts to that draft (drafts are not publicly visible)
1. The CI server will create a draft release in Github with the title of the version from the `package.json` file and will automatically attach the distribution artifacts to that draft (drafts are not publicly visible)
1. When your pull request is approved and merged to `master`, go to the draft release and type in the version for the tag name, ensure that you're targeting the `master` branch, fill out the release notes and publish the release. This will create the tag for you.

For a non-production release (alpha, dev, etc.)
Expand All @@ -137,22 +136,24 @@ The Uploader has a self-update mechanism that will look at the latest release an

### CI server environment variables

We use the following environment variables on the CI servers:
We use the following environment variables on the CI server:

| Variable | CI Server | Use |
| Variable | OS Image | Use |
|----------|-----------|-------|
| APPLEID | CircleCI | Notarization |
| APPLEIDPASS | CircleCI | Notarization |
| APPLEID | MacOS | Notarization |
| APPLEIDPASS | MacOS | Notarization |
| AWS_ACCESS_KEY_ID | Both | S3 builds and AV e-mails |
| AWS_SECRET_ACESS_KEY | Both | S3 builds and AV e-mails |
| CSC_FOR_PULL_REQUEST | Both | `true`, code signing for PR |
| CSC_KEY_PASSWORD | Both | Certificate password |
| CSC_LINK | Both | Code signing certificate |
| DEBUG | CircleCI | Set to `electron-builder` |
| CSC_KEY_PASSWORD | MacOS | Certificate password |
| CSC_LINK | MacOS | Code signing certificate |
| WIN_CSC_KEY_PASSWORD | Windows | Certificate password |
| WIN_CSC_LINK | Windows | Code signing certificate |
| DEBUG | MacOS | Set to `electron-builder` |
| GH_TOKEN | Both | For GitHub builds |
| PUBLISH_FOR_PULL_REQUEST | Both | `true`, build artefact for PR |
| ROLLBAR_POST_TOKEN | Both | Rollbar logging |
| FTP_AV_PASSWORD_TIDEPOOL | Appveyor | AV submission |
| FTP_AV_PASSWORD_TIDEPOOL | Windows | AV submission |

## Editor Configuration
**Atom**
Expand Down
49 changes: 0 additions & 49 deletions appveyor.yml

This file was deleted.

1 change: 1 addition & 0 deletions lib/core/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"operator-linebreak": "warn",
"no-else-return": "warn",
"object-curly-newline": "warn",
"linebreak-style": 0,
"implicit-arrow-linebreak": "warn"
},
"settings": {
Expand Down
15 changes: 13 additions & 2 deletions lib/core/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import builder from '../objectBuilder';
import dexcomDriver from '../drivers/dexcom/dexcomDriver';
import oneTouchUltraMini from '../drivers/onetouch/oneTouchUltraMini';
import abbottPrecisionXtra from '../drivers/abbott/abbottPrecisionXtra';
import tandemDriver from '../drivers/tandem/tandemDriver';
import insuletOmniPod from '../drivers/insulet/insuletDriver';
import oneTouchUltra2 from '../drivers/onetouch/oneTouchUltra2';
import oneTouchVerio from '../drivers/onetouch/oneTouchVerio';
Expand All @@ -63,6 +62,14 @@ const device = {
log: bows('Device'),
};

let tandemDriver;
try {
// eslint-disable-next-line global-require, import/no-unresolved
tandemDriver = require('../drivers/tandem/tandemDriver');
} catch (e) {
device.log('Tandem driver is only available to Tidepool developers.');
}

const hostMap = {
darwin: 'mac',
win32: 'win',
Expand Down Expand Up @@ -374,7 +381,11 @@ device.getDriverManifest = (driverId) => {

device.detectHelper = (driverId, options, cb) => {
const dm = device.createDriverManager(driverId, options);
dm.detect(driverId, cb);
if (dm == null) {
cb(new Error('Driver not available.'));
} else {
dm.detect(driverId, cb);
}
};

device.createDriverManager = (driverId, options) => {
Expand Down
8 changes: 7 additions & 1 deletion lib/driverManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ module.exports = function (driverObjects, configs) {
var noop = function() {};

for (var d in driverObjects) {
drivers[d] = driverObjects[d](configs[d]);
try {
drivers[d] = driverObjects[d](configs[d]);
} catch (e) {
debug('Driver not available.');
return null;
}

for (var i=0; i<required.length; ++i) {
if (typeof(drivers[d][required[i]]) != 'function') {
debug('!!!! Driver %s must implement %s', d, required[i]);
Expand Down
3 changes: 2 additions & 1 deletion lib/drivers/abbott/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"object-curly-newline": "warn",
"implicit-arrow-linebreak": "warn",
"no-param-reassign": "warn",
"no-restricted-syntax": "warn"
"no-restricted-syntax": "warn",
"linebreak-style": 0
},
"overrides": [
{
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/bayer/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"operator-linebreak": "warn",
"no-else-return": "warn",
"object-curly-newline": "warn",
"linebreak-style": 0,
"implicit-arrow-linebreak": "warn"
},
"overrides": [
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/dexcom/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"allowForLoopAfterthoughts": true
}],
"arrow-parens": "warn",
"linebreak-style": 0,
"operator-linebreak": "warn"
},
"settings": {
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/i-sens/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"rules": {
"max-len": "warn",
"consistent-return": "warn",
"linebreak-style": 0,
"no-plusplus": ["error", {
"allowForLoopAfterthoughts": true
}],
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/insulet/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"lines-between-class-members": "warn",
"function-paren-newline": "warn",
"comma-style": "warn",
"linebreak-style": 0,
"implicit-arrow-linebreak": "warn"
},
"settings": {
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/medtronic600/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"lines-between-class-members": "warn",
"function-paren-newline": "warn",
"comma-style": "warn",
"linebreak-style": 0,
"implicit-arrow-linebreak": "warn"
},
"settings": {
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/onetouch/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"max-classes-per-file": "warn",
"operator-linebreak": "warn",
"arrow-parens": "warn",
"linebreak-style": 0,
"object-curly-newline": "warn"
},
"overrides": [
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/roche/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"allowForLoopAfterthoughts": true
}],
"arrow-parens": "warn",
"linebreak-style": 0,
"operator-linebreak": "warn"
},
"settings": {
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/tandem
Submodule tandem added at e1dec0
Loading

0 comments on commit 6f755a5

Please sign in to comment.