Skip to content

Commit 5b50b1d

Browse files
committed
Merge branch 'develop' into chore/ddw-1169-preview-respin-node-1.35.4
2 parents acf3bf7 + b5eecb1 commit 5b50b1d

File tree

11 files changed

+393
-201
lines changed

11 files changed

+393
-201
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22

33
## vNext
44

5+
### Features
6+
7+
- Implemented CPU name grouping mechanism for analytics ([PR 3089](https://github.com/input-output-hk/daedalus/pull/3089))
8+
- Implemented rounding RAM size in analytics ([PR 3088](https://github.com/input-output-hk/daedalus/pull/3088))
9+
510
### Chores
611

712
- Update `cardano-node` to 1.35.4 for the Preview network respin ([PR 3082](https://github.com/input-output-hk/daedalus/pull/3082))
13+
- Updated new Catalyst API URL ([PR 3087](https://github.com/input-output-hk/daedalus/pull/3087))
814
- Fixed Storybook state for General stories ([PR 3064](https://github.com/input-output-hk/daedalus/pull/3064))
915

1016
## 5.1.1

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/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
}

source/renderer/app/analytics/MatomoClient.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
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,
76
CPU_DIMENSION_KEY,
@@ -12,6 +11,7 @@ import {
1211
VERSION_DIMENSION_KEY,
1312
} from '../config/analyticsConfig';
1413
import { formattedBytesToSize } from '../utils/formatters';
14+
import { getShortCpuDescription } from '../utils/getShortCpuDescription';
1515

1616
/**
1717
* Matomo API reference:
@@ -32,8 +32,10 @@ export class MatomoClient implements AnalyticsClient {
3232
_id: this.userId,
3333
action_name: pageTitle,
3434
url: this.getAnalyticsURL(),
35-
[CPU_DIMENSION_KEY]: formatCpuInfo(this.environment.cpu),
36-
[RAM_DIMENSION_KEY]: formattedBytesToSize(this.environment.ram),
35+
[CPU_DIMENSION_KEY]: getShortCpuDescription(
36+
this.environment.cpu[0]?.model
37+
),
38+
[RAM_DIMENSION_KEY]: formattedBytesToSize(this.environment.ram, 0),
3739
[OS_DIMENSION_KEY]: this.environment.os,
3840
[VERSION_DIMENSION_KEY]: this.environment.version,
3941
});

source/renderer/app/config/urlsConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const DEVELOPMENT_NEWS_HASH_URL = 'newsfeed.daedaluswallet.io';
1111
export const MAINNET_NEWS_HASH_URL = 'newsfeed.daedaluswallet.io';
1212
export const TESTNET_NEWS_HASH_URL = 'newsfeed.daedaluswallet.io';
1313
export const STAGING_NEWS_HASH_URL = 'newsfeed.daedaluswallet.io';
14-
export const MAINNET_SERVICING_STATION_URL = 'servicing-station.vit.iohk.io';
14+
export const MAINNET_SERVICING_STATION_URL = 'servicing-station.gov.iog.io';
1515
export const ALLOWED_EXTERNAL_HOSTNAMES = [
1616
MAINNET_EXPLORER_URL,
1717
STAGING_EXPLORER_URL,

source/renderer/app/utils/formatCpuInfo.spec.ts

Lines changed: 0 additions & 80 deletions
This file was deleted.

source/renderer/app/utils/formatCpuInfo.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

source/renderer/app/utils/formatters.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ export const formattedLovelaceToAmount = (lovelace: number): number =>
185185
formattedAmountToBigNumber(String(lovelace))
186186
.dividedBy(LOVELACES_PER_ADA)
187187
.toNumber();
188-
export const formattedBytesToSize = (bytes: number): string => {
188+
export const formattedBytesToSize = (
189+
bytes: number,
190+
decimalPlaces = 1
191+
): string => {
189192
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
190193
if (bytes === 0) return 'n/a';
191194
const i = parseInt(
@@ -194,7 +197,7 @@ export const formattedBytesToSize = (bytes: number): string => {
194197
10
195198
);
196199
if (i === 0) return `${bytes} ${sizes[i]})`;
197-
return `${formattedNumber(bytes / 1024 ** i, 1)} ${sizes[i]}`;
200+
return `${formattedNumber(bytes / 1024 ** i, decimalPlaces)} ${sizes[i]}`;
198201
};
199202
export type FormattedDownloadData = {
200203
timeLeft: string;

0 commit comments

Comments
 (0)