Skip to content

Commit e888900

Browse files
authored
Merge pull request #651 from keymanapp/auto/A19S28-merge-master-into-staging
auto: A19S28 merge master into staging
2 parents 98b743f + 9d9af79 commit e888900

24 files changed

Lines changed: 637 additions & 368 deletions

build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,16 @@ builder_describe \
4141
builder_parse "$@"
4242

4343
function build_docker_containers() {
44+
NEWVERSION="$(git rev-parse HEAD)"
45+
echo "Writing version '$NEWVERSION' to version.ts"
46+
echo "export const buildVersion = '$NEWVERSION';" > shared/version.ts
47+
4448
build_docker_container $THIS_IMAGE_NAME $THIS_CONTAINER_NAME $BUILDER_CONFIGURATION server.Dockerfile
4549
if builder_is_debug_build; then
4650
build_docker_container $PUBLIC_IMAGE_NAME $PUBLIC_CONTAINER_NAME $BUILDER_CONFIGURATION public.Dockerfile
4751
fi
52+
53+
git checkout shared/version.ts
4854
}
4955

5056
function start_docker_containers() {

public/package-lock.json

Lines changed: 52 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/src/app/agent-detail/agent-detail.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { platforms, PlatformSpec } from '../../../../shared/platforms';
33
import { PopupCoordinatorService } from '../popup-coordinator.service';
44
import { PopupComponent } from '../popup/popup.component';
55
import { VisibilityService } from '../visibility/visibility.service';
6+
import { Status } from '../status/status.interface';
67

78
@Component({
89
selector: 'app-agent-detail',
@@ -12,7 +13,7 @@ import { VisibilityService } from '../visibility/visibility.service';
1213
})
1314
export class AgentDetailComponent extends PopupComponent implements OnInit {
1415
@Input() agent: any;
15-
@Input() status: any;
16+
@Input() status: Status;
1617

1718
platform: PlatformSpec;
1819
buildType: string;
@@ -45,7 +46,7 @@ export class AgentDetailComponent extends PopupComponent implements OnInit {
4546
}
4647
if(this.agent.build.branchName?.match(/^\d+$/)) {
4748
const prNumber = parseInt(this.agent.build.branchName, 10);
48-
this.pullRequest = this.status.github?.data?.repository?.pullRequests?.edges?.find(pr => pr.node?.number == prNumber)?.node;
49+
this.pullRequest = this.status.keymanRepo?.pullRequests?.edges?.find(pr => pr.node?.number == prNumber)?.node;
4950
if(!this.pullRequest) {
5051
this.pullRequest = {number: prNumber, title: '<unknown pull request>'};
5152
}

public/src/app/build-queue/build-queue.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class BuildQueueComponent extends PopupComponent implements OnInit {
5353

5454
getPullRequestTitle(build) {
5555
const prNumber = parseInt(build.branchName, 10);
56-
const pullRequest = this.status.github?.data?.repository?.pullRequests?.edges?.find(pr => pr.node?.number == prNumber)?.node;
56+
const pullRequest = this.status.keymanRepo?.pullRequests?.edges?.find(pr => pr.node?.number == prNumber)?.node;
5757
return pullRequest ? pullRequest.title : '<unknown pull request>';
5858
}
5959

public/src/app/data/data.model.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ interface OtherSites {
1515
export class DataModel {
1616
status: Status = EMPTY_STATUS;
1717

18+
serverBuildVersion: string = '';
19+
1820
serviceState: {service: ServiceIdentifier, state: ServiceState, message?: string}[];
1921

2022
platforms: PlatformSpec[] = JSON.parse(JSON.stringify(platforms)); // makes a copy of the constant platform data for this component
@@ -86,6 +88,7 @@ export class DataModel {
8688
break;
8789
case ServiceIdentifier.GitHub:
8890
this.status.github = data.github;
91+
this.status.keymanRepo = this.status.github?.data.organization.repositories.nodes.find(e=>e.name=='keyman');
8992
this.keyboardPRs = this.status.github?.data.organization.repositories.nodes.find(e=>e.name=='keyboards')?.pullRequests.edges;
9093
this.lexicalModelPRs = this.status.github?.data.organization.repositories.nodes.find(e=>e.name=='lexical-models')?.pullRequests.edges;
9194
this.transformPlatformStatusData();
@@ -181,7 +184,7 @@ export class DataModel {
181184
for(let platform of this.platforms) {
182185
platform.pulls = [];
183186
platform.pullsByEmoji = {};
184-
for(let pull of this.status.github.data.repository.pullRequests.edges) {
187+
for(let pull of this.status.keymanRepo.pullRequests.edges) {
185188
pull.node.checkSummary = pullChecks(pull);
186189
let labels = pull.node.labels.edges;
187190
let status = pull.node.commits.edges[0].node.commit.status;
@@ -237,8 +240,8 @@ export class DataModel {
237240
})
238241
};
239242

240-
if(this.status.github && this.status.github.data) {
241-
this.status.github.data.repository.pullRequests.edges.forEach(item => {
243+
if(this.status.keymanRepo) {
244+
this.status.keymanRepo.pullRequests.edges.forEach(item => {
242245
removeDuplicates(item.node.timelineItems);
243246
});
244247
}
@@ -360,7 +363,7 @@ export class DataModel {
360363

361364
// TODO: split search against future and current milestones (future milestone shows only count; current milestone shows more detail)
362365
// For each platform, fill in the milestone counts
363-
this.status.github.data.repository.issuesByLabelAndMilestone.edges.forEach(label => {
366+
this.status.github.data.repositoryRefsLabelsMilestones.issueLabels.edges.forEach(label => {
364367
let platform = this.getPlatform(label.node.name.substring(0,label.node.name.length-1));
365368
if(!platform) return;
366369
platform.totalIssueCount = label.node.openIssues.totalCount;
@@ -453,8 +456,8 @@ export class DataModel {
453456

454457
extractUnlabeledPulls() {
455458
this.unlabeledPulls = [];
456-
for(let q in this.status.github.data.repository.pullRequests.edges) {
457-
let pull = this.status.github.data.repository.pullRequests.edges[q];
459+
for(let q in this.status.keymanRepo.pullRequests.edges) {
460+
let pull = this.status.keymanRepo.pullRequests.edges[q];
458461
if(!this.labeledPulls.includes(pull)) {
459462
this.unlabeledPulls.push({pull:pull});
460463
}
@@ -501,8 +504,8 @@ export class DataModel {
501504
this.pullsByStatus.waitingReview = [];
502505
this.pullsByStatus.waitingTest = [];
503506
this.pullsByStatus.waitingResponse = [];
504-
for(let q in this.status.github.data.repository.pullRequests.edges) {
505-
let pull = this.status.github.data.repository.pullRequests.edges[q];
507+
for(let q in this.status.keymanRepo.pullRequests.edges) {
508+
let pull = this.status.keymanRepo.pullRequests.edges[q];
506509
let emoji = pullEmoji(pull) || "other";
507510
if(!this.pullsByProject[emoji]) this.pullsByProject[emoji] = [];
508511

@@ -617,7 +620,7 @@ export class DataModel {
617620
}
618621

619622
while(pull && !pull.node.baseRefName.match(ultimateBaseRef)) {
620-
pull = this.status.github.data.repository.pullRequests.edges.find(e => e.node.headRefName == pull.node.baseRefName);
623+
pull = this.status.keymanRepo.pullRequests.edges.find(e => e.node.headRefName == pull.node.baseRefName);
621624
}
622625

623626
input.node.ultimateBaseRefName = pull ? pull.node.baseRefName : 'unknown';

0 commit comments

Comments
 (0)