mcdev 5.0.2 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.coverage-comment-template.svelte +177 -161
- package/.github/ISSUE_TEMPLATE/bug.yml +1 -0
- package/.github/dependabot.yml +8 -0
- package/.github/workflows/coverage-base-update.yml +6 -2
- package/.github/workflows/coverage-develop-branch.yml +7 -6
- package/.github/workflows/coverage-main-branch.yml +7 -6
- package/.github/workflows/coverage.yml +7 -2
- package/.husky/post-checkout +3 -2
- package/docs/dist/documentation.md +162 -47
- package/lib/Deployer.js +3 -3
- package/lib/cli.js +28 -0
- package/lib/index.js +173 -2
- package/lib/metadataTypes/Automation.js +400 -193
- package/lib/metadataTypes/DataExtension.js +5 -5
- package/lib/metadataTypes/MetadataType.js +42 -15
- package/lib/metadataTypes/Query.js +26 -0
- package/lib/metadataTypes/definitions/Asset.definition.js +1 -0
- package/lib/metadataTypes/definitions/Automation.definition.js +52 -6
- package/lib/metadataTypes/definitions/DataExtension.definition.js +1 -0
- package/lib/metadataTypes/definitions/DataExtract.definition.js +1 -0
- package/lib/metadataTypes/definitions/EmailSend.definition.js +1 -0
- package/lib/metadataTypes/definitions/Event.definition.js +1 -0
- package/lib/metadataTypes/definitions/Filter.definition.js +1 -0
- package/lib/metadataTypes/definitions/ImportFile.definition.js +1 -0
- package/lib/metadataTypes/definitions/MobileKeyword.definition.js +1 -0
- package/lib/metadataTypes/definitions/Query.definition.js +1 -0
- package/lib/metadataTypes/definitions/Role.definition.js +1 -0
- package/lib/metadataTypes/definitions/TriggeredSend.definition.js +1 -0
- package/lib/metadataTypes/definitions/User.definition.js +1 -0
- package/lib/util/devops.js +13 -11
- package/lib/util/util.js +152 -129
- package/package.json +5 -5
- package/test/general.test.js +26 -0
- package/test/mockRoot/.mcdevrc.json +1 -1
- package/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json +53 -0
- package/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json +46 -0
- package/test/mockRoot/deploy/testInstance/testBU/query/{testExistingQuery.query-meta.json → testExisting_query.query-meta.json} +2 -2
- package/test/mockRoot/deploy/testInstance/testBU/query/{testNewQuery.query-meta.json → testNew_query.query-meta.json} +2 -2
- package/test/resourceFactory.js +64 -21
- package/test/resources/9999999/automation/build-expected.json +58 -0
- package/test/resources/9999999/automation/create-expected.json +46 -0
- package/test/resources/9999999/automation/create-testNew_automation-expected.md +28 -0
- package/test/resources/9999999/automation/delete-response.xml +40 -0
- package/test/resources/9999999/automation/retrieve-expected.json +58 -0
- package/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md +30 -0
- package/test/resources/9999999/automation/template-expected.json +58 -0
- package/test/resources/9999999/automation/update-expected.json +46 -0
- package/test/resources/9999999/automation/update-testExisting_automation-expected.md +28 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/patch-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/a8afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/post-response.json +85 -0
- package/test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/get-response.json +38 -0
- package/test/resources/9999999/automation/v1/dataextracts/get-response.json +20 -0
- package/test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/get-response.json +18 -0
- package/test/resources/9999999/automation/v1/filetransfers/get-response.json +15 -0
- package/test/resources/9999999/automation/v1/imports/get-response.json +38 -0
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/actions/start/post-response.txt +1 -0
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/get-response.json +2 -2
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/patch-response.json +2 -2
- package/test/resources/9999999/automation/v1/queries/get-response.json +4 -4
- package/test/resources/9999999/automation/v1/queries/post-response.json +2 -2
- package/test/resources/9999999/automation/v1/scripts/get-response.json +17 -0
- package/test/resources/9999999/dataFolder/retrieve-ContentType=automations-response.xml +48 -0
- package/test/resources/9999999/dataFolder/retrieve-ContentType=queryactivity-response.xml +48 -0
- package/test/resources/9999999/dataFolder/retrieve-response.xml +22 -0
- package/test/resources/9999999/emailSendDefinition/retrieve-response.xml +85 -0
- package/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow/get-response.json +21 -0
- package/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow/post-response.json +0 -0
- package/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json +30 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation-response.xml +30 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testNew_automation-response.xml +30 -0
- package/test/resources/9999999/program/retrieve-Name=testExisting_automation-response.xml +31 -0
- package/test/resources/9999999/program/retrieve-response.xml +32 -0
- package/test/resources/9999999/query/build-expected.json +2 -2
- package/test/resources/9999999/query/get-expected.json +2 -2
- package/test/resources/9999999/query/get2-expected.json +2 -2
- package/test/resources/9999999/query/patch-expected.json +2 -2
- package/test/resources/9999999/query/post-expected.json +2 -2
- package/test/resources/9999999/query/template-expected.json +2 -2
- package/test/type.automation.test.js +259 -0
- package/test/type.dataExtension.test.js +3 -0
- package/test/type.query.test.js +39 -26
- package/test/type.user.test.js +17 -3
- package/test/utils.js +7 -6
- package/.coverage-comment-template.md +0 -20
- /package/test/mockRoot/deploy/testInstance/testBU/query/{testExistingQuery.query-meta.sql → testExisting_query.query-meta.sql} +0 -0
- /package/test/mockRoot/deploy/testInstance/testBU/query/{testNewQuery.query-meta.sql → testNew_query.query-meta.sql} +0 -0
|
@@ -1,178 +1,194 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
2
|
+
export let total_statements_coverage_percent_raw;
|
|
3
|
+
export let total_branches_coverage_percent_raw;
|
|
4
|
+
export let total_functions_coverage_percent_raw;
|
|
5
|
+
export let total_lines_coverage_percent_raw;
|
|
6
|
+
|
|
7
|
+
export let base_total_statements_coverage_percent_raw;
|
|
8
|
+
export let base_total_branches_coverage_percent_raw;
|
|
9
|
+
export let base_total_functions_coverage_percent_raw;
|
|
10
|
+
export let base_total_lines_coverage_percent_raw;
|
|
11
|
+
|
|
12
|
+
export let commit_sha;
|
|
13
|
+
export let short_commit_sha;
|
|
14
|
+
export let commit_link;
|
|
15
|
+
|
|
16
|
+
export let base_commit_sha;
|
|
17
|
+
export let base_short_commit_sha;
|
|
18
|
+
export let base_commit_link;
|
|
19
|
+
export let base_ref;
|
|
20
|
+
|
|
21
|
+
export let changed_files_coverage_data;
|
|
22
|
+
|
|
23
|
+
const has_base_data = base_total_branches_coverage_percent_raw !== '?';
|
|
24
|
+
const summary_list = [
|
|
25
|
+
{
|
|
26
|
+
type: 'Total Statements Coverage',
|
|
27
|
+
percent: {
|
|
28
|
+
total: total_statements_coverage_percent_raw,
|
|
29
|
+
base: has_base_data ? base_total_statements_coverage_percent_raw : null,
|
|
30
|
+
diff: has_base_data
|
|
31
|
+
? total_statements_coverage_percent_raw -
|
|
32
|
+
base_total_statements_coverage_percent_raw
|
|
33
|
+
: null,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 'Total Branches Coverage',
|
|
38
|
+
percent: {
|
|
39
|
+
total: total_branches_coverage_percent_raw,
|
|
40
|
+
base: has_base_data ? base_total_branches_coverage_percent_raw : null,
|
|
41
|
+
diff: has_base_data
|
|
42
|
+
? total_branches_coverage_percent_raw - base_total_branches_coverage_percent_raw
|
|
43
|
+
: null,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: 'Total Functions Coverage',
|
|
48
|
+
percent: {
|
|
49
|
+
total: total_functions_coverage_percent_raw,
|
|
50
|
+
base: has_base_data ? base_total_functions_coverage_percent_raw : null,
|
|
51
|
+
diff: has_base_data
|
|
52
|
+
? total_functions_coverage_percent_raw -
|
|
53
|
+
base_total_functions_coverage_percent_raw
|
|
54
|
+
: null,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: 'Total Lines Coverage',
|
|
59
|
+
percent: {
|
|
60
|
+
total: total_lines_coverage_percent_raw,
|
|
61
|
+
base: has_base_data ? base_total_lines_coverage_percent_raw : null,
|
|
62
|
+
diff: has_base_data
|
|
63
|
+
? total_lines_coverage_percent_raw - base_total_lines_coverage_percent_raw
|
|
64
|
+
: null,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
const LETTER_LABEL = {
|
|
70
|
+
S: 'Statements',
|
|
71
|
+
B: 'Branches',
|
|
72
|
+
F: 'Functions',
|
|
73
|
+
L: 'Lines',
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const COVERAGE_LEVEL_IMAGE = {
|
|
77
|
+
low: 'https://user-images.githubusercontent.com/11299391/159445221-fe3dc085-8c56-4e03-9642-219784c88fe7.svg',
|
|
78
|
+
medium: 'https://user-images.githubusercontent.com/11299391/159445212-f135c6d7-f354-4e8c-9a9f-28bb3ff1b7b5.svg',
|
|
79
|
+
high: 'https://user-images.githubusercontent.com/11299391/159445220-d88b3624-0814-4664-80c8-09f0f2b8e68b.svg',
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
function formatPercentDiff(percent) {
|
|
83
|
+
if (!Number.isFinite(percent)) {
|
|
84
|
+
return '';
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const roundedPercent = `${Number(percent.toFixed(2))}%`;
|
|
88
|
+
|
|
89
|
+
if (percent >= 0) {
|
|
90
|
+
return '+' + roundedPercent;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return roundedPercent;
|
|
75
94
|
}
|
|
76
95
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
function getCoverageLevelImage(percent) {
|
|
97
|
+
// https://github.com/istanbuljs/istanbuljs/blob/c1559005b3bb318da01f505740adb0e782aaf14e/packages/istanbul-lib-report/lib/watermarks.js
|
|
98
|
+
if (percent >= 80) {
|
|
99
|
+
return COVERAGE_LEVEL_IMAGE.high;
|
|
100
|
+
} else if (percent >= 50) {
|
|
101
|
+
return COVERAGE_LEVEL_IMAGE.medium;
|
|
102
|
+
} else {
|
|
103
|
+
return COVERAGE_LEVEL_IMAGE.low;
|
|
104
|
+
}
|
|
81
105
|
}
|
|
82
106
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
function getCoverageLevelImage(percent) {
|
|
87
|
-
// https://github.com/istanbuljs/istanbuljs/blob/c1559005b3bb318da01f505740adb0e782aaf14e/packages/istanbul-lib-report/lib/watermarks.js
|
|
88
|
-
if (percent >= 80) {
|
|
89
|
-
return COVERAGE_LEVEL_IMAGE.high;
|
|
90
|
-
} else if (percent >= 50) {
|
|
91
|
-
return COVERAGE_LEVEL_IMAGE.medium;
|
|
92
|
-
} else {
|
|
93
|
-
return COVERAGE_LEVEL_IMAGE.low;
|
|
107
|
+
function getFilePrefix() {
|
|
108
|
+
return `../blob/${commit_sha}/`;
|
|
94
109
|
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function getFilePrefix() {
|
|
98
|
-
return `../blob/${commit_sha}/`;
|
|
99
|
-
}
|
|
100
110
|
</script>
|
|
101
111
|
|
|
102
112
|
<h2>Coverage Report</h2>
|
|
103
113
|
|
|
104
|
-
Commit
|
|
105
|
-
Base: <a href=
|
|
114
|
+
Commit:<a href={commit_link}>{short_commit_sha}</a><br />
|
|
115
|
+
Base: <a href={base_commit_link}>{base_ref}@{base_short_commit_sha}</a><br /><br />
|
|
106
116
|
|
|
107
117
|
<table>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{#if has_base_data}
|
|
111
|
-
<th>Base</th>
|
|
112
|
-
{/if}
|
|
113
|
-
<th>This PR</th>
|
|
114
|
-
</thead>
|
|
115
|
-
<tbody>
|
|
116
|
-
{#each summary_list as {type, percent}}
|
|
117
|
-
<tr>
|
|
118
|
-
<td>{type}</td>
|
|
118
|
+
<thead>
|
|
119
|
+
<th>Type</th>
|
|
119
120
|
{#if has_base_data}
|
|
120
|
-
|
|
121
|
-
{#if Number.isFinite(percent.base)}
|
|
122
|
-
<img src="{getCoverageLevelImage(percent.base)}" alt=""> {percent.base}%
|
|
123
|
-
{:else}
|
|
124
|
-
-
|
|
125
|
-
{/if}
|
|
126
|
-
</td>
|
|
121
|
+
<th>Base</th>
|
|
127
122
|
{/if}
|
|
128
|
-
<
|
|
129
|
-
{#if Number.isFinite(percent.total)}
|
|
130
|
-
<img src="{getCoverageLevelImage(percent.total)}" alt=""> {percent.total}%
|
|
131
|
-
{#if has_base_data}
|
|
132
|
-
({formatPercentDiff(percent.diff)})
|
|
133
|
-
{/if}
|
|
134
|
-
{:else}
|
|
135
|
-
-
|
|
136
|
-
{/if}
|
|
137
|
-
</td>
|
|
138
|
-
</tr>
|
|
139
|
-
{/each}
|
|
140
|
-
</tbody>
|
|
141
|
-
</table>
|
|
142
|
-
|
|
143
|
-
<details>
|
|
144
|
-
<summary>Details (changed testable files):</summary><br>
|
|
145
|
-
<table>
|
|
146
|
-
<thead>
|
|
147
|
-
<th>File</th>
|
|
148
|
-
<th>Statements</th>
|
|
149
|
-
<th>Branches</th>
|
|
150
|
-
<th>Functions</th>
|
|
151
|
-
<th>Lines</th>
|
|
123
|
+
<th>This PR</th>
|
|
152
124
|
</thead>
|
|
153
125
|
<tbody>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
126
|
+
{#each summary_list as { type, percent }}
|
|
127
|
+
<tr>
|
|
128
|
+
<td>{type}</td>
|
|
129
|
+
{#if has_base_data}
|
|
130
|
+
<td>
|
|
131
|
+
{#if Number.isFinite(percent.base)}
|
|
132
|
+
<img
|
|
133
|
+
src={getCoverageLevelImage(percent.base)}
|
|
134
|
+
alt=""
|
|
135
|
+
/> {percent.base}%
|
|
136
|
+
{:else}
|
|
137
|
+
-
|
|
138
|
+
{/if}
|
|
139
|
+
</td>
|
|
140
|
+
{/if}
|
|
141
|
+
<td>
|
|
142
|
+
{#if Number.isFinite(percent.total)}
|
|
143
|
+
<img
|
|
144
|
+
src={getCoverageLevelImage(percent.total)}
|
|
145
|
+
alt=""
|
|
146
|
+
/> {percent.total}%
|
|
147
|
+
{#if has_base_data}
|
|
148
|
+
({formatPercentDiff(percent.diff)})
|
|
149
|
+
{/if}
|
|
150
|
+
{:else}
|
|
151
|
+
-
|
|
152
|
+
{/if}
|
|
153
|
+
</td>
|
|
154
|
+
</tr>
|
|
155
|
+
{/each}
|
|
176
156
|
</tbody>
|
|
177
|
-
|
|
178
|
-
|
|
157
|
+
</table>
|
|
158
|
+
|
|
159
|
+
<details>
|
|
160
|
+
<summary>Details (changed files):</summary><br />
|
|
161
|
+
<table>
|
|
162
|
+
<thead>
|
|
163
|
+
<th>File</th>
|
|
164
|
+
<th>Statements</th>
|
|
165
|
+
<th>Branches</th>
|
|
166
|
+
<th>Functions</th>
|
|
167
|
+
<th>Lines</th>
|
|
168
|
+
</thead>
|
|
169
|
+
<tbody>
|
|
170
|
+
{#each changed_files_coverage_data as [file, data]}
|
|
171
|
+
{@const percents = [
|
|
172
|
+
data.statements.pct,
|
|
173
|
+
data.branches.pct,
|
|
174
|
+
data.functions.pct,
|
|
175
|
+
data.lines.pct,
|
|
176
|
+
]}
|
|
177
|
+
<tr>
|
|
178
|
+
<td>
|
|
179
|
+
<a href="{getFilePrefix()}{file}">{file}</a>
|
|
180
|
+
</td>
|
|
181
|
+
{#each percents as percent}
|
|
182
|
+
<td>
|
|
183
|
+
{#if Number.isFinite(percent)}
|
|
184
|
+
<img src={getCoverageLevelImage(percent)} alt="" /> {percent}%
|
|
185
|
+
{:else}
|
|
186
|
+
-
|
|
187
|
+
{/if}
|
|
188
|
+
</td>
|
|
189
|
+
{/each}
|
|
190
|
+
</tr>
|
|
191
|
+
{/each}
|
|
192
|
+
</tbody>
|
|
193
|
+
</table>
|
|
194
|
+
</details>
|
package/.github/dependabot.yml
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
name: Update coverage comment
|
|
1
|
+
name: Update coverage comment # base-update.yml
|
|
2
2
|
on:
|
|
3
3
|
pull_request:
|
|
4
4
|
types: [edited]
|
|
5
5
|
|
|
6
|
+
permissions:
|
|
7
|
+
# allow dependabot to execute this workflow
|
|
8
|
+
pull-requests: write
|
|
9
|
+
|
|
6
10
|
jobs:
|
|
7
11
|
hello_world_job:
|
|
8
12
|
runs-on: ubuntu-latest
|
|
@@ -48,7 +52,7 @@ jobs:
|
|
|
48
52
|
files: 'base-artifacts/coverage-summary.json, artifacts/coverage-summary.json'
|
|
49
53
|
|
|
50
54
|
- name: Update Coverage comment
|
|
51
|
-
uses: sidx1024/report-nyc-coverage-github-action@v1.2.
|
|
55
|
+
uses: sidx1024/report-nyc-coverage-github-action@v1.2.7
|
|
52
56
|
if: steps.check_files.outputs.files_exists == 'true'
|
|
53
57
|
# Only runs if all of the files exists
|
|
54
58
|
with:
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
name: Test coverage for develop branch
|
|
1
|
+
name: Test coverage for develop branch # default-branch.yml
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- develop
|
|
7
7
|
|
|
8
|
+
permissions:
|
|
9
|
+
# allow dependabot to execute this workflow
|
|
10
|
+
pull-requests: write
|
|
11
|
+
|
|
8
12
|
jobs:
|
|
9
13
|
hello_world_job:
|
|
10
14
|
runs-on: ubuntu-latest
|
|
11
|
-
name: Test and
|
|
15
|
+
name: Test and upload coverage
|
|
12
16
|
steps:
|
|
13
17
|
- name: Checkout
|
|
14
18
|
uses: actions/checkout@v3
|
|
15
19
|
with:
|
|
16
|
-
ref: ${{ github.event.
|
|
20
|
+
ref: ${{ github.event.ref }}
|
|
17
21
|
fetch-depth: 1000
|
|
18
22
|
|
|
19
|
-
- name: Fetch base
|
|
20
|
-
run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000
|
|
21
|
-
|
|
22
23
|
- uses: actions/setup-node@v3
|
|
23
24
|
with:
|
|
24
25
|
node-version: 16
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
name: Test coverage for main branch
|
|
1
|
+
name: Test coverage for main branch # default-branch.yml
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
7
|
|
|
8
|
+
permissions:
|
|
9
|
+
# allow dependabot to execute this workflow
|
|
10
|
+
pull-requests: write
|
|
11
|
+
|
|
8
12
|
jobs:
|
|
9
13
|
hello_world_job:
|
|
10
14
|
runs-on: ubuntu-latest
|
|
11
|
-
name: Test and
|
|
15
|
+
name: Test and upload coverage
|
|
12
16
|
steps:
|
|
13
17
|
- name: Checkout
|
|
14
18
|
uses: actions/checkout@v3
|
|
15
19
|
with:
|
|
16
|
-
ref: ${{ github.event.
|
|
20
|
+
ref: ${{ github.event.ref }}
|
|
17
21
|
fetch-depth: 1000
|
|
18
22
|
|
|
19
|
-
- name: Fetch base
|
|
20
|
-
run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000
|
|
21
|
-
|
|
22
23
|
- uses: actions/setup-node@v3
|
|
23
24
|
with:
|
|
24
25
|
node-version: 16
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
on: [pull_request]
|
|
2
2
|
|
|
3
|
-
name: Test coverage report
|
|
3
|
+
name: Test coverage report # main.yml
|
|
4
|
+
|
|
5
|
+
permissions:
|
|
6
|
+
# allow dependabot to execute this workflow
|
|
7
|
+
pull-requests: write
|
|
8
|
+
|
|
4
9
|
jobs:
|
|
5
10
|
hello_world_job:
|
|
6
11
|
runs-on: ubuntu-latest
|
|
@@ -69,7 +74,7 @@ jobs:
|
|
|
69
74
|
files: 'base-artifacts/coverage-summary.json'
|
|
70
75
|
|
|
71
76
|
- name: Report coverage
|
|
72
|
-
uses: sidx1024/report-nyc-coverage-github-action@v1.2.
|
|
77
|
+
uses: sidx1024/report-nyc-coverage-github-action@v1.2.7
|
|
73
78
|
id: report
|
|
74
79
|
with:
|
|
75
80
|
coverage_file: 'artifacts/test-coverage-output/coverage-summary.json'
|
package/.husky/post-checkout
CHANGED
|
@@ -10,7 +10,8 @@ then
|
|
|
10
10
|
fi
|
|
11
11
|
TEMPLATE="#$TICKETID: "
|
|
12
12
|
echo "[POST_CHECKOUT] Setting template commit to '$TEMPLATE'"
|
|
13
|
-
|
|
13
|
+
# wrap $TEMPLATE in quotes or else it is trimmed automatically
|
|
14
|
+
echo "$TEMPLATE" > ".git/templatemessage"
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
# ### run npm install ###
|
|
@@ -21,7 +22,7 @@ IFS=$'\n'
|
|
|
21
22
|
NEWHEAD=$1
|
|
22
23
|
# $2 is the previous HEAD pointer
|
|
23
24
|
OLDHEAD=$2
|
|
24
|
-
# extract all paths to package-lock.json files
|
|
25
|
+
# extract all paths to package-lock.json files
|
|
25
26
|
PACKAGE_LOCK_REGEX="(^package-lock\.json)"
|
|
26
27
|
PACKAGES=$(git diff --name-only $NEWHEAD $OLDHEAD | grep -E $PACKAGE_LOCK_REGEX || true)
|
|
27
28
|
|