Skip to content

Commit

Permalink
chore(release): 0.8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Aug 20, 2017
1 parent be5b65a commit d4151c3
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 40 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
<a name="0.8.11"></a>
## [0.8.11](https://github.com/bleenco/abstruse/compare/v0.8.9...v0.8.11) (2017-08-20)


### Bug Fixes

* minor hotfix ([8d4c85f](https://github.com/bleenco/abstruse/commit/8d4c85f))
* **builds:** add condition to check if jobs are present ([3ce43eb](https://github.com/bleenco/abstruse/commit/3ce43eb))


### Features

* **build-details:** stop build functionality ([be5b65a](https://github.com/bleenco/abstruse/commit/be5b65a))
* **favicon:** change favicon on build status ([3dbf648](https://github.com/bleenco/abstruse/commit/3dbf648))
* **tags:** show git tag data ([9e14668](https://github.com/bleenco/abstruse/commit/9e14668))


### Performance Improvements

* **build-details:** clear update times interval ([22c8ea2](https://github.com/bleenco/abstruse/commit/22c8ea2))



<a name="0.8.10"></a>
## [0.8.10](https://github.com/bleenco/abstruse/compare/v0.8.9...v0.8.10) (2017-08-20)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "abstruse",
"version": "0.8.10",
"version": "0.8.11",
"description": "Abstruse CI",
"bin": {
"abstruse": "./dist/api/index.js"
Expand Down
24 changes: 2 additions & 22 deletions src/api/db/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,8 @@ import { getHttpJsonResponse } from '../utils';
export function getRepository(id: number): Promise<any> {
return new Promise((resolve, reject) => {
new Repository({ id: id }).fetch({ withRelated: ['access_token'] })
.then(repo => {
if (!repo) {
reject(repo);
} else {
repo = repo.toJSON();
repo.builds = repo.builds.map(build => {
build.jobs = build.jobs.map(job => {
if (job.runs.length > 0) {
job.end_time = job.runs[job.runs.length - 1].end_time;
job.start_time = job.runs[job.runs.length - 1].start_time;
job.status = job.runs[job.runs.length - 1].status;
}

return job;
});

return build;
});

resolve(repo);
}
}).catch(err => reject(err));
.then(repo => !repo ? reject(repo) : resolve(repo.toJSON()))
.catch(err => reject(err));
});
}

Expand Down
26 changes: 14 additions & 12 deletions src/app/components/app-build-details/app-build-details.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class AppBuildDetailsComponent implements OnInit, OnDestroy {
this.loading = false;
this.build = build;

if (this.build.data.ref.startsWith('refs/tags/')) {
if (this.build.data && this.build.data.ref && this.build.data.ref.startsWith('refs/tags')) {
this.tag = this.build.data.ref.replace('refs/tags/', '');
}

Expand Down Expand Up @@ -154,19 +154,21 @@ export class AppBuildDetailsComponent implements OnInit, OnDestroy {
let status = 'queued';
let favicon = 'images/favicon-queued.png';

if (this.build.jobs.findIndex(job => job.status === 'failed') !== -1) {
status = 'failed';
favicon = 'images/favicon-error.png';
}
if (this.build && this.build.jobs) {
if (this.build.jobs.findIndex(job => job.status === 'failed') !== -1) {
status = 'failed';
favicon = 'images/favicon-error.png';
}

if (this.build.jobs.findIndex(job => job.status === 'running') !== -1) {
status = 'running';
favicon = 'images/favicon-running.png';
}
if (this.build.jobs.findIndex(job => job.status === 'running') !== -1) {
status = 'running';
favicon = 'images/favicon-running.png';
}

if (this.build.jobs.length === this.build.jobs.filter(job => job.status === 'success').length) {
status = 'success';
favicon = 'images/favicon.png';
if (this.build.jobs.length === this.build.jobs.filter(j => j.status === 'success').length) {
status = 'success';
favicon = 'images/favicon.png';
}
}

const name = this.build.repository.full_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ <h1>{{ repo?.full_name }}</h1>
</div>
</div>

<div class="column is-12" *ngIf="!repo?.builds.length && tab === 'builds'">
<div class="column is-12" *ngIf="!repo?.builds?.length && tab === 'builds'">
<div class="notification is-info">
No builds has been runned yet.
</div>
</div>

<div class="column is-12" *ngIf="repo?.builds.length && tab === 'builds'">
<div class="column is-12" *ngIf="repo?.builds?.length && tab === 'builds'">
<div class="columns list-item" *ngFor="let build of repo.builds; let i = index;" [ngClass]="{ 'is-queued': build.status === 'queued', 'is-success': build.status === 'success', 'is-running': build.status === 'running', 'is-errored': build.status === 'failed' }" (click)="gotoBuild(build.id)">
<app-build-item [build]="build"></app-build-item>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class AppRepositoryComponent implements OnInit, OnDestroy {
e.stopPropagation();
}

this.fetching = true;
this.api.getRepositoryBuilds(this.id, this.limit, this.offset).subscribe(builds => {
if (!this.repo.builds) {
this.repo.builds = [];
Expand Down Expand Up @@ -203,9 +204,6 @@ export class AppRepositoryComponent implements OnInit, OnDestroy {
return date;
})), 'mm:ss');

return build;
})
.map(build => {
let status = 'queued';
if (build.jobs.findIndex(job => job.status === 'failed') !== -1) {
status = 'failed';
Expand Down

0 comments on commit d4151c3

Please sign in to comment.