Skip to content

Commit acca5a9

Browse files
authored
Merge pull request #556 from keymanapp/fix/resilience-for-tc-data
fix: use target_url instead of url
2 parents 31fad50 + 4f39188 commit acca5a9

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

server/keymanapp-test-bot/artifact-links-comment.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,21 @@ export async function getArtifactLinksComment(
5959
for(let context of Object.keys(s)) {
6060
// artifactLinks
6161
let u;
62-
if(!s[context].url) {
62+
if(!s[context].target_url) {
6363
console.warn(`[@keymanapp-test-bot] skipping ${s[context].context}`);
6464
continue;
6565
}
6666
try {
67-
u = new URL(s[context].url);
67+
u = new URL(s[context].target_url);
6868
} catch(e) {
6969
console.error(`[@keymanapp-test-bot] ${e}`);
7070
continue;
7171
}
72-
if (u.hostname == 'jenkins.lsdev.sil.org') {
73-
for (let download of artifactLinks.jenkinsTarget.downloads) {
74-
if (!links['Linux']) links['Linux'] = [];
75-
links['Linux'].push({
76-
state: s[context].state,
77-
platform: 'Linux',
78-
download: download.name,
79-
url: `${s[context].url}/${download.fragment}`,
80-
});
81-
}
82-
} else if (context == 'Debian Packaging') {
72+
if (context == 'Debian Packaging') {
8373
// https://github.com/keymanapp/keyman/actions/runs/4294449810
84-
const matches = s[context].url.match(/.+\/runs\/(\d+)/);
74+
const matches = s[context].target_url.match(/.+\/runs\/(\d+)/);
8575
if (!matches) {
86-
console.error(`[@keymanapp-test-bot] Can't find workflow run in url ${s[context].url}`);
76+
console.error(`[@keymanapp-test-bot] Can't find workflow run in url ${s[context].target_url}`);
8777
return '';
8878
}
8979
const run_id = matches[1];
@@ -200,7 +190,7 @@ function findBuildData(s, buildTypeId, teamCity) {
200190
// artifactLinks
201191
let u;
202192
try {
203-
u = new URL(s[context].url);
193+
u = new URL(s[context].target_url);
204194
} catch(e) {
205195
continue;
206196
}

0 commit comments

Comments
 (0)