Skip to content

Commit f6a7f44

Browse files
Update prod (#399)
* fix(releases): cover case with empty map body (#397) * imp(email): link to billing (#398) * imp(email): link to billing * chore(email): update patterns * imp(paymaster): add paid until field for workspace (#400) * feat(paymaster): support paid until workspace field * chore(paymaster): update types and test * chore(): lint fix * chore(): lint fix * imp(CI): update ubuntu version * test(paymaster): add new testcase * chore(paymaster): lint fix --------- Co-authored-by: e11sy <130844513+e11sy@users.noreply.github.com>
1 parent d222bf8 commit f6a7f44

18 files changed

Lines changed: 227 additions & 94 deletions

File tree

.github/workflows/build-and-push-docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77

88
jobs:
99
build:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
if: endsWith(github.ref, '/prod') || endsWith(github.ref, '/stage') || endsWith(github.ref, '/migration')
1212
steps:
1313
- name: Checkout repository

.github/workflows/check-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
build:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
1212
- name: Checkout repository
1313
uses: actions/checkout@v2

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: [push]
55
jobs:
66
lint:
77
name: Unit testing
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-22.04
99
steps:
1010
- uses: actions/checkout@v2
1111
- name: Use Node.js 16.x

.github/workflows/update-monorepository.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
REPOSITORY_MONO_PATH: workers
88
jobs:
99
build:
10-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
1111
steps:
1212
- name: Mono repository update
1313
uses: peter-evans/repository-dispatch@v1

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ module.exports = {
2727

2828
setupFiles: [ './jest.setup.js' ],
2929

30-
setupFilesAfterEnv: [ './jest.setup.redis-mock.js', './jest.setup.mongo-repl-set.js' ],
30+
setupFilesAfterEnv: ['./jest.setup.redis-mock.js', './jest.setup.mongo-repl-set.js'],
3131
};

jest.setup.mongo-repl-set.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ let admin;
44
let connection;
55

66
beforeAll(async () => {
7-
connection = await MongoClient.connect("mongodb://127.0.0.1:55010/hawk?", {
7+
connection = await MongoClient.connect('mongodb://127.0.0.1:55010/hawk?', {
88
useNewUrlParser: true,
99
useUnifiedTopology: true,
1010
});
@@ -13,11 +13,12 @@ beforeAll(async () => {
1313

1414
try {
1515
let status = await admin.command({ replSetGetStatus: 1 }).catch(() => null);
16+
1617
if (status && status.ok) {
17-
console.log("✅ Replica set already initialized");
18+
console.log('✅ Replica set already initialized');
1819
} else {
1920
await admin.command({ replSetInitiate: {} });
20-
console.log("✅ Replica set initiated");
21+
console.log('✅ Replica set initiated');
2122
}
2223

2324
const startTime = Date.now();
@@ -30,15 +31,15 @@ beforeAll(async () => {
3031
await new Promise(resolve => setTimeout(resolve, 1000));
3132
status = await admin.command({ replSetGetStatus: 1 });
3233

33-
const primary = status.members.find(member => member.stateStr === "PRIMARY");
34-
const secondary = status.members.find(member => member.stateStr === "SECONDARY");
34+
const primary = status.members.find(member => member.stateStr === 'PRIMARY');
35+
const secondary = status.members.find(member => member.stateStr === 'SECONDARY');
3536

36-
if (primary && secondary) break;
37+
if (primary && secondary) {
38+
break;
39+
}
3740
} while (Date.now() - startTime < timeout);
3841

39-
40-
console.log("✅ Replica set is stable");
41-
42+
console.log('✅ Replica set is stable');
4243
} catch (err) {
4344
console.error('❌ Failed to initiate replica set:', err);
4445
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"dependencies": {
4949
"@hawk.so/nodejs": "^3.1.1",
50-
"@hawk.so/types": "^0.1.28",
50+
"@hawk.so/types": "^0.1.29",
5151
"@types/amqplib": "^0.8.2",
5252
"@types/jest": "^29.2.3",
5353
"@types/mongodb": "^3.5.15",

workers/email/src/templates/emails/events-limit-almost-reached/html.twig

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,25 @@
1414
<td align="center" style="padding: 15px 0;">
1515
<font color="#dbe6ff" style="font-size: 15px; text-align: center; color: #dbe6ff; letter-spacing: 0.4px;">
1616
<span style="vertical-align: middle; display: inline-block;">
17-
Warning of the Used Volume
17+
You’re almost out of your error tracking limit
1818
</span>
1919
</font>
2020
</td>
2121
</tr>
2222
<tr>
2323
<td style="display: block; padding: 20px; margin-bottom: 30px; border-width: 1px; border-color: #494f5e; border-style: solid; border-radius: 10px; line-height: 1.47">
2424
<font color="#dbe6ff" style="font-size: 15px; letter-spacing: 0.4px;">
25-
You've used {{ eventsCount }} of {{ eventsLimit }} events available on {{ workspace.name | escape }} workspace.
25+
Youve used {{ eventsCount }} of {{ eventsLimit }} events this month in the {{ workspace.name | escape }} workspace.
2626

27-
Increase used volume and don't miss the new ones.
27+
Your project is growing — that’s awesome! Let’s make sure you don’t miss any important errors.
28+
29+
Upgrade your plan to stay on top of everything.
2830
</font>
2931
</td>
3032
</tr>
3133
<tr>
3234
<td style="padding-right: 20px; padding-left: 20px; padding-bottom: 40px;">
33-
{% include '../../components/button.twig' with {href: host ~ '/workspace/' ~ workspace._id ~ '/settings/volume', label: 'Go to event usage settings'} %}
35+
{% include '../../components/button.twig' with {href: host ~ '/workspace/' ~ workspace._id ~ '/settings/billing', label: 'Increase limit — from 99₽'} %}
3436
</td>
3537
</tr>
3638
{% endblock %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Warning of the Used Volume for workspace {{ workspace.name | escape }}!
1+
You’re almost out of error tracking events in {{ workspace.name }} workspace

workers/email/src/templates/emails/events-limit-almost-reached/text.twig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
You've used {{ eventsCount }} of {{ eventsLimit }} events available on {{ workspace.name | escape }} workspace plan.
1+
Youve used {{ eventsCount }} of {{ eventsLimit }} events this month in the {{ workspace.name | escape }} workspace.
22

3-
Upgrade the plan and don't miss the new ones: {{ host }}/workspace/{{ workspace._id }}/settings/billing
3+
Your project is growing — that’s awesome! Let’s make sure you don’t miss any important errors.
4+
5+
Upgrade your plan to stay on top of everything: {{ host }}/workspace/{{ workspace._id }}/settings/billing
46

57
***
68

0 commit comments

Comments
 (0)