Commit f024fd2b authored by Yorick Peterse's avatar Yorick Peterse

Merge branch 'master' into 8-7-stable

parents 152b5826 59466a47
...@@ -7,21 +7,44 @@ exclude: ...@@ -7,21 +7,44 @@ exclude:
- 'app/assets/stylesheets/pages/emojis.scss' - 'app/assets/stylesheets/pages/emojis.scss'
linters: linters:
# Reports when you use improper spacing around ! (the "bang") in !default,
# !global, !important, and !optional flags.
BangFormat: BangFormat:
enabled: false enabled: false
# Whether or not to prefer `border: 0` over `border: none`.
BorderZero: BorderZero:
enabled: false enabled: false
# Reports when you define a rule set using a selector with chained classes
# (a.k.a. adjoining classes).
ChainedClasses:
enabled: false
# Prefer hexadecimal color codes over color keywords.
# (e.g. `color: green` is a color keyword)
ColorKeyword: ColorKeyword:
enabled: false enabled: false
# Prefer color literals (keywords or hexadecimal codes) to be used only in
# variable declarations. They should be referred to via variables everywhere
# else.
ColorVariable: ColorVariable:
enabled: false enabled: false
# Which form of comments to prefer in CSS.
Comment: Comment:
enabled: false enabled: false
# Reports @debug statements (which you probably left behind accidentally).
DebugStatement:
enabled: false
# Rule sets should be ordered as follows:
# - @extend declarations
# - @include declarations without inner @content
# - properties, @include declarations with inner @content
# - nested rule sets.
DeclarationOrder: DeclarationOrder:
enabled: false enabled: false
...@@ -32,15 +55,25 @@ linters: ...@@ -32,15 +55,25 @@ linters:
DisableLinterReason: DisableLinterReason:
enabled: true enabled: true
# Reports when you define the same property twice in a single rule set.
DuplicateProperty: DuplicateProperty:
enabled: false enabled: false
# Separate rule, function, and mixin declarations with empty lines.
EmptyLineBetweenBlocks: EmptyLineBetweenBlocks:
enabled: false enabled: false
# Reports when you have an empty rule set.
EmptyRule: EmptyRule:
enabled: false enabled: false
# Reports when you have an @extend directive.
ExtendDirective:
enabled: false
# Files should always have a final newline. This results in better diffs
# when adding lines to the file, since SCM systems such as git won't
# think that you touched the last line.
FinalNewline: FinalNewline:
enabled: false enabled: false
...@@ -53,12 +86,17 @@ linters: ...@@ -53,12 +86,17 @@ linters:
HexNotation: HexNotation:
enabled: true enabled: true
# Avoid using ID selectors.
IdSelector: IdSelector:
enabled: false enabled: false
# The basenames of @imported SCSS partials should not begin with an
# underscore and should not include the filename extension.
ImportPath: ImportPath:
enabled: false enabled: false
# Avoid using !important in properties. It is usually indicative of a
# misunderstanding of CSS specificity and can lead to brittle code.
ImportantRule: ImportantRule:
enabled: false enabled: false
...@@ -67,33 +105,51 @@ linters: ...@@ -67,33 +105,51 @@ linters:
enabled: true enabled: true
width: 2 width: 2
# Don't write leading zeros for numeric values with a decimal point.
LeadingZero: LeadingZero:
enabled: false enabled: false
# Reports when you define the same selector twice in a single sheet.
MergeableSelector: MergeableSelector:
enabled: false enabled: false
# Functions, mixins, variables, and placeholders should be declared
# with all lowercase letters and hyphens instead of underscores.
NameFormat: NameFormat:
enabled: false enabled: false
# Avoid nesting selectors too deeply.
NestingDepth: NestingDepth:
enabled: false enabled: false
# Always use placeholder selectors in @extend.
PlaceholderInExtend: PlaceholderInExtend:
enabled: false enabled: false
# Sort properties in a strict order.
PropertySortOrder: PropertySortOrder:
enabled: false enabled: false
# Reports when you use an unknown or disabled CSS property
# (ignoring vendor-prefixed properties).
PropertySpelling: PropertySpelling:
enabled: false enabled: false
# Configure which units are allowed for property values.
PropertyUnits:
enabled: false
# Pseudo-elements, like ::before, and ::first-letter, should be declared
# with two colons. Pseudo-classes, like :hover and :first-child, should
# be declared with one colon.
PseudoElement: PseudoElement:
enabled: false enabled: false
# Avoid qualifying elements in selectors (also known as "tag-qualifying").
QualifyingElement: QualifyingElement:
enabled: false enabled: false
# Don't write selectors with a depth of applicability greater than 3.
SelectorDepth: SelectorDepth:
enabled: false enabled: false
...@@ -113,9 +169,12 @@ linters: ...@@ -113,9 +169,12 @@ linters:
enabled: true enabled: true
allow_single_line_rule_sets: true allow_single_line_rule_sets: true
# Split selectors onto separate lines after each comma, and have each
# individual selector occupy a single line.
SingleLinePerSelector: SingleLinePerSelector:
enabled: false enabled: false
# Commas in lists should be followed by a space.
SpaceAfterComma: SpaceAfterComma:
enabled: false enabled: false
...@@ -128,29 +187,75 @@ linters: ...@@ -128,29 +187,75 @@ linters:
# colon. # colon.
SpaceAfterPropertyName: SpaceAfterPropertyName:
enabled: true enabled: true
# Variables should be formatted with a single space separating the colon
# from the variable's value.
SpaceAfterVariableColon:
enabled: false
# Variables should be formatted with no space between the name and the
# colon.
SpaceAfterVariableName:
enabled: false
# Operators should be formatted with a single space on both sides of an
# infix operator.
SpaceAroundOperator: SpaceAroundOperator:
enabled: false enabled: false
# Opening braces should be preceded by a single space. # Opening braces should be preceded by a single space.
SpaceBeforeBrace: SpaceBeforeBrace:
enabled: true enabled: true
# Parentheses should not be padded with spaces.
SpaceBetweenParens:
enabled: false
# Enforces that string literals should be written with a consistent form
# of quotes (single or double).
StringQuotes: StringQuotes:
enabled: false enabled: false
# Property values, @extend, @include, and @import directives, and variable
# declarations should always end with a semicolon.
TrailingSemicolon: TrailingSemicolon:
enabled: false enabled: false
# Reports lines containing trailing whitespace.
TrailingWhitespace: TrailingWhitespace:
enabled: false enabled: false
# Don't write trailing zeros for numeric values with a decimal point.
TrailingZero:
enabled: false
# Don't use the `all` keyword to specify transition properties.
TransitionAll:
enabled: false
# Numeric values should not contain unnecessary fractional portions.
UnnecessaryMantissa: UnnecessaryMantissa:
enabled: false enabled: false
# Do not use parent selector references (&) when they would otherwise
# be unnecessary.
UnnecessaryParentReference: UnnecessaryParentReference:
enabled: false enabled: false
# URLs should be valid and not contain protocols or domain names.
UrlFormat:
enabled: false
# URLs should always be enclosed within quotes.
UrlQuotes:
enabled: false
# Properties, like color and font, are easier to read and maintain
# when defined using variables rather than literals.
VariableForProperty:
enabled: false
# Avoid vendor prefixes. Or rather: don't write them yourself.
VendorPrefix: VendorPrefix:
enabled: false enabled: false
......
...@@ -19,6 +19,8 @@ v 8.7.0 (unreleased) ...@@ -19,6 +19,8 @@ v 8.7.0 (unreleased)
- Fix creation of merge requests for orphaned branches (Stan Hu) - Fix creation of merge requests for orphaned branches (Stan Hu)
- Fall back to `In-Reply-To` and `References` headers when sub-addressing is not available (David Padilla) - Fall back to `In-Reply-To` and `References` headers when sub-addressing is not available (David Padilla)
- Remove "Congratulations!" tweet button on newly-created project. (Connor Shea) - Remove "Congratulations!" tweet button on newly-created project. (Connor Shea)
- Improved UX of the navigation sidebar
- Build status notifications
v 8.6.4 v 8.6.4
- Don't attempt to fetch any tags from a forked repo (Stan Hu) - Don't attempt to fetch any tags from a forked repo (Stan Hu)
......
...@@ -364,6 +364,11 @@ class Repository ...@@ -364,6 +364,11 @@ class Repository
expire_tag_count_cache expire_tag_count_cache
end end
def before_import
expire_emptiness_caches
expire_exists_cache
end
# Runs code after a repository has been forked/imported. # Runs code after a repository has been forked/imported.
def after_import def after_import
expire_emptiness_caches expire_emptiness_caches
......
...@@ -43,17 +43,21 @@ class GitPushService < BaseService ...@@ -43,17 +43,21 @@ class GitPushService < BaseService
@push_commits = @project.repository.commits_between(params[:oldrev], params[:newrev]) @push_commits = @project.repository.commits_between(params[:oldrev], params[:newrev])
process_commit_messages process_commit_messages
end end
# Checks if the main language has changed in the project and if so
# it updates it accordingly
update_main_language
# Update merge requests that may be affected by this push. A new branch # Update merge requests that may be affected by this push. A new branch
# could cause the last commit of a merge request to change. # could cause the last commit of a merge request to change.
update_merge_requests update_merge_requests
# Checks if the main language has changed in the project and if so
# it updates it accordingly
update_main_language
perform_housekeeping perform_housekeeping
end end
def update_main_language def update_main_language
return unless is_default_branch?
return unless push_to_new_branch? || push_to_existing_branch?
current_language = @project.repository.main_language current_language = @project.repository.main_language
unless current_language == @project.main_language unless current_language == @project.main_language
......
...@@ -46,6 +46,8 @@ module Projects ...@@ -46,6 +46,8 @@ module Projects
def import_data def import_data
return unless has_importer? return unless has_importer?
project.repository.before_import
unless importer.execute unless importer.execute
raise Error, 'The remote data could not be imported.' raise Error, 'The remote data could not be imported.'
end end
......
...@@ -261,13 +261,13 @@ tree and traverse it. ...@@ -261,13 +261,13 @@ tree and traverse it.
- Run the following check command to make sure that the LDAP settings are - Run the following check command to make sure that the LDAP settings are
correct and GitLab can see your users: correct and GitLab can see your users:
```bash ```bash
# For Omnibus installations # For Omnibus installations
sudo gitlab-rake gitlab:ldap:check sudo gitlab-rake gitlab:ldap:check
# For installations from source # For installations from source
sudo -u git -H bundle exec rake gitlab:ldap:check RAILS_ENV=production sudo -u git -H bundle exec rake gitlab:ldap:check RAILS_ENV=production
``` ```
### Connection Refused ### Connection Refused
......
# GitLab LDAP integration # GitLab LDAP integration
This document was moved under [`administration/auth/ldap`](administration/auth/ldap.md). This document was moved under [`administration/auth/ldap`](../administration/auth/ldap.md).
...@@ -612,6 +612,20 @@ describe Repository, models: true do ...@@ -612,6 +612,20 @@ describe Repository, models: true do
end end
end end
describe '#before_import' do
it 'flushes the emptiness cachess' do
expect(repository).to receive(:expire_emptiness_caches)
repository.before_import
end
it 'flushes the exists cache' do
expect(repository).to receive(:expire_exists_cache)
repository.before_import
end
end
describe '#after_import' do describe '#after_import' do
it 'flushes the emptiness cachess' do it 'flushes the emptiness cachess' do
expect(repository).to receive(:expire_emptiness_caches) expect(repository).to receive(:expire_emptiness_caches)
......
...@@ -159,18 +159,28 @@ describe GitPushService, services: true do ...@@ -159,18 +159,28 @@ describe GitPushService, services: true do
end end
describe "Updates main language" do describe "Updates main language" do
context "before push" do context "before push" do
it { expect(project.main_language).to eq(nil) } it { expect(project.main_language).to eq(nil) }
end end
context "after push" do context "after push" do
before do before do
@service = execute_service(project, user, @oldrev, @newrev, @ref) @service = execute_service(project, user, @oldrev, @newrev, ref)
end
context "to master" do
let(:ref) { @ref }
it { expect(@service.update_main_language).to eq(true) }
it { expect(project.main_language).to eq("Ruby") }
end end
it { expect(@service.update_main_language).to eq(true) } context "to other branch" do
it { expect(project.main_language).to eq("Ruby") } let(:ref) { 'refs/heads/feature/branch' }
it { expect(@service.update_main_language).to eq(nil) }
it { expect(project.main_language).to eq(nil) }
end
end end
end end
......
...@@ -72,6 +72,23 @@ describe Projects::ImportService, services: true do ...@@ -72,6 +72,23 @@ describe Projects::ImportService, services: true do
expect(result[:status]).to eq :success expect(result[:status]).to eq :success
end end
it 'flushes various caches' do
expect_any_instance_of(Gitlab::Shell).to receive(:import_repository).
with(project.path_with_namespace, project.import_url).
and_return(true)
expect_any_instance_of(Gitlab::GithubImport::Importer).to receive(:execute).
and_return(true)
expect_any_instance_of(Repository).to receive(:expire_emptiness_caches).
and_call_original
expect_any_instance_of(Repository).to receive(:expire_exists_cache).
and_call_original
subject.execute
end
it 'fails if importer fails' do it 'fails if importer fails' do
expect_any_instance_of(Gitlab::Shell).to receive(:import_repository).with(project.path_with_namespace, project.import_url).and_return(true) expect_any_instance_of(Gitlab::Shell).to receive(:import_repository).with(project.path_with_namespace, project.import_url).and_return(true)
expect_any_instance_of(Gitlab::GithubImport::Importer).to receive(:execute).and_return(false) expect_any_instance_of(Gitlab::GithubImport::Importer).to receive(:execute).and_return(false)
......
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