Commit Graph

9464 Commits

Author SHA1 Message Date
Stan Hu db9783f782 Merge branch 'refactor_deployment_cluster' into 'master'
Refactor Deployment#cluster to #deployment_platform_cluster

See merge request gitlab-org/gitlab-ce!29961
2019-06-24 22:23:18 +00:00
Kamil Trzciński e11feff929 Revert "Merge branch..."
This reverts merge request !29832
2019-06-24 17:29:54 +00:00
Kamil Trzciński 0e6e924b8b Merge branch 'search-blob-basenames' into 'master'
Build correct basenames for title search results

See merge request gitlab-org/gitlab-ce!29898
2019-06-24 12:23:35 +00:00
Ash McKenzie 88c8d177f8 Merge branch 'fix-labels-in-hooks' into 'master'
Fix label serialisation in issue and note hooks

Closes #63473

See merge request gitlab-org/gitlab-ce!29850
2019-06-24 10:56:19 +00:00
Jan Provaznik 4189ffe214 Added labels_hook_attrs method
Based on review comment fetching labels hook_attrs is now
wrapped in an issue's model method.
2019-06-24 11:51:34 +02:00
Thong Kuah d9f4a91945 Merge branch '60617-enable-project-cluster-jit' into 'master'
Enable JIT Kubernetes resource creation for project level clusters

See merge request gitlab-org/gitlab-ce!29515
2019-06-24 05:16:31 +00:00
Thong Kuah ee18ca2fa5 Rename method to not clash with #cluster
We will introduce #cluster at a later stage.
Also deprecate this method
2019-06-24 16:59:22 +12:00
Thong Kuah ae4966f29a Select deployments that only has the app label
As Auto DevOps deployments both label and annotations, that will be
included in the deploy board so need to warn at all.
2019-06-21 20:45:06 +00:00
Douglas Barbosa Alexandre 94d9e33586
Include the GitLab version in the cache key for Gitlab::JsonCache 2019-06-21 12:42:45 -03:00
Douglas Barbosa Alexandre d0a921b45a Merge branch 'sh-clean-up-bitbucket-import-errors' into 'master'
Avoid storing backtraces from Bitbucket Cloud imports in the database

See merge request gitlab-org/gitlab-ce!29862
2019-06-21 14:43:25 +00:00
Stan Hu 868da1d6c8 Merge branch '63406-selecting-a-line-in-ci-job-trace-using-triple-click-selects-the-previous-line-also' into 'master'
Fix copying a single line from Firefox

Closes #63406

See merge request gitlab-org/gitlab-ce!29832
2019-06-21 13:11:56 +00:00
Kamil Trzciński 1f3086a99c Merge branch 'default-enable-complex-ci-variables-expressions' into 'master'
Enabled complex ci variable expression statements by default

See merge request gitlab-org/gitlab-ce!29904
2019-06-21 08:28:43 +00:00
Stan Hu ea795837fd Merge branch 'zj-gitaly-usage-data' into 'master'
Add Gitaly data to the usage ping

See merge request gitlab-org/gitlab-ce!29893
2019-06-20 18:39:28 +00:00
Markus Koller 6905a62867
Build correct basenames for title search results
The "basename" here needs to be the full path without the trailing
extension, instead of stripping the leading path as well.

This was previously fixed in 2f36efa087 inside the view, but the
problematic code was still present in FoundBlob, and the corresponding
spec didn't actually use a child wiki page to properly verify the fix.
2019-06-20 18:05:12 +02:00
drew cimino f3b2dde8e2 Enabled complex ci variable expression statements by default 2019-06-20 11:53:21 -04:00
Sarah Yasonik f49dd76a44 Add embedding flag and filter to CPU/Mem
This commits adds support for metrics dashboards
for embedding. If the flag 'embedded' is provided
to the environments/id/metrics_dashboard endpoint,
the response will be suitable for embedding in
issues or other content.

This is a precursor for support for embedding
metrics in GFM.
2019-06-20 14:06:18 +00:00
Zeger-Jan van de Weg 44528f6c44
Add Gitaly data to the usage ping
Gitaly data wasn't available to the team, an this change is a first
iteration towards understanding what data we need and how to interpret
it. Later more values will be added.

For now the most important thing is the filesystem String Array, as that
includes data on ext4 exposure and NFS.

Part of: https://gitlab.com/gitlab-org/gitlab-ce/issues/60602
2019-06-20 15:26:56 +02:00
Sean McGivern da4702493d Fix label serialisation in issue and note hooks
We were not calling hook_attrs on the labels correctly. Specs were
passing because the issues under test did not have any labels!
2019-06-20 13:50:28 +01:00
Ash McKenzie 788690304a Merge branch '63510-error-parsing-true-boolean-in-gitlab-jsoncache' into 'master'
Gitlab::JsonCache#parse_value ensure string

Closes #63510

See merge request gitlab-org/gitlab-ce!29885
2019-06-20 12:00:51 +00:00
Bob Van Landuyt 406808583c Render GFM html in GraphQL
This adds a `markdown_field` to our types.

Using this helper will render a model's markdown field using the
existing `MarkupHelper` with the context of the GraphQL query
available to the helper.

Having the context available to the helper is needed for redacting
links to resources that the current user is not allowed to see.

Because rendering the HTML can cause queries, the complexity of a
these fields is raised by 5 above the default.

The markdown field helper can be used as follows:

      ```
      markdown_field :note_html, null: false
      ```

This would generate a field that will render the markdown field `note`
of the model. This could be overridden by adding the `method:`
argument. Passing a symbol for the method name:

      ```
      markdown_field :body_html, null: false, method: :note
      ```

It will have this description by default:

> The GitLab Flavored Markdown rendering of `note`

This could be overridden by passing a `description:` argument.

The type of a `markdown_field` is always `GraphQL::STRING_TYPE`.
2019-06-20 08:02:33 +00:00
Ash McKenzie 03220c00d9
Gitlab::JsonCache#parse_value ensure string 2019-06-20 18:00:44 +10:00
Stan Hu adeccba136 Merge branch 'fix/facivon-url-if-uploads-object-store-enabled' into 'master'
fix(favicon): get favicon_path, so it works also with uploads object store

See merge request gitlab-org/gitlab-ce!29482
2019-06-20 03:57:17 +00:00
Stan Hu 30f52b690f Avoid storing backtraces from Bitbucket Cloud imports in the database
We noticed in
https://gitlab.com/gitlab-com/gl-infra/production/issues/908 some
Bitbucket imports took over a second to load their projects row because
`import_error` was huge due to errors. To prevent this, we now:

1. Clean the backtraces
2. Log the details into importer.log
3. Omit the details from the database
2019-06-19 12:04:24 -07:00
Luke Duncalfe dcf811ba14 CE backport for changes in EE MR 14017
This backports to CE changes to allow the EE model
DesignManagement::Repository to override the #attributes_at method to
provide its own git attributes.

The #attributes_at method was freely available, as it's never called by
anything in the app. It looks like the code that called it got
refactored out of existence in ca66a04f. It was still being called in a
spec
85b29c1c2f/spec/services/files/create_service_spec.rb (L40)
which I've left because with the change in Lfs::FileTransformer in fact
is now again the perfect test!

See EE MR
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14017

And these comment threads
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894#note_178002089
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/13894#note_178049984
2019-06-19 17:51:57 +00:00
Lin Jen-Shin e999e1de7b Merge branch 'pj/fix-emacs-style' into 'master'
Fix syntax coloring on emacs

See merge request gitlab-org/gitlab-ce!29844
2019-06-19 15:06:54 +00:00
Adam Hegyi e76f12f7e7 Merge branch 'master' into '63406-selecting-a-line-in-ci-job-trace-using-triple-click-selects-the-previous-line-also'
# Conflicts:
#   spec/lib/gitlab/ci/ansi2html_spec.rb
2019-06-19 13:39:52 +00:00
Kamil Trzciński 22755a4aa2 Merge branch '63417-add-missing-class' into 'master'
Adds missing class in collapsible sections

Closes #63417

See merge request gitlab-org/gitlab-ce!29804
2019-06-19 12:56:41 +00:00
pjaspers 6f5daf49d9 Use correct arg name
So funny story, true story. I tried to run the test locally, but
didn't make it past setting up Gitaly.

Here's what I tried:

First attempt:

`git clone gitlab-ce`
`cd gitlab-ce && bundle install`
`be rspec`

This didn't work because I was missing the config/database.yml, I
didn't see a `script/bootstrap` so I looked in the readme which
redirected me to a webpage which redirected me to the
gitlab-development-kit.

Second attempt:

`gem install gitlab-development-kit`
cd gitlab-development-kit
gdk init
gdk isntall

This broke somwhere along the way because it couldn't install Gitaly
because my go version was too low. But it did clone the gitlab repo
again and this time it did have a config/database.yml.

So I tried to cd into it and `be rspec
spec/lib/gitlab/database/migration_helpers_spec.rb` which complained
about the database not being configured so I:

- Changed the socket to localhost (in the config/database.yml)
- `createdb <dev_db>` `createdb test_db`
- `be rake db:test:prepare`

Great success, it was doing things! But then failed when it came at
the Gitaly step.

Since I only want to change these three lines, at the point I gave up
and entrusted the pipeline to do its thing.

What I would have liked:

- A 'It's a Rails system, I know this' readme/docs (It's in there
  somewhere just couldn't find it)
- A way to run tests without having to use Gitaly
- Not having too install all the things for a small fix (I get why'd
  you want this, but to me it's overkill)
2019-06-19 13:55:47 +02:00
Filipa Lacerda d3a1468b62 Adds missing class
Will apply identation from
CSS to collapsible sections
2019-06-19 11:58:11 +01:00
pjaspers 31438ddd8b Fix syntax coloring on emacs
The rather cryptic:

      "fk_#{Digest::SHA256.hexdigest("#{table}_#{column}_fk").first(10)}"

Was too much for emacs too handle*, since it was coming from the Rails
codebase I took their way of doing the same thing and applied it here.

I think it's easier to read and it also makes emacs render the
migration helpers pretty again.

* not true, emacs can handle anything, leave emacs alone!
2019-06-19 12:36:32 +02:00
Adam Hegyi 86c08225eb Fix copying a single line from Firefox
This change ensures that all open <span> tags are closed before adding a
<br> tag.
2019-06-19 09:16:53 +02:00
Manoj MJ 53b17f0301 Add documentation and tests
This commit adds
 - feature specs
  - to test the ability of a user with "developer" permission
    to delete tags in repositories.
 - documentation
2019-06-19 07:08:56 +00:00
Philippe Lafoucrière 2a6dab97d9 Fix Container Scanning job with K8S runners 2019-06-19 06:31:22 +00:00
Manoj MJ 83163fab43 Adds identity information while making external authorization requests
Issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/61201#
2019-06-19 06:04:33 +00:00
Thong Kuah 04608acf03 Stop matching on legacy app label
From now on, only match on the annotations, instead of falling back to
legacy app label. This enables users to use the app label for other
purposes such as helm charts.
2019-06-19 11:06:43 +12:00
Kartikey Tanna 53af3e6b9e #57815 Password authentication disabled for UltraAuth users
Disabled password authentication for the users registered using
omniauth-ultraauth strategy
2019-06-18 16:18:14 +00:00
Lin Jen-Shin 073a65fe49 Merge branch 'mc/bug/old-codequality-template-autodevops' into 'master'
Use new Code Quality job definition in Auto DevOps

See merge request gitlab-org/gitlab-ce!29475
2019-06-18 15:33:44 +00:00
Zeger-Jan van de Weg 4dfaaf40b9
Turn on Cat-File cache by default
The feature flag has been introduced an was turned off by default,
now the it will default to be turned on. That change would still allow
users to turn this feature off by leveraging the Rails console by
running:

`Feature.disable("gitaly_catfile-cache")`

Another option is to manage the number of items the LRU cache will
contain, by updating the `config.toml` for Gitaly. This would be the
`catfile_cache_size`:
0dcb5c579e/config.toml.example (L27)

Closes: https://gitlab.com/gitlab-org/gitaly/issues/1712
2019-06-18 13:33:43 +02:00
Zeger-Jan van de Weg 968674e417
Move Gitaly feature flag logic to Feature::Gitaly
The GitalyClient held a lot of logic which was all very tightly coupled.
In this instance the feature logic was extracted to make it do just a
little less and create a bit more focus in the GitalyClient's
responsibilies.
2019-06-18 13:18:18 +02:00
Kamil Trzciński 505d71ec88 Introduce default: for gitlab-ci.yml
This moves all existing `image/services/before_script/variables`
into `default:`. This allows us to easily add a default and
top-level entries. `default`: is keep backward compatible: to
be considered to be job if `default:script:` is specified. This
behavior should be removed.

All existing `image/services/before_script/variables` are properly
handled in root context.
2019-06-18 10:36:07 +00:00
Douwe Maan c167cc58d3 Merge branch 'asciidoctor-upgrade' into 'master'
Upgrade asciidoctor version to 2.0.10 and change method names in html5_converter

Closes #63304

See merge request gitlab-org/gitlab-ce!29741
2019-06-18 10:03:13 +00:00
Grzegorz Bizon 077bb1b299 Merge branch 'mc/feature/required-template-inclusion-single-commit-ce' into 'master'
Enforce template inclusion in pipelines - CE

See merge request gitlab-org/gitlab-ce!29296
2019-06-18 08:04:32 +00:00
Tiger 74702f0e0e Enable project-level JIT resource creation
Previously this behaviour was only available to group
and instance-level clusters, as some project clusters
relied on Kubernetes credentials being passed through
to the runner instead of having their resources managed
by GitLab (which is not available when using JIT). These
clusters have been migrated to unmanaged, so resources
can be created on demand for the remaining managed clusters.
2019-06-18 12:43:52 +10:00
Thong Kuah 12d262c23f Merge branch '55362-refresh-blank-service-account-token' into 'master'
Refresh service_account_token for kubernetes_namespaces

See merge request gitlab-org/gitlab-ce!29657
2019-06-17 22:28:36 +00:00
Matija Čupić 7ac3723be0
Backport CE changes
Backports CE changes from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/14011/
2019-06-17 21:53:09 +02:00
Sean McGivern 2634cad695 Merge branch 'generate-spans-for-sections' into 'master'
Add collapsible sections to job log

See merge request gitlab-org/gitlab-ce!28642
2019-06-17 17:03:41 +00:00
Fabio Pitino d75a4ddab2 Remove unused line 2019-06-17 17:09:29 +01:00
raju249 d0802aa81b Add changelog for the upgrade 2019-06-17 20:49:45 +05:30
Yorick Peterse 8469f59d78
Backport the EE schema and migrations to CE
This backports all EE schema changes to CE, including EE migrations,
ensuring both use the same schema.

== Updated tests

A spec related to ghost and support bot users had to be modified to make
it pass. The spec in question assumes that the "support_bot" column
exists when defining the spec. In the single codebase setup this is not
the case, as the column is backported in a later migration. Any attempt
to use a different schema version or use of "around" blocks to
conditionally disable specs won't help, as reverting the backport
migration would also drop the "support_bot" column. Removing the
"support_bot" tests entirely appears to be the only solution.

We also need to update some foreign key tests now that we have
backported the EE columns. Fortunately, these changes are very minor.

== Backporting migrations

This commit moves EE specific migrations (except those for the Geo
tracking database) and related files to CE, and also removes any traces
of the ee/db directory.

Some migrations had to be modified or removed, as they no longer work
with the schema being backported. These migrations were all quite old,
so we opted for removing them where modifying them would take too much
time and effort.

Some old migrations were modified in EE, while also existing in CE. In
these cases we took the EE code, and in one case removed them entirely.
It's not worth spending time trying to merge these changes somehow as we
plan to remove old migrations around the release of 12.0, see
https://gitlab.com/gitlab-org/gitlab-ce/issues/59177 for more details.
2019-06-17 17:09:05 +02:00
Yorick Peterse 0f777a8d49
Allow custom names for concurrent foreign keys
This is necessary for backporting the EE schema to ensure backported
foreign keys use the same key names.
2019-06-17 17:06:20 +02:00