Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions server/keymanapp-test-bot/artifact-links-comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export async function getArtifactLinksComment(
};

let links: {[key: string]: LinkInfo[]} = {};
let buildLevels: {[key: string]: string} = {};

for(let context of Object.keys(s)) {
// artifactLinks
Expand Down Expand Up @@ -156,10 +157,11 @@ export async function getArtifactLinksComment(
download.name == 'Test Keyboards' ? 'Keyboards' :
t.name;
if(!links[platform]) links[platform] = [];
buildLevels[platform] = buildLevel;

if(buildLevel == 'build') {
links[platform].push({
state: s[context].state == 'success' ? ': all tests passed (no artifacts on BuildLevel "build")' : s[context].state,
state: s[context].state == 'success' ? ': all tests passed' : ('❌ ' + s[context].state),
platform: platform,
download: download.name,
url: null
Expand Down Expand Up @@ -196,10 +198,11 @@ export async function getArtifactLinksComment(
platforms.sort((a,b) => a.localeCompare(b, 'en', {sensitivity: 'base'}));

let r = '\n## Test Artifacts\n\n';

platforms.forEach(platform => {
let items = links[platform];
items.sort((a:LinkInfo,b:LinkInfo) => a.download.localeCompare(b.download));
r += `* **${platform}**\n` +
r += `* **${platform}**${buildLevels[platform] == 'build' ? ' (no artifacts on BuildLevel "build")' : ''}\n` +
items.map<string>(link =>
(link.state == 'success'
? ` * [${link.download}](${link.url})`
Expand Down
10 changes: 9 additions & 1 deletion server/services/discourse/discourse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import httpget from '../../util/httpget.js';
import { userIds } from '../../../shared/users.js';
import { reportSiteErrorToSentry } from '../../code.js';

const api_key=process.env['KEYMANSTATUS_DISCOURSE_API_KEY'];
const api_username=process.env['KEYMANSTATUS_DISCOURSE_API_USERNAME'];

export default {
get: async function(startDate) {
let result = {
Expand Down Expand Up @@ -39,7 +42,12 @@ export default {

const host = 'community.software.sil.org';

let discourseQuery = httpget(host, url);
const headers = {
'Api-Key': api_key,
'Api-Username': api_username,
};

let discourseQuery = httpget(host, url, headers);

return discourseQuery.then((data) => {
let json = JSON.parse(data.data);
Expand Down
Loading