Skip to content

Commit b09ea42

Browse files
committed
Merge branch 'release/5.2.0' into merge-5.2.0-into-main
2 parents badbc5c + 2990f5a commit b09ea42

22 files changed

+580
-354
lines changed

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
11
# Changelog
22

3+
## 5.2.0
4+
5+
### Features
6+
7+
- Added custom dimension to track legacy and hardware wallets ([PR 3091](https://github.com/input-output-hk/daedalus/pull/3091))
8+
- Implemented CPU name grouping mechanism for analytics ([PR 3089](https://github.com/input-output-hk/daedalus/pull/3089))
9+
- Implemented rounding RAM size in analytics ([PR 3088](https://github.com/input-output-hk/daedalus/pull/3088))
10+
11+
### Chores
12+
13+
- Update `cardano-node` to 1.35.4 for the Preview network respin ([PR 3082](https://github.com/input-output-hk/daedalus/pull/3082))
14+
- Updated new Catalyst API URL ([PR 3087](https://github.com/input-output-hk/daedalus/pull/3087))
15+
- Fixed Storybook state for General stories ([PR 3064](https://github.com/input-output-hk/daedalus/pull/3064))
16+
317
## 5.1.1
418

519
### Chores
620

7-
- Increase minimum free space required from 2gb to 4gb ([PR 3071](https://github.com/input-output-hk/daedalus/pull/3071))
21+
- Increased minimum free space required from 2gb to 4gb ([PR 3071](https://github.com/input-output-hk/daedalus/pull/3071))
822
- Fixed Language components in Storybook to have it's own mocked store ([PR 3063](https://github.com/input-output-hk/daedalus/pull/3063))
923
- Updated `cardano-node` configs for Preprod respin ([PR 3070](https://github.com/input-output-hk/daedalus/pull/3070))
1024
- Fixed the properties and providers for the Send stories ([PR 3047](https://github.com/input-output-hk/daedalus/pull/3047))

flake.lock

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
description = "Cicero jobs populating https://cache.iog.io – this cannot yet build Daedalus";
33
inputs = {
4+
nixpkgs.follows = "tullia/nixpkgs";
45
tullia.url = "github:input-output-hk/tullia";
56
};
67
outputs = inputs: {
7-
hydraJobs = {
8+
hydraJobs = rec {
89

910
# --- Linux ----------------------------------------------------
1011
x86_64-linux.x86_64-linux = let
@@ -46,12 +47,23 @@
4647
};
4748
# --------------------------------------------------------------
4849

50+
# --- What CI should build -------------------------------------
51+
x86_64-linux.required = inputs.nixpkgs.legacyPackages.x86_64-linux.releaseTools.aggregate {
52+
name = "required for CI";
53+
constituents = __attrValues x86_64-linux.x86_64-linux ++ __attrValues x86_64-linux.x86_64-windows;
54+
};
55+
x86_64-darwin.required = inputs.nixpkgs.legacyPackages.x86_64-darwin.releaseTools.aggregate {
56+
name = "required for CI";
57+
constituents = __attrValues x86_64-darwin.x86_64-darwin;
58+
};
59+
# --------------------------------------------------------------
60+
4961
};
5062
}
5163
// (let
52-
x86_64-linux = inputs.tullia.fromSimple "x86_64-linux" (import ./nix/tullia.nix inputs.self "x86_64-linux");
53-
x86_64-darwin = inputs.tullia.fromSimple "x86_64-darwin" (import ./nix/tullia.nix inputs.self "x86_64-darwin");
54-
fakeEvent = { inputs={"GitHub event".value = {github_body.head_commit.id="0000000";};}; id=""; ociRegistry=""; };
64+
x86_64-linux = inputs.tullia.fromSimple "x86_64-linux" (import ./nix/tullia.nix);
65+
x86_64-darwin = inputs.tullia.fromSimple "x86_64-darwin" (import ./nix/tullia.nix);
66+
fakeEvent = { inputs."GitHub event" = {id = ""; created_at = ""; value = {github_body.head_commit.id="0000000";};}; id=""; ociRegistry=""; };
5567
in {
5668
tullia.x86_64-linux = x86_64-linux.tullia;
5769
cicero.x86_64-linux = x86_64-linux.cicero;

nix/sources.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"cardano-node": {
3-
"branch": "tags/1.35.3",
3+
"branch": "tags/1.35.4",
44
"description": null,
55
"homepage": null,
66
"owner": "input-output-hk",
77
"repo": "cardano-node",
8-
"rev": "950c4e222086fed5ca53564e642434ce9307b0b9",
9-
"sha256": "020fwimsm24yblr1fmnwx240wj8r3x715p89cpjgnnd8axwf32p0",
8+
"rev": "ebc7be471b30e5931b35f9bbc236d21c375b91bb",
9+
"sha256": "1j01m2cp2vdcl26zx9xmipr551v3b2rz9kfn9ik8byfwj1z7652r",
1010
"type": "tarball",
11-
"url": "https://github.com/input-output-hk/cardano-node/archive/950c4e222086fed5ca53564e642434ce9307b0b9.tar.gz",
11+
"url": "https://github.com/input-output-hk/cardano-node/archive/ebc7be471b30e5931b35f9bbc236d21c375b91bb.tar.gz",
1212
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
1313
},
1414
"cardano-shell": {
@@ -24,15 +24,15 @@
2424
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
2525
},
2626
"cardano-wallet": {
27-
"branch": "v2022-10-06",
27+
"branch": "v2022-12-14",
2828
"description": "Official Wallet Backend & API for Cardano decentralized",
2929
"homepage": null,
3030
"owner": "input-output-hk",
3131
"repo": "cardano-wallet",
32-
"rev": "2130fe0acf19fa218cef8de4ef325ae9078e356e",
33-
"sha256": "0d0wk6n7vij4qkp2qml5qdghk41dvm1078ps48673waf4cxjxaz0",
32+
"rev": "bbf11d4feefd5b770fb36717ec5c4c5c112aca87",
33+
"sha256": "1gvxmyclarklajifbyi2l8zwc1gqhbdps73rl9if9a3mpn5xngcp",
3434
"type": "tarball",
35-
"url": "https://github.com/input-output-hk/cardano-wallet/archive/2130fe0acf19fa218cef8de4ef325ae9078e356e.tar.gz",
35+
"url": "https://github.com/input-output-hk/cardano-wallet/archive/bbf11d4feefd5b770fb36717ec5c4c5c112aca87.tar.gz",
3636
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
3737
},
3838
"cardano-world": {
@@ -41,10 +41,10 @@
4141
"homepage": null,
4242
"owner": "input-output-hk",
4343
"repo": "cardano-world",
44-
"rev": "7561fe35ee8c532f2666f0627d49ea6e107e0e3f",
45-
"sha256": "1sxf611cnqlwc3sz10nnxjip2w9j7ii9n42zby90j409sx40mg7g",
44+
"rev": "a0a315100ee320395be97fcc83f46678d5a7fb6e",
45+
"sha256": "08scj58jixs15sjidhjfw93y3vyqp3vmbjmlrc4hpp5q5xwri3k6",
4646
"type": "tarball",
47-
"url": "https://github.com/input-output-hk/cardano-world/archive/7561fe35ee8c532f2666f0627d49ea6e107e0e3f.tar.gz",
47+
"url": "https://github.com/input-output-hk/cardano-world/archive/a0a315100ee320395be97fcc83f46678d5a7fb6e.tar.gz",
4848
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
4949
},
5050
"flake-compat": {

nix/tullia.nix

Lines changed: 38 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,48 @@
1-
self: system:
2-
31
let
4-
inherit (self.inputs.tullia.inputs.nixpkgs) lib;
5-
62
ciInputName = "GitHub event";
3+
repository = "input-output-hk/daedalus";
74
in
85
rec {
9-
tasks =
10-
let
11-
inherit (self.inputs.tullia) flakeOutputTasks taskSequence;
12-
13-
common =
14-
{ config
15-
, ...
16-
}: {
17-
preset = {
18-
# needed on top-level task to set runtime options
19-
nix.enable = true;
20-
21-
github-ci = {
22-
# Tullia tasks can run locally or on Cicero.
23-
# When no facts are present we know that we are running locally and vice versa.
24-
# When running locally, the current directory is already bind-mounted
25-
# into the container, so we don't need to fetch the source from GitHub
26-
# and we don't want to report a GitHub status.
27-
enable = config.actionRun.facts != { };
28-
repo = "input-output-hk/daedalus";
29-
sha = config.preset.github-ci.lib.getRevision ciInputName null;
30-
};
31-
};
32-
};
33-
34-
ciTasks = __mapAttrs
35-
(_: flakeOutputTask: { ... }: {
36-
imports = [ common flakeOutputTask ];
37-
38-
memory = 1024 * 8;
39-
nomad.resources.cpu = 10000;
40-
})
41-
(flakeOutputTasks [ "hydraJobs" system ] self);
42-
43-
ciTasksSeq = taskSequence "ci/" ciTasks (__attrNames ciTasks);
44-
in
45-
ciTasks // # for running tasks separately
46-
ciTasksSeq // # for running in an arbitrary sequence
47-
{
48-
"ci" = { lib, ... }: {
49-
imports = [ common ];
50-
after = __attrNames ciTasksSeq;
6+
tasks.ci = { config, lib, ... }: {
7+
preset = {
8+
nix.enable = true;
9+
10+
github.ci = {
11+
# Tullia tasks can run locally or on Cicero.
12+
# When no facts are present we know that we are running locally and vice versa.
13+
# When running locally, the current directory is already bind-mounted
14+
# into the container, so we don't need to fetch the source from GitHub
15+
# and we don't want to report a GitHub status.
16+
enable = config.actionRun.facts != { };
17+
inherit repository;
18+
revision = config.preset.github.lib.readRevision ciInputName null;
5119
};
5220
};
5321

54-
actions = {
55-
"daedalus/ci" = {
56-
task = "ci";
57-
io = ''
58-
// This is a CUE expression that defines what events trigger a new run of this action.
59-
// There is no documentation for this yet. Ask SRE if you have trouble changing this.
60-
let github = {
61-
#input: "${ciInputName}"
62-
#repo: "input-output-hk/daedalus"
63-
}
64-
#lib.merge
65-
#ios: [
66-
#lib.io.github_push & github,
67-
{ #lib.io.github_pr, github, #target_default: false },
68-
]
69-
'';
22+
command.text = config.preset.github.status.lib.reportBulk {
23+
bulk.text = "nix eval .#hydraJobs --apply __attrNames --json | nix-systems -i";
24+
each.text = ''nix build -L .#hydraJobs."$1".required'';
25+
skippedDescription = lib.escapeShellArg "No nix builder available for this system";
7026
};
27+
28+
memory = 1024 * 8;
29+
nomad.resources.cpu = 10000;
30+
};
31+
32+
actions."daedalus/ci" = {
33+
task = "ci";
34+
io = ''
35+
// This is a CUE expression that defines what events trigger a new run of this action.
36+
// There is no documentation for this yet. Ask SRE if you have trouble changing this.
37+
let github = {
38+
#input: "${ciInputName}"
39+
#repo: "${repository}"
40+
}
41+
#lib.merge
42+
#ios: [
43+
#lib.io.github_push & github,
44+
{ #lib.io.github_pr, github, #target_default: false },
45+
]
46+
'';
7147
};
7248
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "daedalus",
33
"productName": "Daedalus",
4-
"version": "5.1.1",
4+
"version": "5.2.0",
55
"description": "Cryptocurrency Wallet",
66
"main": "./dist/main/index.js",
77
"scripts": {

source/main/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const isDevelopment = checkIsDevelopment(NETWORK);
5353
const analyticsFeatureEnabled = true;
5454
const keepLocalClusterRunning = process.env.KEEP_LOCAL_CLUSTER_RUNNING;
5555
const API_VERSION = process.env.API_VERSION || 'dev';
56-
const NODE_VERSION = '1.35.3'; // TODO: pick up this value from process.env
56+
const NODE_VERSION = '1.35.4'; // TODO: pick up this value from process.env
5757

5858
const mainProcessID = get(process, 'ppid', '-');
5959
const rendererProcessID = process.pid;

source/renderer/app/analytics/MatomoAnalyticsTracker.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import { Environment } from '../../../common/types/environment.types';
44
import LocalStorageApi from '../api/utils/localStorage';
55
import { MatomoClient } from './MatomoClient';
66
import { NoopAnalyticsClient } from './noopAnalyticsClient';
7+
import AdaApi from '../api/api';
78

89
export class MatomoAnalyticsTracker implements AnalyticsTracker {
910
#analyticsClient: AnalyticsClient;
1011

1112
constructor(
1213
private environment: Environment,
13-
private localStorageApi: LocalStorageApi
14+
private localStorageApi: LocalStorageApi,
15+
private adaApi: AdaApi
1416
) {
1517
this.#analyticsClient = NoopAnalyticsClient;
1618
this.#enableTrackingIfAccepted();
@@ -19,6 +21,7 @@ export class MatomoAnalyticsTracker implements AnalyticsTracker {
1921
async enableTracking() {
2022
this.#analyticsClient = new MatomoClient(
2123
this.environment,
24+
this.adaApi,
2225
await this.localStorageApi.getUserID()
2326
);
2427
}

source/renderer/app/analytics/MatomoClient.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import MatomoTracker from 'matomo-tracker';
22
import { AnalyticsClient } from './types';
33
import { Environment } from '../../../common/types/environment.types';
4-
import formatCpuInfo from '../utils/formatCpuInfo';
54
import {
65
ANALYTICS_API_ENDPOINT,
7-
CPU_DIMENSION_KEY,
86
DEV_MODE_SITE_MAP_ID,
97
NETWORK_TO_ANALYTICS_SITE_ID_MAP,
10-
OS_DIMENSION_KEY,
11-
RAM_DIMENSION_KEY,
12-
VERSION_DIMENSION_KEY,
138
} from '../config/analyticsConfig';
14-
import { formattedBytesToSize } from '../utils/formatters';
9+
import { getCustomDimensions } from './getCustomDimensions';
10+
import AdaApi from '../api/api';
1511

1612
/**
1713
* Matomo API reference:
@@ -20,22 +16,28 @@ import { formattedBytesToSize } from '../utils/formatters';
2016
export class MatomoClient implements AnalyticsClient {
2117
private matomoTracker: MatomoTracker;
2218

23-
constructor(private environment: Environment, private userId: string) {
19+
constructor(
20+
private environment: Environment,
21+
private adaApi: AdaApi,
22+
private userId: string
23+
) {
2424
this.matomoTracker = new MatomoTracker(
2525
this.getMatomoSiteId(environment),
2626
ANALYTICS_API_ENDPOINT
2727
);
2828
}
2929

3030
sendPageNavigationEvent = async (pageTitle: string) => {
31+
const customDimensions = await getCustomDimensions(
32+
this.environment,
33+
this.adaApi
34+
);
35+
3136
this.matomoTracker.track({
3237
_id: this.userId,
3338
action_name: pageTitle,
3439
url: this.getAnalyticsURL(),
35-
[CPU_DIMENSION_KEY]: formatCpuInfo(this.environment.cpu),
36-
[RAM_DIMENSION_KEY]: formattedBytesToSize(this.environment.ram),
37-
[OS_DIMENSION_KEY]: this.environment.os,
38-
[VERSION_DIMENSION_KEY]: this.environment.version,
40+
...customDimensions,
3941
});
4042
};
4143

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Environment } from '../../../common/types/environment.types';
2+
import {
3+
CPU_DIMENSION_KEY,
4+
OS_DIMENSION_KEY,
5+
RAM_DIMENSION_KEY,
6+
USES_HARDWARE_WALLET_DIMENSION_KEY,
7+
USES_LEGACY_WALLET_DIMENSION_KEY,
8+
VERSION_DIMENSION_KEY,
9+
} from '../config/analyticsConfig';
10+
import { getShortCpuDescription } from '../utils/getShortCpuDescription';
11+
import { formattedBytesToSize } from '../utils/formatters';
12+
import AdaApi from '../api/api';
13+
14+
const booleanToText = (flag: boolean) => (flag ? 'yes' : 'no');
15+
16+
export const getCustomDimensions = async (
17+
environment: Environment,
18+
adaApi: AdaApi
19+
) => {
20+
const userWallets = await adaApi.getWallets();
21+
const usesByronWallets = userWallets.some((wallet) => wallet.isLegacy);
22+
const usesHardwareWallets = userWallets.some(
23+
(wallet) => wallet.isHardwareWallet
24+
);
25+
26+
return {
27+
[CPU_DIMENSION_KEY]: getShortCpuDescription(environment.cpu[0]?.model),
28+
[RAM_DIMENSION_KEY]: formattedBytesToSize(environment.ram, 0),
29+
[OS_DIMENSION_KEY]: environment.os,
30+
[VERSION_DIMENSION_KEY]: environment.version,
31+
[USES_LEGACY_WALLET_DIMENSION_KEY]: booleanToText(usesByronWallets),
32+
[USES_HARDWARE_WALLET_DIMENSION_KEY]: booleanToText(usesHardwareWallets),
33+
};
34+
};

0 commit comments

Comments
 (0)