Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supp 1021 - #SUPP-1021 - Creating a release should trigger a build #2835

Open
wants to merge 7 commits into
base: enterprise-3.0
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion app/components/build-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default Component.extend({

displayCompare: computed('item.eventType', function () {
let eventType = this.get('item.eventType');
return !['api', 'cron'].includes(eventType);
return !['api', 'cron', 'release'].includes(eventType);
}),

commitUrl: computed('item.repo.{ownerName,vcsName,vcsType}', 'commit.sha', function () {
Expand Down
2 changes: 1 addition & 1 deletion app/components/repo-build-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import config from 'travis/config/environment';
import dynamicQuery from 'travis/utils/dynamic-query';

const { repoBuildsPerPage: limit } = config.pagination;
const MAIN_EVENT_TYPES = ['push', 'api', 'cron'];
const MAIN_EVENT_TYPES = ['push', 'api', 'cron', 'release'];
const SORT_PROPS = ['number:desc'];

export default Component.extend({
Expand Down
2 changes: 2 additions & 0 deletions app/components/request-icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const eventToIcon = {
pull_request: 'pullrequest',
cron: 'cronjobs',
api: 'api',
release: 'release',
default: 'nobuilds'
};

Expand All @@ -14,6 +15,7 @@ const eventToTitle = {
pull_request: 'Triggered from a pull request',
cron: 'Triggered by a cron job',
api: 'Triggered via the API',
release: 'Triggered by a release',
default: 'Triggered via unknown means'
};

Expand Down
4 changes: 2 additions & 2 deletions app/models/repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ const Repo = VcsEntity.extend({
builds: computed('id', function () {
let id = this.id;
const builds = this.store.filter('build', {
event_type: ['push', 'api', 'cron'],
event_type: ['push', 'api', 'cron', 'release'],
repository_id: id,
}, (b) => {
let eventTypes = ['push', 'api', 'cron'];
let eventTypes = ['push', 'api', 'cron', 'release'];
return this._buildRepoMatches(b, id) && eventTypes.includes(b.get('eventType'));
});
return this._buildObservableArray(builds);
Expand Down
2 changes: 1 addition & 1 deletion app/routes/dashboard/builds.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default TravisRoute.extend({

model(params) {
let currentUserId = this.get('auth.currentUser.id');
let eventTypes = ['api', 'pull_request', 'push'];
let eventTypes = ['api', 'pull_request', 'push', 'release'];
let query = {
limit: 30,
event_type: eventTypes.join(','),
Expand Down
10 changes: 10 additions & 0 deletions app/templates/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@
<SvgImage @name="icon-help" @class="icon-help" />
</ExternalLinkTo>
</li>
{{#if (eq this.repo.provider 'github')}}
<li>
<SettingsSwitch
@active={{this.model.settings.build_releases}}
@repo={{this.repo}}
@description="Build pushed releases"
@key="build_releases"
/>
</li>
{{/if}}
</ul>
</section>
<section class="settings-section">
Expand Down
1 change: 1 addition & 0 deletions public/images/stroke-icons/icon-release.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.