Commit 9c86dd72 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'ce-to-ee-2018-04-20' into 'master'

CE upstream - 2018-04-20 12:24 UTC

See merge request gitlab-org/gitlab-ee!5436
parents 70f9a29d d14b14e8
...@@ -80,7 +80,7 @@ stages: ...@@ -80,7 +80,7 @@ stages:
.use-mysql: &use-mysql .use-mysql: &use-mysql
services: services:
- mysql:latest - mysql:5.7
- redis:alpine - redis:alpine
# BEGIN EE-only service helpers # BEGIN EE-only service helpers
...@@ -103,7 +103,7 @@ stages: ...@@ -103,7 +103,7 @@ stages:
.use-mysql-with-elasticsearch: &use-mysql-with-elasticsearch .use-mysql-with-elasticsearch: &use-mysql-with-elasticsearch
services: services:
- mysql:latest - mysql:5.7
- redis:alpine - redis:alpine
- docker.elastic.co/elasticsearch/elasticsearch:5.5.2 - docker.elastic.co/elasticsearch/elasticsearch:5.5.2
......
...@@ -13,8 +13,9 @@ entry. ...@@ -13,8 +13,9 @@ entry.
- Fix XSS on diff view stored on filenames. - Fix XSS on diff view stored on filenames.
- Fix GitLab Auth0 integration signing in the wrong user. - Fix GitLab Auth0 integration signing in the wrong user.
### Fixed (63 changes, 20 of them are from the community) ### Fixed (65 changes, 20 of them are from the community)
- File uploads in remote storage now support project renaming. !4597
- Fixed bug in dropdown selector when selecting the same selection again. !14631 (bitsapien) - Fixed bug in dropdown selector when selecting the same selection again. !14631 (bitsapien)
- Fixed group deletion linked to Mattermost. !16209 (Julien Millau) - Fixed group deletion linked to Mattermost. !16209 (Julien Millau)
- Create commit API and Web IDE obey LFS filters. !16718 - Create commit API and Web IDE obey LFS filters. !16718
...@@ -55,9 +56,9 @@ entry. ...@@ -55,9 +56,9 @@ entry.
- Work around Prometheus Helm chart name changes to fix integration. !18206 (joshlambert) - Work around Prometheus Helm chart name changes to fix integration. !18206 (joshlambert)
- Prioritize weight over title when sorting charts. !18233 - Prioritize weight over title when sorting charts. !18233
- Verify that deploy token has valid access when pulling container registry image. !18260 - Verify that deploy token has valid access when pulling container registry image. !18260
- Ensure hooks run when a deploy key without a user pushes.
- Stop redirecting the page in pipeline main actions. - Stop redirecting the page in pipeline main actions.
- Fixed IDE button opening the wrong URL in tree list. - Fixed IDE button opening the wrong URL in tree list.
- Ensure hooks run when a deploy key without a user pushes.
- Fix 404 in group boards when moving issue between lists. - Fix 404 in group boards when moving issue between lists.
- Display state indicator for issuable references in non-project scope (e.g. when referencing issuables from group scope). - Display state indicator for issuable references in non-project scope (e.g. when referencing issuables from group scope).
- Add missing port to artifact links. - Add missing port to artifact links.
...@@ -66,12 +67,13 @@ entry. ...@@ -66,12 +67,13 @@ entry.
- Don't show Jump to Discussion button on Issues. - Don't show Jump to Discussion button on Issues.
- Fix bug rendering group icons when forking. - Fix bug rendering group icons when forking.
- Automatically cleanup stale worktrees and lock files upon a push. - Automatically cleanup stale worktrees and lock files upon a push.
- Use the GitLab version as part of the appearances cache key.
- Fix Firefox stealing formatting characters on issue notes. - Fix Firefox stealing formatting characters on issue notes.
- Include matching branches and tags in protected branches / tags count. (Jan Beckmann) - Include matching branches and tags in protected branches / tags count. (Jan Beckmann)
- Fix relative uri when "#" is in branch name. (Jan)
- Test if remote repository exists when importing wikis.
- Fix 500 error when a merge request from a fork has conflicts and has not yet been updated. - Fix 500 error when a merge request from a fork has conflicts and has not yet been updated.
- Test if remote repository exists when importing wikis.
- Hide emoji popup after multiple spaces. (Jan Beckmann) - Hide emoji popup after multiple spaces. (Jan Beckmann)
- Fix relative uri when "#" is in branch name. (Jan)
- Escape Markdown characters properly when using autocomplete. - Escape Markdown characters properly when using autocomplete.
- Ignore project internal references in group context. - Ignore project internal references in group context.
- Fix finding wiki file when Gitaly is enabled. - Fix finding wiki file when Gitaly is enabled.
...@@ -108,7 +110,7 @@ entry. ...@@ -108,7 +110,7 @@ entry.
- Fixes remove source branch checkbox being visible when user cannot remove the branch. - Fixes remove source branch checkbox being visible when user cannot remove the branch.
- Make /-/ delimiter optional for search endpoints. - Make /-/ delimiter optional for search endpoints.
### Performance (25 changes, 11 of them are from the community) ### Performance (24 changes, 11 of them are from the community)
- Move AssigneeTitle vue component. !17397 (George Tsiolis) - Move AssigneeTitle vue component. !17397 (George Tsiolis)
- Move TimeTrackingCollapsedState vue component. !17399 (George Tsiolis) - Move TimeTrackingCollapsedState vue component. !17399 (George Tsiolis)
...@@ -128,7 +130,6 @@ entry. ...@@ -128,7 +130,6 @@ entry.
- Cache personal projects count. !18197 - Cache personal projects count. !18197
- Reduce complexity of issuable finder query. !18219 - Reduce complexity of issuable finder query. !18219
- Reduce number of queries when viewing a merge request. - Reduce number of queries when viewing a merge request.
- Support Markdown rendering using multiple projects.
- Free open file descriptors and libgit2 buffers in UpdatePagesService. - Free open file descriptors and libgit2 buffers in UpdatePagesService.
- Memoize Git::Repository#has_visible_content?. - Memoize Git::Repository#has_visible_content?.
- Require at least one filter when listing issues or merge requests on dashboard page. - Require at least one filter when listing issues or merge requests on dashboard page.
...@@ -136,7 +137,7 @@ entry. ...@@ -136,7 +137,7 @@ entry.
- Bulk deleting refs is handled by Gitaly by default. - Bulk deleting refs is handled by Gitaly by default.
- ListCommitsByOid is executed by Gitaly by default. - ListCommitsByOid is executed by Gitaly by default.
### Added (37 changes, 7 of them are from the community) ### Added (38 changes, 7 of them are from the community)
- Add HTTPS-only pages. !16273 (rfwatson) - Add HTTPS-only pages. !16273 (rfwatson)
- adds closed by informations in issue api. !17042 (haseebeqx) - adds closed by informations in issue api. !17042 (haseebeqx)
...@@ -144,6 +145,7 @@ entry. ...@@ -144,6 +145,7 @@ entry.
- Add per-runner configured job timeout. !17221 - Add per-runner configured job timeout. !17221
- Add alternate archive route for simplified packaging. !17225 - Add alternate archive route for simplified packaging. !17225
- Add support for pipeline variables expressions in only/except. !17316 - Add support for pipeline variables expressions in only/except. !17316
- Add object storage support for LFS objects, CI artifacts, and uploads. !17358
- Added confirmation modal for changing username. !17405 - Added confirmation modal for changing username. !17405
- Implement foreground verification of CI artifacts. !17578 - Implement foreground verification of CI artifacts. !17578
- Extend API for exporting a project with direct upload URL. !17686 - Extend API for exporting a project with direct upload URL. !17686
...@@ -164,9 +166,9 @@ entry. ...@@ -164,9 +166,9 @@ entry.
- Support LFS objects when importing/exporting GitLab project archives. !18115 - Support LFS objects when importing/exporting GitLab project archives. !18115
- Store sha256 checksum of artifact metadata. !18149 - Store sha256 checksum of artifact metadata. !18149
- Limit the number of failed logins when using LDAP for authentication. !43525 - Limit the number of failed logins when using LDAP for authentication. !43525
- Allow to store uploads by default on Object Storage.
- Allow assigning and filtering issuables by ancestor group labels. - Allow assigning and filtering issuables by ancestor group labels.
- Include subgroup issues when searching for group issues using the API. - Include subgroup issues when searching for group issues using the API.
- Allow to store uploads by default on Object Storage.
- Add slash command for moving issues. (Adam Pahlevi) - Add slash command for moving issues. (Adam Pahlevi)
- Render MR commit SHA instead "diffs" when viable. - Render MR commit SHA instead "diffs" when viable.
- Send @mention notifications even if a user has explicitly unsubscribed from item. - Send @mention notifications even if a user has explicitly unsubscribed from item.
...@@ -209,7 +211,7 @@ entry. ...@@ -209,7 +211,7 @@ entry.
## 10.6.4 (2018-04-09) ## 10.6.4 (2018-04-09)
### Fixed (9 changes, 1 of them is from the community) ### Fixed (8 changes, 1 of them is from the community)
- Correct copy text for the promote milestone and label modals. !17726 - Correct copy text for the promote milestone and label modals. !17726
- Avoid validation errors when running the Pages domain verification service. !17992 - Avoid validation errors when running the Pages domain verification service. !17992
...@@ -217,7 +219,6 @@ entry. ...@@ -217,7 +219,6 @@ entry.
- Fix exceptions raised when migrating pipeline stages in the background. !18076 - Fix exceptions raised when migrating pipeline stages in the background. !18076
- Work around Prometheus Helm chart name changes to fix integration. !18206 (joshlambert) - Work around Prometheus Helm chart name changes to fix integration. !18206 (joshlambert)
- Don't show Jump to Discussion button on Issues. - Don't show Jump to Discussion button on Issues.
- Fix data race between ObjectStorage background_upload and Pages publishing.
- Fix listing commit branch/tags that contain special characters. - Fix listing commit branch/tags that contain special characters.
- Fix 404 in group boards when moving issue between lists. - Fix 404 in group boards when moving issue between lists.
...@@ -248,11 +249,10 @@ entry. ...@@ -248,11 +249,10 @@ entry.
- Bump rails-html-sanitizer to 1.0.4. - Bump rails-html-sanitizer to 1.0.4.
### Fixed (3 changes) ### Fixed (2 changes)
- Prevent auto-retry AccessDenied error from stopping transition to failed. !17862 - Prevent auto-retry AccessDenied error from stopping transition to failed. !17862
- Fix 500 error when trying to resolve non-ASCII conflicts in the editor. !17962 - Fix 500 error when trying to resolve non-ASCII conflicts in the editor. !17962
- Don't capture trailing punctuation when autolinking. !17965
### Performance (1 change) ### Performance (1 change)
......
...@@ -127,7 +127,7 @@ Most issues will have labels for at least one of the following: ...@@ -127,7 +127,7 @@ Most issues will have labels for at least one of the following:
- Type: ~"feature proposal", ~bug, ~customer, etc. - Type: ~"feature proposal", ~bug, ~customer, etc.
- Subject: ~wiki, ~"container registry", ~ldap, ~api, ~frontend, etc. - Subject: ~wiki, ~"container registry", ~ldap, ~api, ~frontend, etc.
- Team: ~"CI/CD", ~Discussion, ~Edge, ~Platform, etc. - Team: ~"CI/CD", ~Discussion, ~Edge, ~Platform, etc.
- Priority: ~Deliverable, ~Stretch, ~"Next Patch Release" - Milestone: ~Deliverable, ~Stretch, ~"Next Patch Release"
All labels, their meaning and priority are defined on the All labels, their meaning and priority are defined on the
[labels page][labels-page]. [labels page][labels-page].
...@@ -186,10 +186,10 @@ indicate if an issue needs backend work, frontend work, or both. ...@@ -186,10 +186,10 @@ indicate if an issue needs backend work, frontend work, or both.
Team labels are always capitalized so that they show up as the first label for Team labels are always capitalized so that they show up as the first label for
any issue. any issue.
### Priority labels (~Deliverable, ~Stretch, ~"Next Patch Release") ### Milestone labels (~Deliverable, ~Stretch, ~"Next Patch Release")
Priority labels help us clearly communicate expectations of the work for the Milestone labels help us clearly communicate expectations of the work for the
release. There are two levels of priority labels: release. There are three levels of Milestone labels:
- ~Deliverable: Issues that are expected to be delivered in the current - ~Deliverable: Issues that are expected to be delivered in the current
milestone. milestone.
...@@ -204,16 +204,46 @@ Each issue scheduled for the current milestone should be labeled ~Deliverable ...@@ -204,16 +204,46 @@ Each issue scheduled for the current milestone should be labeled ~Deliverable
or ~"Stretch". Any open issue for a previous milestone should be labeled or ~"Stretch". Any open issue for a previous milestone should be labeled
~"Next Patch Release", or otherwise rescheduled to a different milestone. ~"Next Patch Release", or otherwise rescheduled to a different milestone.
### Severity labels (~S1, ~S2, etc.) ### Bug Priority labels (~P1, ~P2, ~P3 & etc.)
Severity labels help us clearly communicate the impact of a ~bug on users. Bug Priority labels help us define the time a ~bug fix should be completed. Priority determines how quickly the defect turnaround time must be. If there are multiple defects, the priority decides which defect has to be fixed immediately versus later.
This label documents the planned timeline & urgency which is used to measure against our actual SLA on delivering ~bug fixes.
| Label | Meaning | Example | | Label | Meaning | Estimate time to fix | Guidance |
|-------|------------------------------------------|---------| |-------|-----------------|------------------------------------------------------------------|----------|
| ~S1 | Feature broken, no workaround | Unable to create an issue | | ~P1 | Urgent Priority | The current release | |
| ~S2 | Feature broken, workaround unacceptable | Can push commits, but only via the command line | | ~P2 | High Priority | The next release | |
| ~S3 | Feature broken, workaround acceptable | Can create merge requests only from the Merge Requests page, not through the Issue | | ~P3 | Medium Priority | Within the next 3 releases (approx one quarter) | |
| ~S4 | Cosmetic issue | Label colors are incorrect / not being displayed | | ~P4 | Low Priority | Anything outside the next 3 releases (approx beyond one quarter) | The issue is prominent but does not impact user workflow and a workaround is documented |
#### Specific Priority guidance
| Label | Availability / Performance |
|-------|--------------------------------------------------------------|
| ~P1 | |
| ~P2 | The issue is (almost) guaranteed to occur in the near future |
| ~P3 | The issue is likely to occur in the near future |
| ~P4 | The issue _may_ occur but it's not likely |
### Bug Severity labels (~S1, ~S2, ~S3 & etc.)
Severity labels help us clearly communicate the impact of a ~bug on users.
| Label | Meaning | Impact of the defect | Example |
|-------|-------------------|-------------------------------------------------------|---------|
| ~S1 | Blocker | Outage, broken feature with no workaround | Unable to create an issue. Data corruption/loss. Security breach. |
| ~S2 | Critical Severity | Broken Feature, workaround too complex & unacceptable | Can push commits, but only via the command line. |
| ~S3 | Major Severity | Broken Feature, workaround acceptable | Can create merge requests only from the Merge Requests page, not through the Issue. |
| ~S4 | Low Severity | Functionality inconvenience or cosmetic issue | Label colors are incorrect / not being displayed. |
#### Specific Severity guidance
| Label | Security Impact |
|-------|-------------------------------------------------------------------|
| ~S1 | >50% customers impacted (possible company extinction level event) |
| ~S2 | Multiple customers impacted (but not apocalyptic) |
| ~S3 | A single customer impacted |
| ~S4 | No customer impact, or expected impact within 30 days |
### Label for community contributors (~"Accepting Merge Requests") ### Label for community contributors (~"Accepting Merge Requests")
......
...@@ -97,6 +97,12 @@ You can access a new installation with the login **`root`** and password **`5ive ...@@ -97,6 +97,12 @@ You can access a new installation with the login **`root`** and password **`5ive
GitLab is an open source project and we are very happy to accept community contributions. Please refer to [CONTRIBUTING.md](/CONTRIBUTING.md) for details. GitLab is an open source project and we are very happy to accept community contributions. Please refer to [CONTRIBUTING.md](/CONTRIBUTING.md) for details.
## Licensing
GitLab Community Edition (CE) is available freely under the MIT Expat license.
All third party components incorporated into the GitLab Software are licensed under the original license provided by the owner of the applicable component.
## Install a development environment ## Install a development environment
To work on GitLab itself, we recommend setting up your development environment with [the GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit). To work on GitLab itself, we recommend setting up your development environment with [the GitLab Development Kit](https://gitlab.com/gitlab-org/gitlab-development-kit).
......
...@@ -1427,7 +1427,7 @@ export default class Notes { ...@@ -1427,7 +1427,7 @@ export default class Notes {
const { discussion_html } = data; const { discussion_html } = data;
const lines = $(discussion_html).find('.line_holder'); const lines = $(discussion_html).find('.line_holder');
lines.addClass('fade-in'); lines.addClass('fade-in');
$container.find('tbody').prepend(lines); $container.find('.diff-content > table > tbody').prepend(lines);
const fileHolder = $container.find('.file-holder'); const fileHolder = $container.find('.file-holder');
$container.find('.line-holder-placeholder').remove(); $container.find('.line-holder-placeholder').remove();
syntaxHighlight(fileHolder); syntaxHighlight(fileHolder);
......
...@@ -19,7 +19,7 @@ function getSystemDate(systemUtcOffsetSeconds) { ...@@ -19,7 +19,7 @@ function getSystemDate(systemUtcOffsetSeconds) {
const date = new Date(); const date = new Date();
const localUtcOffsetMinutes = 0 - date.getTimezoneOffset(); const localUtcOffsetMinutes = 0 - date.getTimezoneOffset();
const systemUtcOffsetMinutes = systemUtcOffsetSeconds / 60; const systemUtcOffsetMinutes = systemUtcOffsetSeconds / 60;
date.setMinutes((date.getMinutes() - localUtcOffsetMinutes) + systemUtcOffsetMinutes); date.setMinutes(date.getMinutes() - localUtcOffsetMinutes + systemUtcOffsetMinutes);
return date; return date;
} }
...@@ -35,18 +35,36 @@ function formatTooltipText({ date, count }) { ...@@ -35,18 +35,36 @@ function formatTooltipText({ date, count }) {
return `${contribText}<br />${dateDayName} ${dateText}`; return `${contribText}<br />${dateDayName} ${dateText}`;
} }
const initColorKey = () => d3.scaleLinear().range(['#acd5f2', '#254e77']).domain([0, 3]); const initColorKey = () =>
d3
.scaleLinear()
.range(['#acd5f2', '#254e77'])
.domain([0, 3]);
export default class ActivityCalendar { export default class ActivityCalendar {
constructor(container, timestamps, calendarActivitiesPath, utcOffset = 0) { constructor(container, timestamps, calendarActivitiesPath, utcOffset = 0, firstDayOfWeek = 0) {
this.calendarActivitiesPath = calendarActivitiesPath; this.calendarActivitiesPath = calendarActivitiesPath;
this.clickDay = this.clickDay.bind(this); this.clickDay = this.clickDay.bind(this);
this.currentSelectedDate = ''; this.currentSelectedDate = '';
this.daySpace = 1; this.daySpace = 1;
this.daySize = 15; this.daySize = 15;
this.daySizeWithSpace = this.daySize + (this.daySpace * 2); this.daySizeWithSpace = this.daySize + this.daySpace * 2;
this.monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; this.monthNames = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'Jul',
'Aug',
'Sep',
'Oct',
'Nov',
'Dec',
];
this.months = []; this.months = [];
this.firstDayOfWeek = firstDayOfWeek;
// Loop through the timestamps to create a group of objects // Loop through the timestamps to create a group of objects
// The group of objects will be grouped based on the day of the week they are // The group of objects will be grouped based on the day of the week they are
...@@ -70,7 +88,7 @@ export default class ActivityCalendar { ...@@ -70,7 +88,7 @@ export default class ActivityCalendar {
// Create a new group array if this is the first day of the week // Create a new group array if this is the first day of the week
// or if is first object // or if is first object
if ((day === 0 && i !== 0) || i === 0) { if ((day === this.firstDayOfWeek && i !== 0) || i === 0) {
this.timestampsTmp.push([]); this.timestampsTmp.push([]);
group += 1; group += 1;
} }
...@@ -109,21 +127,30 @@ export default class ActivityCalendar { ...@@ -109,21 +127,30 @@ export default class ActivityCalendar {
} }
renderSvg(container, group) { renderSvg(container, group) {
const width = ((group + 1) * this.daySizeWithSpace) + this.getExtraWidthPadding(group); const width = (group + 1) * this.daySizeWithSpace + this.getExtraWidthPadding(group);
return d3.select(container) return d3
.select(container)
.append('svg') .append('svg')
.attr('width', width) .attr('width', width)
.attr('height', 167) .attr('height', 167)
.attr('class', 'contrib-calendar'); .attr('class', 'contrib-calendar');
}
dayYPos(day) {
return this.daySizeWithSpace * ((day + 7 - this.firstDayOfWeek) % 7);
} }
renderDays() { renderDays() {
this.svg.selectAll('g').data(this.timestampsTmp).enter().append('g') this.svg
.selectAll('g')
.data(this.timestampsTmp)
.enter()
.append('g')
.attr('transform', (group, i) => { .attr('transform', (group, i) => {
_.each(group, (stamp, a) => { _.each(group, (stamp, a) => {
if (a === 0 && stamp.day === 0) { if (a === 0 && stamp.day === 0) {
const month = stamp.date.getMonth(); const month = stamp.date.getMonth();
const x = (this.daySizeWithSpace * i) + 1 + this.daySizeWithSpace; const x = this.daySizeWithSpace * i + 1 + this.daySizeWithSpace;
const lastMonth = _.last(this.months); const lastMonth = _.last(this.months);
if ( if (
lastMonth == null || lastMonth == null ||
...@@ -133,86 +160,113 @@ export default class ActivityCalendar { ...@@ -133,86 +160,113 @@ export default class ActivityCalendar {
} }
} }
}); });
return `translate(${(this.daySizeWithSpace * i) + 1 + this.daySizeWithSpace}, 18)`; return `translate(${this.daySizeWithSpace * i + 1 + this.daySizeWithSpace}, 18)`;
}) })
.selectAll('rect') .selectAll('rect')
.data(stamp => stamp) .data(stamp => stamp)
.enter() .enter()
.append('rect') .append('rect')
.attr('x', '0') .attr('x', '0')
.attr('y', stamp => this.daySizeWithSpace * stamp.day) .attr('y', stamp => this.dayYPos(stamp.day))
.attr('width', this.daySize) .attr('width', this.daySize)
.attr('height', this.daySize) .attr('height', this.daySize)
.attr('fill', stamp => ( .attr(
stamp.count !== 0 ? this.color(Math.min(stamp.count, 40)) : '#ededed' 'fill',
)) stamp => (stamp.count !== 0 ? this.color(Math.min(stamp.count, 40)) : '#ededed'),
.attr('title', stamp => formatTooltipText(stamp)) )
.attr('class', 'user-contrib-cell js-tooltip') .attr('title', stamp => formatTooltipText(stamp))
.attr('data-container', 'body') .attr('class', 'user-contrib-cell js-tooltip')
.on('click', this.clickDay); .attr('data-container', 'body')
.on('click', this.clickDay);
} }
renderDayTitles() { renderDayTitles() {
const days = [ const days = [
{ {
text: 'M', text: 'M',
y: 29 + (this.daySizeWithSpace * 1), y: 29 + this.dayYPos(1),
}, { },
{
text: 'W', text: 'W',
y: 29 + (this.daySizeWithSpace * 3), y: 29 + this.dayYPos(2),
}, { },
{
text: 'F', text: 'F',
y: 29 + (this.daySizeWithSpace * 5), y: 29 + this.dayYPos(3),
}, },
]; ];
this.svg.append('g') this.svg
.append('g')
.selectAll('text') .selectAll('text')
.data(days) .data(days)
.enter() .enter()
.append('text') .append('text')
.attr('text-anchor', 'middle') .attr('text-anchor', 'middle')
.attr('x', 8) .attr('x', 8)
.attr('y', day => day.y) .attr('y', day => day.y)
.text(day => day.text) .text(day => day.text)
.attr('class', 'user-contrib-text'); .attr('class', 'user-contrib-text');
} }
renderMonths() { renderMonths() {
this.svg.append('g') this.svg
.append('g')
.attr('direction', 'ltr') .attr('direction', 'ltr')
.selectAll('text') .selectAll('text')
.data(this.months) .data(this.months)
.enter() .enter()
.append('text') .append('text')
.attr('x', date => date.x) .attr('x', date => date.x)
.attr('y', 10) .attr('y', 10)
.attr('class', 'user-contrib-text') .attr('class', 'user-contrib-text')
.text(date => this.monthNames[date.month]); .text(date => this.monthNames[date.month]);
} }
renderKey() { renderKey() {
const keyValues = ['no contributions', '1-9 contributions', '10-19 contributions', '20-29 contributions', '30+ contributions']; const keyValues = [
const keyColors = ['#ededed', this.colorKey(0), this.colorKey(1), this.colorKey(2), this.colorKey(3)]; 'no contributions',
'1-9 contributions',
'10-19 contributions',
'20-29 contributions',
'30+ contributions',
];
const keyColors = [
'#ededed',
this.colorKey(0),
this.colorKey(1),
this.colorKey(2),
this.colorKey(3),
];
this.svg.append('g') this.svg
.attr('transform', `translate(18, ${(this.daySizeWithSpace * 8) + 16})`) .append('g')
.attr('transform', `translate(18, ${this.daySizeWithSpace * 8 + 16})`)
.selectAll('rect') .selectAll('rect')
.data(keyColors) .data(keyColors)
.enter() .enter()
.append('rect') .append('rect')
.attr('width', this.daySize) .attr('width', this.daySize)
.attr('height', this.daySize) .attr('height', this.daySize)
.attr('x', (color, i) => this.daySizeWithSpace * i) .attr('x', (color, i) => this.daySizeWithSpace * i)
.attr('y', 0) .attr('y', 0)
.attr('fill', color => color) .attr('fill', color => color)
.attr('class', 'js-tooltip') .attr('class', 'js-tooltip')
.attr('title', (color, i) => keyValues[i]) .attr('title', (color, i) => keyValues[i])
.attr('data-container', 'body'); .attr('data-container', 'body');
} }
initColor() { initColor() {
const colorRange = ['#ededed', this.colorKey(0), this.colorKey(1), this.colorKey(2), this.colorKey(3)]; const colorRange = [
return d3.scaleThreshold().domain([0, 10, 20, 30]).range(colorRange); '#ededed',
this.colorKey(0),
this.colorKey(1),
this.colorKey(2),
this.colorKey(3),
];
return d3
.scaleThreshold()
.domain([0, 10, 20, 30])
.range(colorRange);
} }
clickDay(stamp) { clickDay(stamp) {
...@@ -227,14 +281,15 @@ export default class ActivityCalendar { ...@@ -227,14 +281,15 @@ export default class ActivityCalendar {
$('.user-calendar-activities').html(LOADING_HTML); $('.user-calendar-activities').html(LOADING_HTML);
axios.get(this.calendarActivitiesPath, { axios
params: { .get(this.calendarActivitiesPath, {
date, params: {
}, date,
responseType: 'text', },
}) responseType: 'text',
.then(({ data }) => $('.user-calendar-activities').html(data)) })
.catch(() => flash(__('An error occurred while retrieving calendar activity'))); .then(({ data }) => $('.user-calendar-activities').html(data))
.catch(() => flash(__('An error occurred while retrieving calendar activity')));
} else { } else {
this.currentSelectedDate = ''; this.currentSelectedDate = '';
$('.user-calendar-activities').html(''); $('.user-calendar-activities').html('');
......
...@@ -28,11 +28,12 @@ class Projects::RepositoriesController < Projects::ApplicationController ...@@ -28,11 +28,12 @@ class Projects::RepositoriesController < Projects::ApplicationController
end end
def assign_archive_vars def assign_archive_vars
@id = params[:id] if params[:id]
@ref, @filename = extract_ref(params[:id])
return unless @id else
@ref = params[:ref]
@ref, @filename = extract_ref(@id) @filename = nil
end
rescue InvalidPathError rescue InvalidPathError
render_404 render_404
end end
......
...@@ -8,9 +8,10 @@ module Projects ...@@ -8,9 +8,10 @@ module Projects
template_name = params.delete(:template_name) template_name = params.delete(:template_name)
file = Gitlab::ProjectTemplate.find(template_name).file file = Gitlab::ProjectTemplate.find(template_name).file
override_params = params.dup
params[:file] = file params[:file] = file
GitlabProjectsImportService.new(current_user, params).execute GitlabProjectsImportService.new(current_user, params, override_params).execute
ensure ensure
file&.close file&.close
......
---
title: Improve tooltips in collapsed right sidebar
merge_request: 17714
author:
type: changed
---
title: Add index to file_store on ci_job_artifacts
merge_request: 18444
author:
type: performance
---
title: Fix specifying a non-default ref when requesting an archive using the legacy
URL
merge_request: 18468
author:
type: fixed
---
title: Respect visibility options and description when importing project from template
merge_request: 18473
author:
type: fixed
---
title: Refactored activity calendar
merge_request: 18469
author: Enrico Scholz
type: changed
---
title: Don't include lfs_file_locks data in export bundle
merge_request: 18495
author:
type: fixed
---
title: Use the GitLab version as part of the appearances cache key
merge_request:
author:
type: fixed
class AddIndexToCiJobArtifactsFileStore < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :ci_job_artifacts, :file_store
end
def down
remove_index :ci_job_artifacts, :file_store if index_exists?(:ci_job_artifacts, :file_store)
end
end
...@@ -456,6 +456,7 @@ ActiveRecord::Schema.define(version: 20180419031622) do ...@@ -456,6 +456,7 @@ ActiveRecord::Schema.define(version: 20180419031622) do
end end
add_index "ci_job_artifacts", ["expire_at", "job_id"], name: "index_ci_job_artifacts_on_expire_at_and_job_id", using: :btree add_index "ci_job_artifacts", ["expire_at", "job_id"], name: "index_ci_job_artifacts_on_expire_at_and_job_id", using: :btree
add_index "ci_job_artifacts", ["file_store"], name: "index_ci_job_artifacts_on_file_store", using: :btree
add_index "ci_job_artifacts", ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, using: :btree add_index "ci_job_artifacts", ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, using: :btree
add_index "ci_job_artifacts", ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree add_index "ci_job_artifacts", ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree
......
...@@ -651,6 +651,47 @@ gitlab_rails['redis_sentinels'] = [ ...@@ -651,6 +651,47 @@ gitlab_rails['redis_sentinels'] = [
Omnibus GitLab configures some things behind the curtains to make the sysadmins' Omnibus GitLab configures some things behind the curtains to make the sysadmins'
lives easier. If you want to know what happens underneath keep reading. lives easier. If you want to know what happens underneath keep reading.
### Running multiple Redis clusters
GitLab supports running [separate Redis clusters for different persistent
classes](https://docs.gitlab.com/omnibus/settings/redis.html#running-with-multiple-redis-instances):
cache, queues, and shared_state. To make this work with Sentinel:
1. Set the appropriate variable in `/etc/gitlab/gitlab.rb` for each instance you are using:
```ruby
gitlab_rails['redis_cache_instance'] = REDIS_CACHE_URL
gitlab_rails['redis_queues_instance'] = REDIS_QUEUES_URL
gitlab_rails['redis_shared_state_instance'] = REDIS_SHARED_STATE_URL
```
**Note**: Redis URLs should be in the format: `redis://:PASSWORD@SENTINEL_MASTER_NAME`
1. PASSWORD is the plaintext password for the Redis instance
2. SENTINEL_MASTER_NAME is the Sentinel master name (e.g. `gitlab-redis-cache`)
1. Include an array of hashes with host/port combinations, such as the following:
```ruby
gitlab_rails['redis_cache_sentinels'] = [
{ host: REDIS_CACHE_SENTINEL_HOST, port: PORT1 },
{ host: REDIS_CACHE_SENTINEL_HOST2, port: PORT2 }
]
gitlab_rails['redis_queues_sentinels'] = [
{ host: REDIS_QUEUES_SENTINEL_HOST, port: PORT1 },
{ host: REDIS_QUEUES_SENTINEL_HOST2, port: PORT2 }
]
gitlab_rails['redis_shared_state_sentinels'] = [
{ host: SHARED_STATE_SENTINEL_HOST, port: PORT1 },
{ host: SHARED_STATE_SENTINEL_HOST2, port: PORT2 }
]
```
1. Note that for each persistence class, GitLab will default to using the
configuration specified in `gitlab_rails['redis_sentinels']` unless
overriden by the settings above.
1. Be sure to include BOTH configuration options for each persistent classes. For example,
if you choose to configure a cache instance, you must specify both `gitlab_rails['redis_cache_instance']`
and `gitlab_rails['redis_cache_sentinels']` for GitLab to generate the proper configuration files.
1. Run `gitlab-ctl reconfigure`
### Control running services ### Control running services
In the previous example, we've used `redis_sentinel_role` and In the previous example, we've used `redis_sentinel_role` and
......
...@@ -31,6 +31,9 @@ container_scanning: ...@@ -31,6 +31,9 @@ container_scanning:
- chmod +x clair-scanner - chmod +x clair-scanner
- touch clair-whitelist.yml - touch clair-whitelist.yml
- while( ! wget -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; done - while( ! wget -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; done
- retries=0
- echo "Waiting for clair daemon to start"
- while( ! wget -T 10 -q -O /dev/null http://docker:6060/v1/namespaces ) ; do sleep 1 ; echo -n "." ; if [ $retries -eq 10 ] ; then echo " Timeout, aborting." ; exit 1 ; fi ; retries=$(($retries+1)) ; done
- ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true - ./clair-scanner -c http://docker:6060 --ip $(hostname -i) -r gl-sast-container-report.json -l clair.log -w clair-whitelist.yml ${CI_APPLICATION_REPOSITORY}:${CI_APPLICATION_TAG} || true
artifacts: artifacts:
paths: [gl-sast-container-report.json] paths: [gl-sast-container-report.json]
......
# Frontend Development Process
You can find more about the organization of the frontend team in the [handbook](https://about.gitlab.com/handbook/frontend/).
## Development Checklist
The idea is to remind us about specific topics during the time we build a new feature or start something. This is a common practice in other industries (like pilots) that also use standardised checklists to reduce problems early on.
Copy the content over to your issue or merge request and if something doesn't apply simply remove it from your current list.
This checklist is intended to help us during development of bigger features/refactorings, it's not a "use it always and every point always matches" list.
Please use your best judgement when to use it and please contribute new points through merge requests if something comes to your mind.
---
### Frontend development
#### Planning development
- [ ] Check the current set weight of the issue, does it fit your estimate?
- [ ] Are all [departments](https://about.gitlab.com/handbook/engineering/#engineering-teams) that are needed from your perspective already involved in the issue? (For example is UX missing?)
- [ ] Is the specification complete? Are you missing decisions? How about error handling/defaults/edge cases? Take your time to understand the needed implementation and go through its flow.
- [ ] Are all necessary UX specifications available that you will need in order to implement? Are there new UX components/patterns in the designs? Then contact the UI component team early on. How should error messages or validation be handled?
- [ ] **Library usage** Use Vuex as soon as you have even a medium state to manage, use Vue router if you need to have different views internally and want to link from the outside. Check what libraries we already have for which occassions.
- [ ] **Plan your implementation:**
- [ ] **Architecture plan:** Create a plan aligned with GitLab's architecture, how you are going to do the implementation, for example Vue application setup and its components (through [onion skinning](https://gitlab.com/gitlab-org/gitlab-ce/issues/35873#note_39994091)), Store structure and data flow, which existing Vue components can you reuse. Its a good idea to go through your plan with another engineer to refine it.
- [ ] **Backend:** The best way is to kickoff the implementation in a call and discuss with the assigned Backend engineer what you will need from the backend and also when. Can you reuse existing API's? How is the performance with the planned architecture? Maybe create together a JSON mock object to already start with development.
- [ ] **Communication:** It also makes sense to have for bigger features an own slack channel (normally called #f_{feature_name}) and even weekly demo calls with all people involved.
- [ ] **Dependency Plan:** Are there big dependencies in the plan between you and others, then maybe create an execution diagram to show what is blocking which part and the order of the different parts.
- [ ] **Task list:** Create a simple checklist of the subtasks that are needed for the implementation, also consider creating even sub issues. (for example show a comment, delete a comment, update a comment, etc.). This helps you and also everyone else following the implementation
- [ ] **Keep it small** To make it easier for you and also all reviewers try to keep merge requests small and merge into a feature branch if needed. To accomplish that you need to plan that from the start. Different methods are:
- [ ] **Skeleton based plan** Start with an MR that has the skeleton of the components with placeholder content. In following MRs you can fill the components with interactivity. This also makes it easier to spread out development on multiple people.
- [ ] **Cookie Mode** Think about hiding the feature behind a cookie flag if the implementation is on top of existing features
- [ ] **New route** Are you refactoring something big then you might consider adding a new route where you implement the new feature and when finished delete the current route and rename the new one. (for example 'merge_request' and 'new_merge_request')
- [ ] **Setup** Is there any specific setup needed for your implementation (for example a kubernetes cluster)? Then let everyone know if it is not already mentioned where they can find documentation (if it doesn't exist - create it)
- [ ] **Security** Are there any new security relevant implementations? Then please contact the security team for an app security review. If you are not sure ask our [domain expert](https://about.gitlab.com/handbook/frontend/#frontend-domain-experts)
#### During development
- [ ] Check off tasks on your created task list to keep everyone updated on the progress
- [ ] [Share your work early with reviewers/maintainers](#share-your-work-early)
- [ ] Share your work with UXer and Product Manager with Screenshots and/or [GIF's](https://about.gitlab.com/handbook/product/making-gifs/). They are easy to create for you and keep them up to date.
- [ ] If you are blocked on something let everyone on the issue know through a comment.
- [ ] Are you unable to work on this issue for a longer period of time, also let everyone know.
- [ ] **Documentation** Update/add docs for the new feature, see `docs/`. Ping one of the documentation experts/reviewers
#### Finishing development + Review
- [ ] **Keep it in the scope** Try to focus on the actual scope and avoid a scope creep during review and keep new things to new issues.
- [ ] **Performance** Have you checked performance? For example do the same thing with 500 comments instead of 1. Document the tests and possible findings in the MR so a reviewer can directly see it.
- [ ] Have you tested with a variety of our [supported browsers](../../install/requirements.md#supported-web-browsers)? You can use [browserstack](https://www.browserstack.com/) to be able to access a wide variety of browsers and operating systems.
- [ ] Did you check the mobile view?
- [ ] Check the built webpack bundle (For the report run `WEBPACK_REPORT=true gdk run`, then open `webpack-report/index.html`) if we have unnecessary bloat due to wrong references, including libraries multiple times, etc.. If you need help contact the webpack [domain expert](https://about.gitlab.com/handbook/frontend/#frontend-domain-experts)
- [ ] **Tests** Not only greenfield tests - Test also all bad cases that come to your mind.
- [ ] If you have multiple MR's then also smoke test against the final merge.
- [ ] Are there any big changes on how and especially how frequently we use the API then let production know about it
- [ ] Smoke test of the RC on dev., staging., canary deployments and .com
- [ ] Follow up on issues that came out of the review. Create isssues for discovered edge cases that should be covered in future iterations.
---
### Share your work early
1. Before writing code, ensure your vision of the architecture is aligned with
GitLab's architecture.
1. Add a diagram to the issue and ask a frontend architect in the slack channel `#fe_architectural` about it.
![Diagram of Issue Boards Architecture](img/boards_diagram.png)
1. Don't take more than one week between starting work on a feature and
sharing a Merge Request with a reviewer or a maintainer.
### Vue features
1. Follow the steps in [Vue.js Best Practices](vue.md)
1. Follow the style guide.
1. Only a handful of people are allowed to merge Vue related features.
Reach out to one of Vue experts early in this process.
...@@ -5,11 +5,15 @@ across GitLab's frontend team. ...@@ -5,11 +5,15 @@ across GitLab's frontend team.
## Overview ## Overview
GitLab is built on top of [Ruby on Rails][rails] using [Haml][haml] with GitLab is built on top of [Ruby on Rails][rails] using [Haml][haml] and also a JavaScript based Frontend with [Vue.js][vue].
[Hamlit][hamlit]. Be wary of [the limitations that come with using Be wary of [the limitations that come with using Hamlit][hamlit-limits]. We also use [SCSS][scss] and plain JavaScript with
Hamlit][hamlit-limits]. We also use [SCSS][scss] and plain JavaScript with modern ECMAScript standards supported through [Babel][babel] and ES module support through [webpack][webpack].
modern ECMAScript standards supported through [Babel][babel] and ES module
support through [webpack][webpack]. ### Javascript development
[Vue.js][vue] is used for particularly advanced, dynamic elements and based on previous iterations [jQuery][jquery] is used in lot of places through the application's JavaScript.
We also use [Axios][axios] to handle all of our network requests.
We also utilize [webpack][webpack] to handle the bundling, minification, and We also utilize [webpack][webpack] to handle the bundling, minification, and
compression of our assets. compression of our assets.
...@@ -18,61 +22,29 @@ Working with our frontend assets requires Node (v6.0 or greater) and Yarn ...@@ -18,61 +22,29 @@ Working with our frontend assets requires Node (v6.0 or greater) and Yarn
(v1.2 or greater). You can find information on how to install these on our (v1.2 or greater). You can find information on how to install these on our
[installation guide][install]. [installation guide][install].
[jQuery][jquery] is used throughout the application's JavaScript, with
[Vue.js][vue] for particularly advanced, dynamic elements.
We also use [Axios][axios] to handle all of our network requests.
### Browser Support ### Browser Support
For our currently-supported browsers, see our [requirements][requirements]. For our currently-supported browsers, see our [requirements][requirements].
--- ---
## Development Process ## [Development Process](development_process.md)
How we plan and execute the work on the frontend.
### Share your work early
1. Before writing code guarantee your vision of the architecture is aligned with
GitLab's architecture.
1. Add a diagram to the issue and ask a Frontend Architecture about it.
![Diagram of Issue Boards Architecture](img/boards_diagram.png)
1. Don't take more than one week between starting work on a feature and
sharing a Merge Request with a reviewer or a maintainer.
### Vue features
1. Follow the steps in [Vue.js Best Practices](vue.md)
1. Follow the style guide.
1. Only a handful of people are allowed to merge Vue related features.
Reach out to one of Vue experts early in this process.
---
## [Architecture](architecture.md) ## [Architecture](architecture.md)
How we go about making fundamental design decisions in GitLab's frontend team How we go about making fundamental design decisions in GitLab's frontend team
or make changes to our frontend development guidelines. or make changes to our frontend development guidelines.
---
## [Testing](../testing_guide/frontend_testing.md) ## [Testing](../testing_guide/frontend_testing.md)
How we write frontend tests, run the GitLab test suite, and debug test related How we write frontend tests, run the GitLab test suite, and debug test related
issues. issues.
---
## [Design Patterns](design_patterns.md) ## [Design Patterns](design_patterns.md)
Common JavaScript design patterns in GitLab's codebase. Common JavaScript design patterns in GitLab's codebase.
---
## [Vue.js Best Practices](vue.md) ## [Vue.js Best Practices](vue.md)
Vue specific design patterns and practices. Vue specific design patterns and practices.
---
## [Axios](axios.md) ## [Axios](axios.md)
Axios specific practices and gotchas. Axios specific practices and gotchas.
......
...@@ -67,9 +67,9 @@ and examples in [the `qa/` directory][instance-qa-examples]. ...@@ -67,9 +67,9 @@ and examples in [the `qa/` directory][instance-qa-examples].
## Where can I ask for help? ## Where can I ask for help?
You can ask question in the `#qa` channel on Slack (GitLab internal) or you can You can ask question in the `#quality` channel on Slack (GitLab internal) or
find an issue you would like to work on in [the issue tracker][gitlab-qa-issues] you can find an issue you would like to work on in
and start a new discussion there. [the issue tracker][gitlab-qa-issues] and start a new discussion there.
[omnibus-gitlab]: https://gitlab.com/gitlab-org/omnibus-gitlab [omnibus-gitlab]: https://gitlab.com/gitlab-org/omnibus-gitlab
[gitlab-qa]: https://gitlab.com/gitlab-org/gitlab-qa [gitlab-qa]: https://gitlab.com/gitlab-org/gitlab-qa
......
...@@ -70,7 +70,7 @@ In case you want to point a root domain (`example.com`) to your ...@@ -70,7 +70,7 @@ In case you want to point a root domain (`example.com`) to your
GitLab Pages site, deployed to `namespace.gitlab.io`, you need to GitLab Pages site, deployed to `namespace.gitlab.io`, you need to
log into your domain's admin control panel and add a DNS `A` record log into your domain's admin control panel and add a DNS `A` record
pointing your domain to Pages' server IP address. For projects on pointing your domain to Pages' server IP address. For projects on
GitLab.com, this IP is `52.167.214.135`. For projects leaving in GitLab.com, this IP is `52.167.214.135`. For projects living in
other GitLab instances (CE or EE), please contact your sysadmin other GitLab instances (CE or EE), please contact your sysadmin
asking for this information (which IP address is Pages server asking for this information (which IP address is Pages server
running on your instance). running on your instance).
......
...@@ -27,8 +27,6 @@ project_tree: ...@@ -27,8 +27,6 @@ project_tree:
- :releases - :releases
- project_members: - project_members:
- :user - :user
- lfs_file_locks:
- :user
- merge_requests: - merge_requests:
- notes: - notes:
- :author - :author
......
namespace :gitlab do namespace :gitlab do
desc "GitLab | Setup production application" desc "GitLab | Setup production application"
task setup: :gitlab_environment do task setup: :gitlab_environment do
check_gitaly_connection
setup_db setup_db
end end
def check_gitaly_connection
Gitlab.config.repositories.storages.each do |name, _details|
Gitlab::GitalyClient::ServerService.new(name).info
end
rescue GRPC::Unavailable => ex
puts "Failed to connect to Gitaly...".color(:red)
puts "Error: #{ex}"
exit 1
end
def setup_db def setup_db
warn_user_is_not_gitlab warn_user_is_not_gitlab
......
...@@ -115,8 +115,8 @@ from within the `qa` directory. ...@@ -115,8 +115,8 @@ from within the `qa` directory.
## Where to ask for help? ## Where to ask for help?
If you need more information, ask for help on `#qa` channel on Slack (GitLab If you need more information, ask for help on `#quality` channel on Slack
Team only). (internal, GitLab Team only).
If you are not a Team Member, and you still need help to contribute, please If you are not a Team Member, and you still need help to contribute, please
open an issue in GitLab QA issue tracker. open an issue in GitLab QA issue tracker.
...@@ -31,7 +31,7 @@ module QA ...@@ -31,7 +31,7 @@ module QA
current changes in this merge request. current changes in this merge request.
For more help see documentation in `qa/page/README.md` file or For more help see documentation in `qa/page/README.md` file or
ask for help on #qa channel on Slack (GitLab Team only). ask for help on #quality channel on Slack (GitLab Team only).
If you are not a Team Member, and you still need help to If you are not a Team Member, and you still need help to
contribute, please open an issue in GitLab QA issue tracker. contribute, please open an issue in GitLab QA issue tracker.
......
...@@ -40,6 +40,30 @@ describe Projects::RepositoriesController do ...@@ -40,6 +40,30 @@ describe Projects::RepositoriesController do
expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with("git-archive:") expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with("git-archive:")
end end
it 'handles legacy queries with the ref specified as ref in params' do
get :archive, namespace_id: project.namespace, project_id: project, ref: 'feature', format: 'zip'
expect(response).to have_gitlab_http_status(200)
expect(assigns(:ref)).to eq('feature')
expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with("git-archive:")
end
it 'handles legacy queries with the ref specified as id in params' do
get :archive, namespace_id: project.namespace, project_id: project, id: 'feature', format: 'zip'
expect(response).to have_gitlab_http_status(200)
expect(assigns(:ref)).to eq('feature')
expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with("git-archive:")
end
it 'prioritizes the id param over the ref param when both are specified' do
get :archive, namespace_id: project.namespace, project_id: project, id: 'feature', ref: 'feature_conflict', format: 'zip'
expect(response).to have_gitlab_http_status(200)
expect(assigns(:ref)).to eq('feature')
expect(response.header[Gitlab::Workhorse::SEND_DATA_HEADER]).to start_with("git-archive:")
end
context "when the service raises an error" do context "when the service raises an error" do
before do before do
allow(Gitlab::Workhorse).to receive(:send_git_archive).and_raise("Archive failed") allow(Gitlab::Workhorse).to receive(:send_git_archive).and_raise("Archive failed")
......
...@@ -5,7 +5,7 @@ describe 'Merge request > User resolves diff notes and discussions', :js do ...@@ -5,7 +5,7 @@ describe 'Merge request > User resolves diff notes and discussions', :js do
let(:user) { project.creator } let(:user) { project.creator }
let(:guest) { create(:user) } let(:guest) { create(:user) }
let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") } let(:merge_request) { create(:merge_request_with_diffs, source_project: project, author: user, title: "Bug NS-04") }
let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request) } let!(:note) { create(:diff_note_on_merge_request, project: project, noteable: merge_request, note: "| Markdown | Table |\n|-------|---------|\n| first | second |") }
let(:path) { "files/ruby/popen.rb" } let(:path) { "files/ruby/popen.rb" }
let(:position) do let(:position) do
Gitlab::Diff::Position.new( Gitlab::Diff::Position.new(
...@@ -111,6 +111,15 @@ describe 'Merge request > User resolves diff notes and discussions', :js do ...@@ -111,6 +111,15 @@ describe 'Merge request > User resolves diff notes and discussions', :js do
expect(page.find(".line-holder-placeholder")).to be_visible expect(page.find(".line-holder-placeholder")).to be_visible
expect(page.find(".timeline-content #note_#{note.id}")).to be_visible expect(page.find(".timeline-content #note_#{note.id}")).to be_visible
end end
it 'renders tables in lazy-loaded resolved diff dicussions' do
find(".timeline-content .discussion[data-discussion-id='#{note.discussion_id}'] .discussion-toggle-button").click
wait_for_requests
expect(page.find(".timeline-content #note_#{note.id}")).not_to have_css(".line_holder")
expect(page.find(".timeline-content #note_#{note.id}")).to have_css("tr", count: 2)
end
end end
describe 'side-by-side view' do describe 'side-by-side view' do
......
...@@ -576,12 +576,6 @@ PrometheusMetric: ...@@ -576,12 +576,6 @@ PrometheusMetric:
- title - title
- query - query
- group - group
LfsFileLock:
- id
- path
- user_id
- project_id
- created_at
Badge: Badge:
- id - id
- link_url - link_url
......
...@@ -32,6 +32,7 @@ describe EntityDateHelper do ...@@ -32,6 +32,7 @@ describe EntityDateHelper do
end end
it 'converts 86560 seconds' do it 'converts 86560 seconds' do
Rails.logger.debug date_helper_class.inspect
expect(date_helper_class.distance_of_time_as_hash(86560)).to eq(days: 1, mins: 2, seconds: 40) expect(date_helper_class.distance_of_time_as_hash(86560)).to eq(days: 1, mins: 2, seconds: 40)
end end
......
...@@ -7,7 +7,7 @@ describe Projects::CreateFromTemplateService do ...@@ -7,7 +7,7 @@ describe Projects::CreateFromTemplateService do
path: user.to_param, path: user.to_param,
template_name: 'rails', template_name: 'rails',
description: 'project description', description: 'project description',
visibility_level: Gitlab::VisibilityLevel::PRIVATE visibility_level: Gitlab::VisibilityLevel::PUBLIC
} }
end end
...@@ -24,7 +24,23 @@ describe Projects::CreateFromTemplateService do ...@@ -24,7 +24,23 @@ describe Projects::CreateFromTemplateService do
expect(project).to be_saved expect(project).to be_saved
expect(project.scheduled?).to be(true) expect(project.scheduled?).to be(true)
expect(project.description).to match('project description') end
expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
context 'the result project' do
before do
Sidekiq::Testing.inline! do
@project = subject.execute
end
@project.reload
end
it 'overrides template description' do
expect(@project.description).to match('project description')
end
it 'overrides template visibility_level' do
expect(@project.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC)
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment