Age | Commit message (Collapse) | Author |
|
This provides the user with some context as to why certain ActiveRecord
methods are blacklisted.
|
|
|
|
This adds Ruby 2.6 support.
|
|
This saves thousands of getcwd() system calls and improves the
performance of running Rubocop, which is also used by HAML linting.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/61383
|
|
|
|
The `#reload` makes to load all objects into memory,
and the main purpose of `#reload` is to drop the association cache.
The `#reset` seems to solve exactly that case.
|
|
|
|
Fix detecting nested EE constants in RuboCop
See merge request gitlab-org/gitlab-ce!24430
|
|
The InjectEnterpriseEditionModule cop would not detect certain nested EE
constants such as `EE::Foo::Bar::Baz`. This could result in it not
enforcing `prepend` being placed on the last line. This commit fixes
this by just performing a string match on the line, instead of relying
on AST matching.
|
|
The Background migration specs also run against a certain version of
the database. So we should avoid using factories.
|
|
This Cop enforces the rule that injecting EE modules (using prepend,
include, or extend) is done by placing the injection on the last line of
a file, instead of somewhere in the middle. By placing these lines at
the very end, merge conflicts will not happen.
|
|
It might happen you want to make the reference column have a unique
value, or you want to create partial indexes. So instead of only
accepting a `true` value, also accept a hash of options.
|
|
|
|
|
|
This cop forbids the use of `element :foo, 'pattern'` and
`element :bar, /pattern/` in QA files.
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
|
|
|
|
This removes an unused constant from the
`RubyInterpolationInTranslation`. The constant was used in a first
implementation of this class.
|
|
This commit adds the module `FromUnion`, which provides the class method
`from_union`. This simplifies the process of selecting data from the
result of a UNION, and reduces the likelihood of making mistakes. As a
result, instead of this:
union = Gitlab::SQL::Union.new([foo, bar])
Foo.from("(#{union.to_sql}) #{Foo.table_name}")
We can now write this instead:
Foo.from_union([foo, bar])
This commit also includes some changes to make this new setup work
properly. For example, a bug in Rails 4
(https://github.com/rails/rails/issues/24193) would break the use of
`from("sub-query-here").includes(:relation)` in certain cases. There was
also a CI query which appeared to repeat a lot of conditions from an
outer query on an inner query, which isn't necessary.
Finally, we include a RuboCop cop to ensure developers use this new
module, instead of using Gitlab::SQL::Union directly.
Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
|
|
These Cops enforces the code reuse rules as defined in merge request
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21254.
|
|
Previously this would violate on the `if`:
def a_method
do_something
rescue
if condition
do_something
end
end
|
|
|
|
|
|
|
|
|
|
|
|
When using ruby interpolation in externalized strings, they can't be
detected. Which means they will never be presented to be translated.
To mix variables into translations we need to use `sprintf`
instead.
Instead of:
_("Hello #{subject}")
Use:
_("Hello %{subject}) % { subject: 'world' }
|
|
This method usually has really bad performance implications, as it loads
rows into memory and deletes them one by one.
|
|
|
|
|
|
Disallow methods that copy data on large tables
See merge request gitlab-org/gitlab-ce!20021
|
|
These are all over 20 GB on GitLab.com. merge_request_diff_commits is several
hundred gigabytes in size.
|
|
This notifies developers when calling `find(_by!)` chained on
`execute`. And suggests using the methods from `FinderMethods`. These
will perform the correct authorization checks on the resource when it
is found.
|
|
{change_column_type,rename_column}_concurrently both copy data from one column
to another during a migration, which should not be done on GitLab.com. Instead,
we should use background migrations.
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
whole Rails env
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
This reverts the addition of the "goldiloader" Gem and all use of it.
While this Gem is very promising it's causing a variety of problems on
GitLab.com due to it eager-loading too much data in places where we
don't expect/can handle this. At least for the time being this means we
have to go back to manually fixing N+1 query problems, but at least
those should not cause a negative impact on availability.
|
|
|
|
Goldiloader is great, but has several issues with has_many :through relations:
* https://github.com/salsify/goldiloader/issues/12
* https://github.com/salsify/goldiloader/issues/14
* https://github.com/salsify/goldiloader/issues/18
Rather than try to figure out which applies in each case, we should just do the
drudge work of manually disabling autoloading for all relations of this type. We
can always use regular preloading for specific cases, but this way we avoid
generating invalid queries through Goldiloader's magic.
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
Server Side Request Forgery in Services and Web Hooks
See merge request gitlab/gitlabhq!2337
|
|
|
|
|
|
with StrongMemoize
|
|
|
|
Also try to use the same config from EE
|
|
Signed-off-by: Rémy Coutable <remy@rymai.me>
|
|
* upstream/master: (671 commits)
Make rubocop happy
Use guard clause
Improve language
Prettify
Use temp branch
Pass info about who started the job and which job triggered it
Docs: add indexes for monitoring and performance monitoring
clearer-documentation-on-inline-diffs
Add docs for commit diff discussion in merge requests
sorting for tags api
Clear BatchLoader after each spec to prevent holding onto records longer than necessary
Include project in BatchLoader key to prevent returning blobs for the wrong project
moved lfs_blob_ids method into ExtractsPath module
Converted JS modules into exported modules
spec fixes
Bump gitlab-shell version to 5.10.3
Clear caches before updating MR diffs
Use new Ruby version 2.4 in GitLab QA images
moved lfs blob fetch from extractspath file
Update GitLab QA dependencies
...
|
|
manually set their queue
|
|
remove_column should only be used in the up (or change) step of a migration if
it's a post-deployment migration. Otherwise there will be downtime due to the
ActiveRecord column cache, which we can avoid by using the IgnorableColumn
concern in combination with a post-deployment migration.
|