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
446476fa
Commit
446476fa
authored
Apr 19, 2021
by
Laura Montemayor
Committed by
lauraMon
Apr 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactors a bit and updates
parent
e9b94670
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
8 deletions
+12
-8
app/graphql/mutations/commits/create.rb
app/graphql/mutations/commits/create.rb
+6
-2
app/helpers/gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+1
-1
app/services/ci/expire_pipeline_cache_service.rb
app/services/ci/expire_pipeline_cache_service.rb
+1
-1
lib/gitlab/etag_caching/router/graphql.rb
lib/gitlab/etag_caching/router/graphql.rb
+1
-1
spec/factories/ci/pipelines.rb
spec/factories/ci/pipelines.rb
+1
-1
spec/factories/merge_requests.rb
spec/factories/merge_requests.rb
+1
-1
spec/lib/gitlab/etag_caching/router_spec.rb
spec/lib/gitlab/etag_caching/router_spec.rb
+1
-1
No files found.
app/graphql/mutations/commits/create.rb
View file @
446476fa
...
...
@@ -4,7 +4,11 @@ module Mutations
module
Commits
class
Create
<
BaseMutation
include
FindsProject
include
GitlabRoutingHelper
class
UrlHelpers
include
GitlabRoutingHelper
include
Gitlab
::
Routing
end
graphql_name
'CommitCreate'
...
...
@@ -56,7 +60,7 @@ module Mutations
{
commit:
(
project
.
repository
.
commit
(
result
[
:result
])
if
result
[
:status
]
==
:success
),
commit_pipeline_path:
graphql_etag_pipeline_sha_path
(
result
[
:result
]),
commit_pipeline_path:
UrlHelpers
.
new
.
graphql_etag_pipeline_sha_path
(
result
[
:result
]),
errors:
Array
.
wrap
(
result
[
:message
])
}
end
...
...
app/helpers/gitlab_routing_helper.rb
View file @
446476fa
...
...
@@ -365,7 +365,7 @@ module GitlabRoutingHelper
end
def
graphql_etag_pipeline_sha_path
(
sha
)
[
Gitlab
::
Routing
.
url_helpers
.
api_graphql_path
,
"pipelines/sha/
#{
sha
}
"
].
join
(
':'
)
[
api_graphql_path
,
"pipelines/sha/
#{
sha
}
"
].
join
(
':'
)
end
private
...
...
app/services/ci/expire_pipeline_cache_service.rb
View file @
446476fa
...
...
@@ -76,11 +76,11 @@ module Ci
each_pipelines_merge_request_path
(
pipeline
)
do
|
path
|
store
.
touch
(
path
)
end
store
.
touch
(
graphql_pipeline_sha_path
(
pipeline
.
sha
))
pipeline
.
self_with_ancestors_and_descendants
.
each
do
|
relative_pipeline
|
store
.
touch
(
project_pipeline_path
(
relative_pipeline
.
project
,
relative_pipeline
))
store
.
touch
(
graphql_pipeline_path
(
relative_pipeline
))
store
.
touch
(
graphql_pipeline_sha_path
(
relative_pipeline
.
sha
))
end
end
...
...
lib/gitlab/etag_caching/router/graphql.rb
View file @
446476fa
...
...
@@ -14,7 +14,7 @@ module Gitlab
'continuous_integration'
],
[
%r(
\A
pipelines/sha/
\w
+
\z
)
,
%r(
\A
pipelines/sha/
\w
{7,40}
\z
)
,
'ci_editor'
,
'pipeline_authoring'
]
...
...
spec/factories/ci/pipelines.rb
View file @
446476fa
...
...
@@ -237,7 +237,7 @@ FactoryBot.define do
trait
:merged_result_pipeline
do
detached_merge_request_pipeline
sha
{
'testMergeSha
12312
'
}
sha
{
'testMergeSha
WithFortyCharacters123456
'
}
ref
{
merge_request
.
merge_ref_path
}
source_sha
{
merge_request
.
source_branch_sha
}
target_sha
{
merge_request
.
target_branch_sha
}
...
...
spec/factories/merge_requests.rb
View file @
446476fa
...
...
@@ -279,7 +279,7 @@ FactoryBot.define do
trait
:with_merge_request_pipeline
do
transient
do
merge_sha
{
'testmergesha
123
'
}
merge_sha
{
'testmergesha
withfortycharacters123456
'
}
source_sha
{
source_branch_sha
}
target_sha
{
target_branch_sha
}
end
...
...
spec/lib/gitlab/etag_caching/router_spec.rb
View file @
446476fa
...
...
@@ -24,7 +24,7 @@ RSpec.describe Gitlab::EtagCaching::Router do
end
it
'matches pipeline sha endpoint'
do
result
=
match_route
(
'/api/graphql'
,
'pipelines/sha/4asd
a2jiwjdqw0
'
)
result
=
match_route
(
'/api/graphql'
,
'pipelines/sha/4asd
12lla2jiwjdqw9as32glm8is8hiu8s2c5jsw
'
)
expect
(
result
).
to
be_present
expect
(
result
.
name
).
to
eq
'ci_editor'
...
...
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