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

TravisCi Web enterprise merge. #2814

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1e6b9a2
Update OS for enterprise ship:docker
DamianSzymanski Mar 18, 2021
5b613ab
security updates (#2607)
GbArc Apr 21, 2021
a295ba5
gem updates (#2609)
GbArc May 10, 2021
3fe76b3
app management url and installation check update (#2610)
GbArc May 10, 2021
0096d05
docker fix+trivy
GbArc Jul 7, 2021
659da26
trivy fix
GbArc Jul 7, 2021
a61611b
Gem update 280721 (#2626)
GbArc Jul 29, 2021
ab6dd38
update to use latest docker
GbArc Oct 21, 2021
a05bd04
github apps management url update (#2648)
GbArc Jan 31, 2022
57b7f23
sharing envs to forks (#2679)
GbArc Mar 10, 2022
8c7910f
removed user management button
GbArc Mar 30, 2022
a8df3a3
removed stripe script for enterprise
GbArc Apr 26, 2022
f97e687
upgrade-gems (#2677)
makemp May 17, 2022
87ac658
gem updates (#2702)
GbArc May 19, 2022
b9621c4
rack update -> 2.2.3.1
GbArc Jun 8, 2022
a68bf27
up trivy cmd
GbArc Jun 8, 2022
d50f9e6
BSFY-141 merge - add restarted by (#2726)
GbArc Sep 7, 2022
d6dca64
reduce image size (#2732)
GbArc Oct 5, 2022
df54ddb
logs merge from master (#2748)
GbArc Dec 14, 2022
04a2ee9
sinatra 2.2.3 (#2753)
GbArc Dec 28, 2022
b7a5f29
fix for missing repo migration count max value. Fix for invalid org i…
GbArc Jan 9, 2023
01aeb68
review and add orgs link fix
GbArc Jan 9, 2023
cbd8d92
managing email subscriptions for whole org
gbarc-dt May 26, 2023
55923b0
test/lint fixes
gbarc-dt May 26, 2023
d74fe51
removed resubscribe list
gbarc-dt May 31, 2023
b20420b
maintenance mode (#2771)
GbArc May 31, 2023
a4f5614
dockerfile corrected
gbarc-dt Jun 1, 2023
36153db
Supp-718
mkdtravis Jul 19, 2023
ce6f416
Cherry pick restarted by feature (#2789)
piccadilly-circus Oct 12, 2023
a2ae888
Added log limit using env var (#2792)
piccadilly-circus Dec 6, 2023
3543d26
Random failing tests (#2793)
piccadilly-circus Dec 6, 2023
984dc45
repo tooltips + trigger build closing (#2798)
GbArc Feb 21, 2024
a00dcc6
TravisCI Web merge. Enterprise to master.
Mar 25, 2024
aa70ef1
TravisCI Web merge. Enterprise to master.
Mar 25, 2024
6a4be41
TravisCI Web merge. Enterprise to master.
Mar 26, 2024
1d915c9
TravisCI Web. Removing changes from package.json.
Mar 27, 2024
3064a32
TravisCI Admin v2. Issue with double keys in JS.
Mar 29, 2024
4bfa8ad
TravisCI Web. Rollback import.
Mar 29, 2024
f893716
TravisCI Web. Import skip.
Mar 29, 2024
591fd1d
TravisCI Web. Removing duplicated method.
Mar 29, 2024
dfcabcd
lint fix
gbarc-dt Mar 29, 2024
1a8f4f1
ruby v corrected ship:docker
gbarc-dt Mar 29, 2024
d39a1db
fixes / ship:docker
gbarc-dt Apr 5, 2024
0e4ff0f
dbg ship:docker
gbarc-dt Apr 5, 2024
a27c9c7
dbg ship:docker
gbarc-dt Apr 5, 2024
e092bf7
focal ship:docker
gbarc-dt Apr 5, 2024
abc8399
log-scanner config change ship:docker
gbarc-dt Apr 12, 2024
2ef27f9
rm subs ship:docker
gbarc-dt Apr 17, 2024
1dbc73f
typo ship:docker
gbarc-dt Apr 17, 2024
d380af1
publicmode fix ship:docker
gbarc-dt Apr 18, 2024
7e8ff28
endpointPortfolio from env
gbarc-dt Apr 29, 2024
5141c73
rmdbg
gbarc-dt Apr 30, 2024
746154e
lint fix
gbarc-dt May 14, 2024
1c3abc7
removed duplicate
gbarc-dt May 29, 2024
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ tmp
# dependencies
bower_components
node_modules
tests

# misc
.env*
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
language: node_js
node_js: 10
group: edge

env:
global:
Expand All @@ -21,6 +22,7 @@ cache:
before_install:
- npm config set spin false
- npm install -g greenkeeper-lockfile@1
- gem install bundler:2.3.7

install:
- npm ci
Expand Down
67 changes: 67 additions & 0 deletions Dockerfile.ycie
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
FROM ruby:3.2.2 as build

LABEL maintainer Travis CI GmbH <[email protected]>

ENV NPM_CONFIG_LOGLEVEL info
ENV NODE_VERSION 10.7.0
ENV YARN_VERSION 0.22.0

RUN ( \
groupadd --gid 1000 node \
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node; \
curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs; \
curl -fSL -o yarn.js "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-legacy-$YARN_VERSION.js" \
&& mv yarn.js /usr/local/bin/yarn \
&& chmod +x /usr/local/bin/yarn; \
mkdir -p /app; \
)
COPY package.json /app
COPY package-lock.json /app
COPY . /app

WORKDIR /app

RUN (\
npm install --silent -g ember-cli; \
npm ci; \
ember build --environment=production; \
ls -l /app; \
ls -l /app/dist; \
)

FROM ruby:2.7.5-slim

LABEL maintainer Travis CI GmbH <[email protected]>

RUN ( \
gem install bundler:2.3.7; \
bundle config --global frozen 1; \
mkdir -p /app/dist; \
)

WORKDIR /app

COPY --from=build /app/dist/ /app/dist/
COPY --from=build /app/maintenance/ /app/maintenance/
COPY Gemfile* /app/
COPY waiter /app/waiter
COPY public /app/public
COPY ssl /app/ssl

RUN (\

cp -a public/* dist/; \
rm -rf public; \
apt-get update ; \
apt-get upgrade -y ; \
apt-get install -y --no-install-recommends git make gcc g++ libpq-dev libjemalloc-dev; \
rm -rf /var/lib/apt/lists/*; \
bundle install --without assets development test; \
sed -i "/stripe.com\/v3/d" /app/dist/index.html; \
apt-get remove -y gcc g++ make git perl && apt-get -y autoremove; \
)


CMD ["bundle", "exec", "puma", "-I", "lib", "-p", "${PORT:-4000}", "-t", "${PUMA_MIN_THREADS:-8}:${PUMA_MAX_THREADS:-12}", "-w", "${PUMA_WORKERS:-2}", "--preload", "waiter/config.ru" ]
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ source 'https://rubygems.org'
gem 'hashr'
gem 'puma', '~> 6'
gem 'rack-mobile-detect'
gem 'rack-protection', '~> 3.0'
gem 'rack-protection', '~> 3.0', '~> 2'
gem 'rack-ssl', '~> 1.4'
gem 'sanitize'
gem 'sinatra'
gem 'travis-web', path: 'waiter'
gem 'nokogiri', '~> 1.13.6'

group :development, :test do
gem 'rake'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DOCKER ?= docker

.PHONY: docker-build
docker-build:
$(DOCKER) build -t $(DOCKER_DEST) .
$(DOCKER) build --pull --no-cache -t $(DOCKER_DEST) . -f Dockerfile.ycie
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ycie -> typo


.PHONY: docker-login
docker-login:
Expand Down
22 changes: 22 additions & 0 deletions app/components/github-apps-repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,28 @@ export default Component.extend({
}
}),

hasEmailSubscription: computed('repository', 'repository.emailSubscribed', function () {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate

return this.repository.emailSubscribed;
}),

emailSubscriptionDescription: computed('repository', 'repository.emailSubscribed', function () {
return `${this.repository.emailSubscribed ? 'Disable ' : 'Enable '} build mails for ${this.repository.name}`;
}),

toggleRepositoryEmailSubscription: task(function* () {
const repository = this.repository;
try {
if (repository.emailSubscribed) {
yield repository.unsubscribe.perform();
} else {
yield repository.subscribe.perform();
}
yield repository.reload();
} catch (error) {
this.set('apiError', error);
}
}),

toggleRepositoryTask: task(function* () {
const repository = this.repository;
try {
Expand Down
24 changes: 20 additions & 4 deletions app/components/owner/repositories.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default Component.extend({
isMatchGithub: match('owner.vcsType', /Github\S+$/),
isOwnerVcsTypeEmpty: empty('owner.vcsType'),
isNotGithubRepository: not('isGithubRepository'),
hasGitHubAppsInstallation: notEmpty('owner.installation'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it removed?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Goo question, probably merge issue. Exists on master. Done.


isEnterprise: reads('features.enterpriseVersion'),
isNotEnterprise: not('isEnterprise'),
Expand Down Expand Up @@ -102,13 +101,30 @@ export default Component.extend({
let isOrganization = this.get('owner.isOrganization');
let ownerGithubId = this.get('owner.githubId');
let installationGithubId = this.get('owner.installation.githubId');
let sourceEndpoint = `${config.sourceEndpoint}`;

if (appName && appName.length) {
if (sourceEndpoint === 'undefined') {
sourceEndpoint = 'https://github.com';
}

if (!installationGithubId) {
let ownerId = this.get('owner.id');
let ownerType = this.get('owner.type');
const installations = this.store.peekAll('installation').filterBy('owner.id', ownerId) || null;
if (installations) {
const installation = installations.findBy('owner.type', ownerType) || null;
if (installation) {
installationGithubId = installation.githubId;
}
}
}

if (!installationGithubId && appName && appName.length) {
return `${config.githubAppsEndpoint}/${appName}/installations/new/permissions?suggested_target_id=${ownerGithubId}`;
} else if (isOrganization) {
return `https://github.com/organizations/${login}/settings/installations/${installationGithubId}`;
return `${sourceEndpoint}/organizations/${login}/settings/installations/${installationGithubId}`;
} else {
return `https://github.com/settings/installations/${installationGithubId}`;
return `${sourceEndpoint}/settings/installations/${installationGithubId}`;
}
}
),
Expand Down
9 changes: 9 additions & 0 deletions app/styles/app/layouts/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,12 @@ $env-var-value-background: lighten($cement-grey, 20);
margin-left: 20px;
}
}

.ember-tooltip {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will probably break some tooltips - don't add

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, but it's probably responsible for a tool tip added in enterpise .. but .. removed. Done.

min-width: 200px;
max-width: 1316px;

.tooltip-inner {
}

}
3 changes: 2 additions & 1 deletion app/templates/components/env-var.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="env-var-name">
<EmberTooltip @text={{this.envVar.name}} @targetId='env-var-name-{{envVar.id}}' @popperContainer='body'/>
<div class="env-var-name" id='env-var-name-{{envVar.id}}'>
{{this.envVar.name}}
</div>
<div class="env-var-value">
Expand Down
5 changes: 4 additions & 1 deletion app/templates/components/requests-item.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
</span>
</div>
<div class="row-item fade-out" data-requests-item-commit-message>
{{{format-message this.request.commit.message short="true" repo=this.build.repo}}}
<span id='requests-item-{{request.id}}-commit-message'>
<EmberTooltip @text={{this.request.commit.message}} @targetId='requests-item-{{request.id}}-commit-message' @popperContainer='body'/>
{{{format-message this.request.commit.message short="true" repo=this.build.repo}}}
</span>
</div>
<div class="row-item" data-requests-item-build>
{{#if this.build}}
Expand Down
96 changes: 96 additions & 0 deletions app/templates/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,102 @@
</li>
</ul>
</section>
<section class="settings-section">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate? - check with the section above if there aren't any enterprise-only changes and put under a flag if so - if it's the same -> out

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a additionall condition:

{{#if (or this.features.enterpriseVersion this.repo.private)}}

<h2 class="small-title">
Security settings
</h2>
<p>
The {{vcs-vocab this.repo.vcsType 'pullRequest' lower=true}} ({{vcs-vocab this.repo.vcsType 'pr'}}) settings are applicable for git-based {{vcs-vocab this.repo.vcsType 'pullRequest' plural=true lower=true}} from forks of this repository filed against this repository.
</p>
<p>
Sharing data with forks allows more comfortable collaboration when collaborators are forking from your repository, but builds initiated by the {{vcs-vocab this.repo.vcsType 'pullRequest' plural=true lower=true}} from forks against your base repository get access to your decrypted environmental variables and/or keys.
</p>
<p>
Not sharing secrets is more secure but makes it much less convenient to collaborate using forks.
</p>
<ul class="settings-list--columns">
<li>
<SettingsSwitch
@active={{this.model.settings.share_encrypted_env_with_forks}}
@repo={{this.repo}}
@description="Share encrypted env variables with forks ({{vcs-vocab this.repo.vcsType 'pr' plural=true}})"
@key="share_encrypted_env_with_forks"
/>
<ExternalLinkTo
href="https://docs.travis-ci.com/user/web-ui/#share-encrypted-variables-with-forks-pull-request"
title="about sharing encrypted environmental variables with forks ({{vcs-vocab this.repo.vcsType 'pullRequest' plural=true lower=true}})"
class="settings-tooltip"
>
<EmberTooltip @text="Read more about sharing encrypted environmental variables with forks ({{vcs-vocab this.repo.vcsType 'pullRequest' plural=true lower=true}})" />
<SvgImage @name="icon-help" @class="icon-help" />
</ExternalLinkTo>
</li>
{{#if (or this.features.enterpriseVersion this.repo.private)}}
<li>
<SettingsSwitch
@active={{this.model.settings.share_ssh_keys_with_forks}}
@repo={{this.repo}}
@description="Share SSH keys with forks ({{vcs-vocab this.repo.vcsType 'pr' plural=true}})"
@key="share_ssh_keys_with_forks"
/>
<ExternalLinkTo
href="https://docs.travis-ci.com/user/web-ui/#share-ssh-keys-with-forks-pull-request"
title="about sharing SSH keys with forks ({{vcs-vocab this.repo.vcsType 'pullRequest'}})"
class="settings-tooltip"
>
<EmberTooltip @text="Read more about sharing SSH keys with forks ({{vcs-vocab this.repo.vcsType 'pullRequest' plural=true lower=true}})" />
<SvgImage @name="icon-help" @class="icon-help" />
</ExternalLinkTo>
</li>
{{/if}}
</ul>
<p>
Enable access to build job logs older than {{this.model.settings.job_log_access_older_than_days}} days. When set to OFF logs older than {{this.model.settings.job_log_access_older_than_days}} days are
not available either via UI or API. Please consider if there's a risk of confidential information
being leaked prior to enabling access to old build job logs. If you want to modify the time
threshold, please contact support.
</p>
<ul class="settings-list--row">
<li>
<SettingsSwitch
@active={{this.model.settings.job_log_time_based_limit}}
@repo={{this.repo}}
@description="Enable access to old build job logs."
@key="job_log_time_based_limit"
/>
<ExternalLinkTo
href="https://docs.travis-ci.com/user/web-ui/#share-encrypted-variables-with-forks-pull-request"
title="about enabling access to old build jobs"
class="settings-tooltip"
>
<EmberTooltip @text="Read more about enabling access to old build jobs" />
<SvgImage @name="icon-help" @class="icon-help" />
</ExternalLinkTo>
</li>
</ul>
<p>
Enabling access to build job logs only for users with write/push permissions to this repository will limit access to build job logs via UI and API. When set to OFF, all users with read access to the
repository can access the build job logs.
</p>
<ul class="settings-list--row">
<li>
<SettingsSwitch
@active={{this.model.settings.job_log_access_based_limit}}
@repo={{this.repo}}
@description="Limit access to build job logs (users with write/push access only)"
@key="job_log_access_based_limit"
/>
<ExternalLinkTo
href="https://docs.travis-ci.com/user/web-ui/#share-encrypted-variables-with-forks-pull-request"
title="about limiting access to build job logs."
class="settings-tooltip"
>
<EmberTooltip @text="Read more about limiting access to build job logs" />
<SvgImage @name="icon-help" @class="icon-help" />
</ExternalLinkTo>
</li>
</ul>
</section>
{{#if this.showAutoCancellationSwitches}}
<section class="settings-section auto-cancellation">
<h2 class="small-title display-inline">
Expand Down
Loading