Skip to content
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

fix fleet settings not being saved to node config #9259

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

yenda
Copy link
Contributor

@yenda yenda commented Oct 22, 2019

Summary

Change of fleet in settings was not persisted to the node config. This should fix it though I am not sure how to test that, @cammellos and @oskarth you could try the PR and see if it solves your issue.

status: ready

@yenda yenda requested review from cammellos and oskarth October 22, 2019 00:10
@yenda yenda requested a review from a team as a code owner October 22, 2019 00:10
@yenda yenda self-assigned this Oct 22, 2019
@auto-assign auto-assign bot removed the request for review from a team October 22, 2019 00:10
@ghost
Copy link

ghost commented Oct 22, 2019

Pull Request Checklist

  • Docs: Updated the documentation, if affected
  • Docs: Added or updated inline comments explaining intention of the code
  • Tests: Ensured that all new UI elements have been assigned accessibility IDs
  • Tests: Signaled need for E2E tests with label, if applicable
  • Tests: Briefly described what was tested and what platforms were used
  • UI: In case of UI changes, ensured that UI matches Figma
  • UI: In case of UI changes, requested review from a Core UI designer
  • UI: In case of UI changes, included screenshots of implementation

@status-im-auto
Copy link
Member

status-im-auto commented Oct 22, 2019

Jenkins Builds

Click to see older builds (12)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 6bd5cb6 #1 2019-10-22 00:21:20 ~10 min ios 📦ipa 📲
✔️ 6bd5cb6 #1 2019-10-22 00:22:32 ~11 min android 📦apk 📲
✔️ 6bd5cb6 #1 2019-10-22 00:24:23 ~13 min windows 📦exe
✔️ 6bd5cb6 #1 2019-10-22 00:25:50 ~15 min macos 📦dmg
✔️ 6bd5cb6 #1 2019-10-22 00:28:39 ~17 min android-e2e 📦apk 📲
✔️ 6bd5cb6 #1 2019-10-22 00:29:33 ~18 min linux 📦App
✔️ 1e60102 #2 2019-10-29 15:34:37 ~10 min ios 📦ipa 📲
✔️ 1e60102 #2 2019-10-29 15:35:21 ~11 min android 📦apk 📲
✔️ 1e60102 #2 2019-10-29 15:37:51 ~13 min windows 📦exe
✔️ 1e60102 #2 2019-10-29 15:39:50 ~15 min macos 📦dmg
✔️ 1e60102 #2 2019-10-29 15:40:18 ~16 min android-e2e 📦apk 📲
✔️ 1e60102 #2 2019-10-29 15:41:27 ~17 min linux 📦App
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 19f1374 #3 2019-11-01 11:05:59 ~11 min ios 📦ipa 📲
✔️ 19f1374 #3 2019-11-01 11:08:55 ~14 min macos 📦dmg
✔️ 19f1374 #3 2019-11-01 11:09:36 ~14 min windows 📦exe
✔️ 19f1374 #3 2019-11-01 11:10:43 ~16 min android 📦apk 📲
✔️ 19f1374 #3 2019-11-01 11:11:27 ~16 min linux 📦App
✔️ 3528dd8 #4 2019-11-01 11:08:07 ~11 min android-e2e 📦apk 📲

@oskarth
Copy link
Contributor

oskarth commented Oct 22, 2019

Thanks, Core should be owning this issue 100% as part of delivering v1. @adambabik even created this issue #9216 and core was pinged about it. It'd be good to have clarity and confidence that this will be dealt with from the Core team.

@oskarth oskarth requested review from andremedeiros and rasom and removed request for oskarth October 22, 2019 03:54
Comment on lines -16 to +18
(multiaccounts.update/update-settings new-settings
{})
(node/prepare-new-config {:on-success #(when (not= (node/get-log-level settings) (node/get-log-level new-settings))
(multiaccounts.update/update-settings new-settings {})
(node/prepare-new-config {:on-success #(when (not= (node/get-log-level settings)
(node/get-log-level new-settings))
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any changes at all? Is it just code formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just formatted to be the same layout as in fleet.core and more readable

Comment on lines +77 to +94
(def default-fleets (slurp "resources/config/fleets.json"))

(defn fleets [{:keys [custom-fleets]}]
(as-> [(default-fleets)] $
(mapv #(:fleets (types/json->clj %)) $)
(conj $ custom-fleets)
(reduce merge $)))

(defn current-fleet-key [db]
(keyword (get-in db [:multiaccount :settings :fleet]
config/fleet)))

(defn get-current-fleet
[db]
(get (fleets db)
(current-fleet-key db)))

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to move this code form fleet.core to node.core?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fleet.core is mostly about saving a new fleet config and to do that you need to call node.core. So if get-current-fleet is in fleet.core as well you get a circular dependency. I suppose we could make a fleet.db ns otherwsie. Right now it's similar to log-level.core and get-log-level is in node.core too.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would go for that fleet.something ns, then we actually don't need to make changes in other namespaces except fleet.core and node.core.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok but shouldn't I change log-level namespace as well for consistency then? Also it will still change other namespaces, but just the ns imported.

Copy link
Contributor

Choose a reason for hiding this comment

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

We def can do it without changes in other namespaces, the call can go through fleet.core, not a big deal though.

Regarding log-level, it's not objective of this PR so I wouldn't do this here. Actually if everyone is fine with putting that fleet related code into node.core no problem. But it's a bit puzzling then what are fleet.core and node.core responsible for.


(defn fleets [{:keys [custom-fleets]}]
(as-> [(default-fleets)] $
(mapv #(:fleets (types/json->clj %)) $)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we not rather do the conversion in the def above?

@yenda yenda force-pushed the fix/save-fleet-to-node-config branch from 6bd5cb6 to 1e60102 Compare October 29, 2019 15:23
@cammellos
Copy link
Contributor

@yenda is this good to go?

@yenda yenda force-pushed the fix/save-fleet-to-node-config branch from 1e60102 to 19f1374 Compare November 1, 2019 10:54
@yenda yenda force-pushed the fix/save-fleet-to-node-config branch from 19f1374 to 3528dd8 Compare November 1, 2019 10:56
@yenda yenda merged commit 3528dd8 into develop Nov 1, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/save-fleet-to-node-config branch November 1, 2019 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants