Validation is always enabled, press the "skip" button to skip it.
Changelog-entry: Remove "Validate write on success" setting. Validation is always enabled, press the "skip" button to skip it.
Change-type: patch
Change-type: patch
Changelog-entry: Rework system & large drives handling logic
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
Change-type: patch
Changelog-entry: Reject drives with null size (fixes pretty-bytes error)
Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzoa@balena.io>
We add some preparatory changes including new utility functions, as well
as changes throughout the codebase that reflect the change from single
drives to a list of drives, given multi-writes is coming.
Change-Type: patch
Changelog-Entry: Various preparatory changes to account for
multi-writes.
Implement writing to multiple destinations simultaneously
Change-Type: minor
Changelog-Entry: Implement writing to multiple destinations simultaneously
We add colorised progress status dots with quantities of `flashing`,
`validating`, `succeeded`, and `failed` devices.
Change-Type: patch
Changelog-Entry: Add colorised multi-writes progress status dots.
* feat(GUI): add app to gui folder structure
We add a `lib/gui/app/` folder to help transition to Webpack usage.
Change-Type: patch
Changelog-Entry: Add `lib/gui/app` folder to ease into Webpack usage.
feat: test that ipc verbosity is off
We test that `ipc.config.silent` is set to `true` so that it doesn't
spam `stdout` for users.
Changelog-Entry: Test that IPC verbosity is off
Change-Type: patch
* feat(GUI): remove angular from image-writer
We remove Angular from the `image-writer` module by using Redux store
updates, subscribing to them while flashing.
Changelog-Entry: Remove Angular dependency from image-writer.
Change-Type: minor
This implements an SDK.Scanner which handles any given
adapters and manages the scans. This change enables continuous
scanning without the need to `.scan()` scheduling in other places.
Change-Type: minor
* refactor(SDK): make adaptor scan functions event based
This change will allow us to start emitting progress events out of the
adaptors scan functions.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
* refactor(sdk): Make adapters event emitters
This commit introduces a boolean `disabled` property rather than a
`pending` flag. Making this distinction clearer means that we can now
treat pending drives in different ways needed to improve the usbboot
experience.
Also, for usbboot, this commit removes the "pending" badge and uses a
more descriptive drive description instead.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This is a major first step towards adopting an SDK architecture. This
commit creates an SDK adaptor with a `.scan()` function that uses
`drivelist` under the hood. Then, an SDK orchestrator is used to provide
drive scanning capabilities to the GUI.
Here's a list of some particularly interesting changes:
- The drives returned by the SDK adaptor now have a "pending" and an
"adaptor" property. The "pending" property is a boolean flag that
determines if the drive is ready to be used (this will come handy for
usbboot), while the "adaptor" property simply contains the name of the
adaptor that drive came from
- The GUI drive scanner Rx implementation was replaces with a "promise
loop." Before, the drive scanning routine would be called every 2
seconds (without waiting for the previous scan to complete), while
now, the next scan happens *after* the previous scan completes. For
this reason, I reduced the drive scanning interval timeout to match
the timing we had before
Change-Type: patch
See: https://github.com/resin-io/etcher/pull/1686
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
- Extend the `standard` ESLint configuration
- Remove ESLint rules that are defined in the `standard` configuration
- Get rid of semi-colons
See: https://github.com/resin-io/etcher/pull/1657
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
This commit changes the whole codebase to adhere to all StandardJS
guidelines rules except semicolons, since the removal of semicolons
affect pretty much all lines, and the final diff is very hard to follow
(and to assess other more involved changes).
In a nutshell:
- When using `function`, we now require a space before the opening
parenthesis
- If a line with operators is broken into multiple lines, the operator
should now go after the line break
- Unnecessary padding lines are now forbidden
There were also some minor things that the `standard` CLI caught that I
updated here.
See: https://standardjs.com
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
The `flashComplete` message takes the drive object and the image
basename as arguments. This was updated on the GUI, but causes the CLI
to throw an error upon completion.
Change-Type: patch
Changelog-Entry: Fix "imageBasename is not defined" error on the CLI.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Now that the Redux store is no longer front-end dependent, we can move
most of the models to lib/shared. Currently, lib/shared is a mess, and
contains all sorts of functionality, however moving things out of the
GUI is the first step. Once we have everything decoupled, we can
organise all the code we have there.
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
We remove the usage of Angular from 'FlashStateModel' and its usage
throughout the project comes under the new 'flashState' moniker.
Depends: https://github.com/resin-io/etcher/pull/1261
The current error handling logic is a mess. We have code that tries to
fetch information about errors in different places throughout the
application, and its incredibly hard to ensure certain types of error
get decent human friendly error messages.
This commit groups, improves, and tests all error related functions in
`lib/shared/errors.js`.
Here's a summary of the changes, in more detail:
- Move the `HUMAN_FRIENDLY` object to `shared/errors.js`
- Extend `HUMAN_FRIENDLY` with error descriptions
- Add `ENOMEM` to `shared/errors.js`
- Group CLI and `OSDialogService` mechanisms for getting an error title
and an error description
- Move error serialisation routines from `robot` to `shared/errors.js`
- Create and use `createError()` and `createUserError()` utility
functions
- Add user friendly descriptions to many errors
- Don't report user errors to TrackJS
Fixes: https://github.com/resin-io/etcher/issues/1098
Change-Type: minor
Changelog-Entry: Make errors more user friendly throughout the application.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
These errors happen when the user selects an archive that contains no
image, or multiple images, and represents a user error, rather than an
unhandled exception.
For this reason, we should not report this to TrackJS.
This means, however, that we need a reliable way to know whether an
error should be reporter or not. This commit implements
`AnalyticsService.shouldReportError()` for this purpose, which will
check an optional `report` property of the error object.
In order to ensure that errors that we don't control are reported, the
function will return `true` if the error object doesn't have that
property.
Change-Type: patch
Changelog-Entry: Don't report "invalid archive" errors to TrackJS.
Fixes: https://github.com/resin-io/etcher/issues/1103
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
Angular 1.5 has a bug that causes angular's `$exceptionHandler`
to be called for rejected `$q` promises even if they have
a rejection handler. This bug caused duplicate error messages
in Etcher.
A consequence of upgrading to Angular 1.6 is that `$q` promises
without a rejection handler will throw `Possibly unhandled rejection`
errors. To avoid these errors, this commit moves code responsible
for opening a tooltip from the template to the controller and handles
the rejection.
Other packages upgraded:
- angular-moment to v1.0.1
- angular-ui-router to v0.4.2
- angular-mocks to v1.6.1
Change-type: patch
Changelog-Entry: Fix duplicate error messages
Fixes: https://github.com/resin-io/etcher/issues/1082
See: https://github.com/angular/angular.js/issues/7992
See: https://github.com/angular/angular.js/pull/13662
If a drive contains multiple partitions that Windows recognises and
mounts, then `drivelist` will incorrectly display separate drive objects
for each partition, causing `ngRepeat` to complain in the drive selector
component.
The issue was fixed by grouping the mountpoints of all recognised
partitions in a single drive object, as we do with the other supported
operating systems.
After the fix, `drivelist` also removed its `name` property (since its
now always equal to `device`), so some extra logic to compute an
appropriate display name for the drive has been introduced to
`DriveScannerService`.
Fixes: https://github.com/resin-io/etcher/issues/720
See: https://github.com/resin-io-modules/drivelist/pull/100
Change-Type: patch
Changelog-Entry: Fix duplicate drives in Windows.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This new version stops sending a `passedValidation` boolean property
upon completion and still throws an `EVALIDATION` error when validation
fails.
Such small chance allows us to get rid of lot of complexity related to
handling the `passedValidation` value in the application state.
Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>