beat.web issueshttps://gitlab.idiap.ch/beat/beat.web/-/issues2022-03-04T09:39:15Zhttps://gitlab.idiap.ch/beat/beat.web/-/issues/577Cleanup yearly supervision command2022-03-04T09:39:15ZFlavio TARSETTICleanup yearly supervision commandThe yearly supervison command needs a rewrite to improve clarityThe yearly supervison command needs a rewrite to improve clarityCode cleanuphttps://gitlab.idiap.ch/beat/beat.web/-/issues/567Dead code removal2020-09-28T09:20:24ZSamuel GAISTDead code removalSome code in this repository is no longer used.
For example scripts/scheduler.py. It has been replaced with Django management commands to take advantage of the ZMQ communication system.
Therefore, everything that is unused should be re...Some code in this repository is no longer used.
For example scripts/scheduler.py. It has been replaced with Django management commands to take advantage of the ZMQ communication system.
Therefore, everything that is unused should be removed.Code cleanuphttps://gitlab.idiap.ch/beat/beat.web/-/issues/563Code deduplication2020-09-09T09:41:33ZSamuel GAISTCode deduplicationThere are several places in beat/beat.web> where there is code duplication.
For example all interactive management commands follow the same structure and re-implement the `get_input_data`. This is typically a case where there should be ...There are several places in beat/beat.web> where there is code duplication.
For example all interactive management commands follow the same structure and re-implement the `get_input_data`. This is typically a case where there should be a base class for that.
This would have avoided a mix of raw_input and input usage because of Python 2 VS Python 3 implementations.Code cleanuphttps://gitlab.idiap.ch/beat/beat.web/-/issues/464Chrome headless for more stable & CI-supported E2E testing2017-08-06T16:44:50ZJaden DIEFENBAUGHChrome headless for more stable & CI-supported E2E testingE2E testing currently uses a locally-installed browser and cannot be ran on a headless CI. Using a locally-installed browser is:
1. annoying
2. resource-intensive
3. not feasible on CI
Chrome has recently started to support running the ...E2E testing currently uses a locally-installed browser and cannot be ran on a headless CI. Using a locally-installed browser is:
1. annoying
2. resource-intensive
3. not feasible on CI
Chrome has recently started to support running the browser headlessly, which will fix these issues. However, it's not very well supported yet (still Alpha~Beta stage). This is a tracking issue for widespread support.
See:
- https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
- https://www.chromestatus.com/feature/5678767817097216https://gitlab.idiap.ch/beat/beat.web/-/issues/458Refactor server communication & request state handling to be DRY2017-08-06T16:44:51ZJaden DIEFENBAUGHRefactor server communication & request state handling to be DRYThere are at least several hundred different AJAX code blocks in the JS. Sometimes, Angular Factories help abstract the actual AJAX handling (see: report app). Sometimes, every request is handwritten (see: experiments app). Many requests...There are at least several hundred different AJAX code blocks in the JS. Sometimes, Angular Factories help abstract the actual AJAX handling (see: report app). Sometimes, every request is handwritten (see: experiments app). Many requests need to be set up beforehand. One common setting is sending the CSRF token:
```js
$.ajaxSetup({
beforeSend: function(xhr, settings) {
var csrftoken = $.cookie('csrftoken');
xhr.setRequestHeader('X-CSRFToken', csrftoken);
}
});
```
Requests may also handle certain error codes:
```js
$.ajax({
//....
statusCode: {
404: function(data, status, message) {
container.textContent = message + ' (' + data.status + ')';
$(container).addClass('error');
$(container).removeClass('progress');
},
500: function(data, status, message) {
container.textContent = message + ' (' + data.status + ')';
$(container).addClass('error');
$(container).removeClass('progress');
},
}
//....
```
Since many requests most likely have similar settings/error handling, refactoring the actual requesting functionality (into it's own Angular Service) would make requests more consistent and DRY. It would also help separate the actual AJAX from the handling of a successful request.https://gitlab.idiap.ch/beat/beat.web/-/issues/457Refactor heavy manual DOM manipulation into directives/templates/controllers2017-08-06T16:44:51ZJaden DIEFENBAUGHRefactor heavy manual DOM manipulation into directives/templates/controllersMany apps have JS files that generate & manage complex DOM elements (such as popups/dialogs, settings, and button handling) that aren't plugged in to the Angular system. For example, all of the [Experiments app's JS files](https://gitlab...Many apps have JS files that generate & manage complex DOM elements (such as popups/dialogs, settings, and button handling) that aren't plugged in to the Angular system. For example, all of the [Experiments app's JS files](https://gitlab.idiap.ch/beat/beat.web/tree/master/beat/web/experiments/static/experiments/js) manipulate the DOM.
A few issues that suggest we refactor this:
- No separation between the HTML & JS
- No separation between background processing/AJAX & DOM manipulation
- No clear patterns for extending/changing/reusing these DOM manipulations (no modularity)
- Very little comments/documentation
Angular Directives [were designed to manage these heavy DOM manipulations](https://code.angularjs.org/1.4.5/docs/guide/directive).https://gitlab.idiap.ch/beat/beat.web/-/issues/456Refactor globals/"namespaces" in JS to Angular entities2017-08-06T16:44:51ZJaden DIEFENBAUGHRefactor globals/"namespaces" in JS to Angular entitiesFor reasons why global variables are bad, people commonly reference the ["GlobalVariablesAreBad" article](http://wiki.c2.com/?GlobalVariablesAreBad). Additionally, Angular already provides solutions to homebrew namespaces, so they don't ...For reasons why global variables are bad, people commonly reference the ["GlobalVariablesAreBad" article](http://wiki.c2.com/?GlobalVariablesAreBad). Additionally, Angular already provides solutions to homebrew namespaces, so they don't have to be used.
I was going to add example files, but it's so widespread, just look in any of the JS for the experiments/toolchains/etc. apps. A common manifestation of the globals:
```js
// Declaration of our namespaces
if (beat === undefined)
var beat = {}
if (beat.toolchains === undefined)
beat.toolchains = {}
if (beat.toolchains.dialogs === undefined)
beat.toolchains.dialogs = {}
```
And later in the file, fields are assigned to these globals.
A better approach may be to instead use Angular [Services](https://code.angularjs.org/1.4.5/docs/guide/services) which support DI (dependency injection) and are designed to support heavy processing/data functionality.https://gitlab.idiap.ch/beat/beat.web/-/issues/455Documentation/comments of the frontend2017-08-06T16:44:51ZJaden DIEFENBAUGHDocumentation/comments of the frontendThere is basically no documentation (either in-line or in separate documents) of the nearly **20,000LOC** of JS.
This leads to developers having to go as far as reverse-engineering the application whenever they are not familiar with a c...There is basically no documentation (either in-line or in separate documents) of the nearly **20,000LOC** of JS.
This leads to developers having to go as far as reverse-engineering the application whenever they are not familiar with a certain piece of functionality, which increases the overhead of starting work on new code and slows onboarding new developers.https://gitlab.idiap.ch/beat/beat.web/-/issues/453Migrate from deprecated `replace: true` in directives2017-08-06T16:44:51ZJaden DIEFENBAUGHMigrate from deprecated `replace: true` in directivesAs of [Angular 1.3.0](https://code.angularjs.org/1.3.0/docs/api/ng/service/$compile) the `replace` attribute in directive definitions is deprecated. We are using it in at least the directives `tableDynamic` & `myReportInfo` in the report...As of [Angular 1.3.0](https://code.angularjs.org/1.3.0/docs/api/ng/service/$compile) the `replace` attribute in directive definitions is deprecated. We are using it in at least the directives `tableDynamic` & `myReportInfo` in the reports app.https://gitlab.idiap.ch/beat/beat.web/-/issues/452Migrate from deprecated `$http .success` & `$http .error` to `$http .then`2017-08-06T16:44:51ZJaden DIEFENBAUGHMigrate from deprecated `$http .success` & `$http .error` to `$http .then`While it's officially deprecated in [v1.5.0](https://code.angularjs.org/1.5.0/docs/api/ng/service/$http#deprecation-notice), the alternative is already implemented in v1.4.5.
`.success` & `.error` don't allow chaining as normal Promise ...While it's officially deprecated in [v1.5.0](https://code.angularjs.org/1.5.0/docs/api/ng/service/$http#deprecation-notice), the alternative is already implemented in v1.4.5.
`.success` & `.error` don't allow chaining as normal Promise handling (`.then`) do.https://gitlab.idiap.ch/beat/beat.web/-/issues/451More descriptive names for Angular entities2017-08-06T16:44:51ZJaden DIEFENBAUGHMore descriptive names for Angular entitiesA couple targets off the top of my head (more to be added):
- [ ] [`theColumn` directive](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/static/reports/app/directives/reportItemView.j...A couple targets off the top of my head (more to be added):
- [ ] [`theColumn` directive](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/static/reports/app/directives/reportItemView.js#L1117)
- [ ] [`item` directive](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/static/reports/app/directives/reportItemView.js#L1072)https://gitlab.idiap.ch/beat/beat.web/-/issues/450Refactor to not climb `$parent` in Angular2017-08-06T16:44:51ZJaden DIEFENBAUGHRefactor to not climb `$parent` in AngularControllers in Angular should not be depending on an exact parent hierarchy. If the child controller needs information from a parent scope, it should at the very least be passed down to the child explicitly (or better yet, refactored int...Controllers in Angular should not be depending on an exact parent hierarchy. If the child controller needs information from a parent scope, it should at the very least be passed down to the child explicitly (or better yet, refactored into a Service). Climbing `$parent` makes the app's parts too coupled and kills modularity. For example, [the `theColumn` directive in the reports app](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/static/reports/app/directives/reportItemView.js#L1127-1132):
```js
var the_parent = $scope.$parent.$parent.$parent.$parent;
var report_experiments = $scope.$parent.$parent.$parent.$parent.report_experiments;
var report_experiments_alias = $scope.$parent.$parent.$parent.$parent.report_experiments_alias;
var floating_point_precision = $scope.$parent.$parent.$parent.$parent.floating_point_precision;
var report = $scope.$parent.$parent.$parent.report;
var experiment_name = $scope.$parent.item;
```
There's more than this (just search for `$parent`)https://gitlab.idiap.ch/beat/beat.web/-/issues/449Separate frontend apps from backend API2017-08-06T16:44:51ZJaden DIEFENBAUGHSeparate frontend apps from backend APIIdeally, the code that runs in the browser (HTML/CSS/JS) isn't even in the same repository as the server API (Python). For example, the reports app is currently a continuum of Angular & Django, making it hard to test and refactor. Separa...Ideally, the code that runs in the browser (HTML/CSS/JS) isn't even in the same repository as the server API (Python). For example, the reports app is currently a continuum of Angular & Django, making it hard to test and refactor. Separating the two by *not using Django templating* but instead just using Django to serve the files would be a step in the right direction.https://gitlab.idiap.ch/beat/beat.web/-/issues/447add frontend regression tests2017-09-25T15:13:52ZJaden DIEFENBAUGHadd frontend regression tests99.99999999% of the frontend isn't tested right now. Adding regression tests (tests designed to be able to catch regressions/bugs in changes after the tests are added) would help with confidence in releasing new code.99.99999999% of the frontend isn't tested right now. Adding regression tests (tests designed to be able to catch regressions/bugs in changes after the tests are added) would help with confidence in releasing new code.https://gitlab.idiap.ch/beat/beat.web/-/issues/446Split up huge (>1000LOC) javascript files2019-07-04T08:37:00ZJaden DIEFENBAUGHSplit up huge (>1000LOC) javascript filesSome JS files over >2000LOC that are checked in:
- [ ] `beat/web/toolchains/static/toolchains/js/editor.js`
- [ ] `beat/web/experiments/static/experiments/js/panels.js`
- [ ] `beat/web/toolchains/static/toolchains/js/models.js`
- [...Some JS files over >2000LOC that are checked in:
- [ ] `beat/web/toolchains/static/toolchains/js/editor.js`
- [ ] `beat/web/experiments/static/experiments/js/panels.js`
- [ ] `beat/web/toolchains/static/toolchains/js/models.js`
- [ ] `beat/web/experiments/static/experiments/js/utils.js`
- [ ] `beat/web/algorithms/static/algorithms/js/editor.js`
- [ ] `beat/web/search/static/search/js/controls.js`
- [ ] `beat/web/toolchains/static/toolchains/js/common.js`
- [ ] `beat/web/toolchains/static/toolchains/js/viewer.js`
- [ ] `beat/web/experiments/static/experiments/js/dialogs.js`https://gitlab.idiap.ch/beat/beat.web/-/issues/445removed hardcoded unused URL parameter2019-07-04T08:37:00ZJaden DIEFENBAUGHremoved hardcoded unused URL parameterIn the [utils file](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/experiments/static/experiments/js/utils.js#L1825), a request is sent to the server to fetch the list of reports the user may...In the [utils file](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/experiments/static/experiments/js/utils.js#L1825), a request is sent to the server to fetch the list of reports the user may add selected experiments to. The URL includes a `fields` parameter that is [completely ignored on the API side](https://gitlab.idiap.ch/beat/beat.web/blob/67ca8af8e123d03debc1d6b89cf4b0751ddbb4b5/beat/web/reports/api.py#L100-109). Other URLs (in that utils file) might have unused parameters as well (?). Removing these unused parameters would make the functionality much more clear.