8000 Bug fix/curb aardvark foxx cthulhu by pluma · Pull Request #9867 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Bug fix/curb aardvark foxx cthulhu #9867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

pluma
Copy link
Contributor
@pluma pluma commented Aug 30, 2019

This is an attempt to fix the underlying issue in #9719.

@pluma pluma added the 3 UI ArangoDB Web Interface (frontend/Aardvark) label Aug 30, 2019
@pluma pluma requested a review from hkernbach August 30, 2019 14:37
@pluma pluma self-assigned this Aug 30, 2019
Flag to run setup after install.
`)
.queryParam('teardown', joi.boolean().default(false), dd`
Flag to run teardown before replace/upgrade.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These apparently weren't actually implemented in aardvark before.

< 10000 div data-view-component="true" class="TimelineItem py-0 pl-4">
}
const $replace = $('#new-app-flag-replace')[0];
if ($replace) {
flags.replace = Boolean($replace.checked);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DOM APIs have been stable for years, this even works in IE now.


if ($('#new-app-replace').prop('checked')) {
flag = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously the flag was apparently some kind of weird enum. We're now using an object with actual boolean flags.

tableContent.push(
window.modalView.createCheckboxEntry(
'new-app-teardown',
'new-app-flag-setup',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems cleaner to prefix these consistently with "-flag"

'Run setup?',
true,
"Should this app's setup script be executed after installing the app?",
"Should this service's setup script be executed after installing the service?",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just for consistency. We renamed "applications" to "services" in 3.0.

'new-app-flag-teardown',
'Run teardown?',
true,
"Should the existing service's teardown script be executed before replacing the service?",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We didn't actually ask about the teardown when replacing an app. This used to be implied by the replace/upgrade flag.

installFromGithub: function (info, mount, callback, isLegacy, flag) {
var url = arangoHelper.databaseUrl('/_admin/aardvark/foxxes/git?mount=' + encodeURIComponent(mount));
if (isLegacy) {
install: function (mode, info, mount, options, callback) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These methods all did the same thing except using slightly different URLs. We now pass the bit in the URL that changes in the arguments as "mode".

if (options.replace === true) {
url += '&replace=true';
} else if (options.replace === false) {
url += '&upgrade=true';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This previously used to be the magic enum flag.

} else {
mount = window.arangoHelper.escapeHtml($('#new-app-mount').val());
if (mount.charAt(0) !== '/') {
mount = '/' + mount;
}
}
if (flag !== undefined) {
this.collection.installFromStore({name: this.toInstall, version: this.version}, mount, this.installCallback.bind(this), flag);
} else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two are the same except once without the argument if it's undefined. That's silly because the function doesn't check the argument count and undefined is undefined.

if (version === '') {
version = 'master';
}
var info = {
url: window.arangoHelper.escapeHtml($('#repository').val()),
version: window.arangoHelper.escapeHtml($('#tag').val())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is literally the same code as a few lines earlier except it ignores the default for "master". This is likely a bug.

this.collection.installFromZip(window.foxxData.data.filename, mount, this.installCallback.bind(this), isLegacy, flag);

info = {
zipFile: window.foxxData.data.filename
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wrapping previously happened in installFromZip.

8000
} else {
mount = window.arangoHelper.escapeHtml($('#new-app-mount').val());
if (mount.charAt(0) !== '/') {
mount = '/' + mount;
}
}
url = window.arangoHelper.escapeHtml($('#repository').val());
var info = {
url: url,
version: 'master'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version attribute does nothing.

@pluma
Copy link
Contributor Author
pluma commented Aug 30, 2019

These are all untested and I haven't built the frontend yet to check if they actually work.

@hkernbach This PR is based on your PR so merging will merge it into your PR, not devel.

@hkernbach hkernbach merged commit 4751a06 into bug-fix/replace-foxx-app-ui Aug 30, 2019
@hkernbach hkernbach deleted the bug-fix/curb-aardvark-foxx-cthulhu branch August 30, 2019 15:03
hkernbach pushed a commit that referenced this pull request Sep 2, 2019
* Revert "fixed ui behaviour when replacing a foxx app"

This reverts commit 6092465.

* Cleanup on aisle 3

* Typo

* Fixed param order

* Cleanup flags

* Actually use the queryParams
hkernbach pushed a commit that referenced this pull request Sep 2, 2019
* Revert "fixed ui behaviour when replacing a foxx app"

This reverts commit 6092465.

* Cleanup on aisle 3

* Typo

* Fixed param order

* Cleanup flags

* Actually use the queryParams
KVS85 pushed a commit that referenced this pull request Sep 16, 2019
* fixed ui behaviour when replacing a foxx app

* Bug fix/curb aardvark foxx cthulhu (#9867)

* Revert "fixed ui behaviour when replacing a foxx app"

This reverts commit 6092465.

* Cleanup on aisle 3

* Typo

* Fixed param order

* Cleanup flags

* Actually use the queryParams

* currently not supported via grunt env

* changelog

* removed not needed view

* fixed wrong used function
KVS85 pushed a commit that referenced this pull request Sep 20, 2019
* release version 3.4.8

* [3.4] fix agency lockup when removing 404-ed callbacks (#9839)

* fixed ui behaviour when replacing a foxx app

* Bug fix/curb aardvark foxx cthulhu (#9867)

* Revert "fixed ui behaviour when replacing a foxx app"

This reverts commit 6092465.

* Cleanup on aisle 3

* Typo

* Fixed param order

* Cleanup flags

* Actually use the queryParams

* currently not supported via grunt env

* changelog

* removed not needed view

* fixed wrong used function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 UI ArangoDB Web Interface (frontend/Aardvark)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0