Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
345ea013
Commit
345ea013
authored
Apr 27, 2021
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
fa1dd0ee
a82fe262
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
53 deletions
+11
-53
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+1
-1
changelogs/unreleased/dz-remove-ff-api_always_use_application_json.yml
...released/dz-remove-ff-api_always_use_application_json.yml
+5
-0
changelogs/unreleased/gl-badge-project-search.yml
changelogs/unreleased/gl-badge-project-search.yml
+5
-0
config/feature_flags/development/api_always_use_application_json.yml
...ure_flags/development/api_always_use_application_json.yml
+0
-8
doc/api/README.md
doc/api/README.md
+0
-4
lib/api/api.rb
lib/api/api.rb
+0
-26
spec/requests/api/api_spec.rb
spec/requests/api/api_spec.rb
+0
-14
No files found.
app/helpers/search_helper.rb
View file @
345ea013
...
...
@@ -310,7 +310,7 @@ module SearchHelper
link_to
search_path
(
search_params
)
do
concat
label
concat
' '
concat
content_tag
(
:span
,
count
,
class:
[
'badge badge-pill'
,
badge_class
],
data:
badge_data
)
concat
content_tag
(
:span
,
count
,
class:
[
'badge badge-pill
gl-badge badge-muted sm
'
,
badge_class
],
data:
badge_data
)
end
end
end
...
...
changelogs/unreleased/dz-remove-ff-api_always_use_application_json.yml
0 → 100644
View file @
345ea013
---
title
:
Remove feature flag api_always_use_application_json
merge_request
:
56777
author
:
type
:
removed
changelogs/unreleased/gl-badge-project-search.yml
0 → 100644
View file @
345ea013
---
title
:
Add gl-badge for badges in project search page nav
merge_request
:
57971
author
:
Yogi (@yo)
type
:
changed
config/feature_flags/development/api_always_use_application_json.yml
deleted
100644 → 0
View file @
fa1dd0ee
---
name
:
api_always_use_application_json
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42229
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/270067
milestone
:
'
13.6'
type
:
development
group
:
group::ecosystem
default_enabled
:
true
doc/api/README.md
View file @
345ea013
...
...
@@ -777,7 +777,3 @@ some API endpoints also support `text/plain`.
In
[
GitLab 13.10 and later
](
https://gitlab.com/gitlab-org/gitlab/-/issues/250342
)
,
API endpoints do not support
`text/plain`
by default, unless it's explicitly documented.
This change is deployed behind the
`:api_always_use_application_json`
[
feature flag
](
../user/feature_flags.md
)
,
enabled by default. On GitLab self-managed instances, GitLab administrators can choose
to
[
disable it
](
../administration/feature_flags.md
)
.
**(FREE SELF)**
lib/api/api.rb
View file @
345ea013
...
...
@@ -130,32 +130,6 @@ module API
formatter
:json
,
Gitlab
::
Json
::
GrapeFormatter
content_type
:json
,
'application/json'
# Remove the `text/plain+deprecated` with `api_always_use_application_json` feature flag
# There is a small chance some users depend on the old behavior.
# We this change under a feature flag to see if affects GitLab.com users.
# The `+deprecated` is added to distinguish content type
# as defined by `API::API` vs ex. `API::Repositories`
content_type
:txt
,
'text/plain+deprecated'
before
do
# the feature flag workaround is only for `.txt`
api_format
=
env
[
Grape
::
Env
::
API_FORMAT
]
next
unless
api_format
==
:txt
# get all defined content-types for the endpoint
api_endpoint
=
env
[
Grape
::
Env
::
API_ENDPOINT
]
content_types
=
api_endpoint
&
.
namespace_stackable_with_hash
(
:content_types
).
to_h
# Only overwrite `text/plain+deprecated`
if
content_types
[
api_format
]
==
'text/plain+deprecated'
if
Feature
.
enabled?
(
:api_always_use_application_json
,
default_enabled: :yaml
)
content_type
'application/json'
else
content_type
'text/plain'
end
end
end
# Ensure the namespace is right, otherwise we might load Grape::API::Helpers
helpers
::
API
::
Helpers
helpers
::
API
::
Helpers
::
CommonHelpers
...
...
spec/requests/api/api_spec.rb
View file @
345ea013
...
...
@@ -170,20 +170,6 @@ RSpec.describe API::API do
expect
(
response
.
media_type
).
to
eq
(
'application/json'
)
expect
(
response
.
body
).
to
include
(
'{"id":'
)
end
context
'when api_always_use_application_json is disabled'
do
before
do
stub_feature_flags
(
api_always_use_application_json:
false
)
end
it
'returns text/plain'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
.
media_type
).
to
eq
(
'text/plain'
)
expect
(
response
.
body
).
to
include
(
'#<API::Entities::User:'
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment