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
9a1a777e
Commit
9a1a777e
authored
Jan 13, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove jira_sync_builds feature flag
This enables the Jira sync builds feature.
parent
9ba5b578
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
5 additions
and
75 deletions
+5
-75
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+0
-2
app/workers/jira_connect/sync_builds_worker.rb
app/workers/jira_connect/sync_builds_worker.rb
+0
-1
changelogs/unreleased/294004-enable-jira-sync-builds.yml
changelogs/unreleased/294004-enable-jira-sync-builds.yml
+5
-0
config/feature_flags/development/jira_sync_builds.yml
config/feature_flags/development/jira_sync_builds.yml
+0
-8
lib/atlassian/jira_connect/client.rb
lib/atlassian/jira_connect/client.rb
+0
-2
spec/lib/atlassian/jira_connect/client_spec.rb
spec/lib/atlassian/jira_connect/client_spec.rb
+0
-18
spec/models/ci/pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+0
-20
spec/workers/jira_connect/sync_builds_worker_spec.rb
spec/workers/jira_connect/sync_builds_worker_spec.rb
+0
-24
No files found.
app/models/ci/pipeline.rb
View file @
9a1a777e
...
...
@@ -262,8 +262,6 @@ module Ci
end
after_transition
any
=>
any
do
|
pipeline
|
next
unless
Feature
.
enabled?
(
:jira_sync_builds
,
pipeline
.
project
)
pipeline
.
run_after_commit
do
# Passing the seq-id ensures this is idempotent
seq_id
=
::
Atlassian
::
JiraConnect
::
Client
.
generate_update_sequence_id
...
...
app/workers/jira_connect/sync_builds_worker.rb
View file @
9a1a777e
...
...
@@ -14,7 +14,6 @@ module JiraConnect
pipeline
=
Ci
::
Pipeline
.
find_by_id
(
pipeline_id
)
return
unless
pipeline
return
unless
Feature
.
enabled?
(
:jira_sync_builds
,
pipeline
.
project
)
::
JiraConnect
::
SyncService
.
new
(
pipeline
.
project
)
...
...
changelogs/unreleased/294004-enable-jira-sync-builds.yml
0 → 100644
View file @
9a1a777e
---
title
:
Sync pipeline builds to Jira
merge_request
:
51627
author
:
type
:
added
config/feature_flags/development/jira_sync_builds.yml
deleted
100644 → 0
View file @
9ba5b578
---
name
:
jira_sync_builds
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49348
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/292013
milestone
:
'
13.7'
type
:
development
group
:
group::ecosystem
default_enabled
:
false
lib/atlassian/jira_connect/client.rb
View file @
9a1a777e
...
...
@@ -69,8 +69,6 @@ module Atlassian
end
def
store_build_info
(
project
:,
pipelines
:,
update_sequence_id:
nil
)
return
unless
Feature
.
enabled?
(
:jira_sync_builds
,
project
)
builds
=
pipelines
.
map
do
|
pipeline
|
build
=
::
Atlassian
::
JiraConnect
::
Serializers
::
BuildEntity
.
represent
(
pipeline
,
...
...
spec/lib/atlassian/jira_connect/client_spec.rb
View file @
9a1a777e
...
...
@@ -384,24 +384,6 @@ RSpec.describe Atlassian::JiraConnect::Client do
subject
.
send
(
:store_build_info
,
project:
project
,
pipelines:
pipelines
.
take
(
1
))
end
it
'does not call the API if the feature flag is not enabled'
do
stub_feature_flags
(
jira_sync_builds:
false
)
expect
(
subject
).
not_to
receive
(
:post
)
subject
.
send
(
:store_build_info
,
project:
project
,
pipelines:
pipelines
)
end
it
'does call the API if the feature flag enabled for the project'
do
stub_feature_flags
(
jira_sync_builds:
project
)
expect
(
subject
).
to
receive
(
:post
)
.
with
(
'/rest/builds/0.1/bulk'
,
{
builds:
Array
})
.
and_call_original
subject
.
send
(
:store_build_info
,
project:
project
,
pipelines:
pipelines
)
end
context
'there are errors'
do
let
(
:failures
)
do
[{
errors:
[{
message:
'X'
},
{
message:
'Y'
}]
},
{
errors:
[{
message:
'Z'
}]
}]
...
...
spec/models/ci/pipeline_spec.rb
View file @
9a1a777e
...
...
@@ -1261,26 +1261,6 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
pipeline
.
send
(
event
)
end
context
'the feature is disabled'
do
it
'does not trigger a worker'
do
stub_feature_flags
(
jira_sync_builds:
false
)
expect
(
worker
).
not_to
receive
(
:perform_async
)
pipeline
.
send
(
event
)
end
end
context
'the feature is enabled for this project'
do
it
'does trigger a worker'
do
stub_feature_flags
(
jira_sync_builds:
pipeline
.
project
)
expect
(
worker
).
to
receive
(
:perform_async
)
pipeline
.
send
(
event
)
end
end
end
end
end
...
...
spec/workers/jira_connect/sync_builds_worker_spec.rb
View file @
9a1a777e
...
...
@@ -32,29 +32,5 @@ RSpec.describe ::JiraConnect::SyncBuildsWorker do
subject
end
end
context
'when the feature flag is disabled'
do
before
do
stub_feature_flags
(
jira_sync_builds:
false
)
end
it
'does not call the sync service'
do
expect_next
(
::
JiraConnect
::
SyncService
).
not_to
receive
(
:execute
)
subject
end
end
context
'when the feature flag is enabled for this project'
do
before
do
stub_feature_flags
(
jira_sync_builds:
pipeline
.
project
)
end
it
'calls the sync service'
do
expect_next
(
::
JiraConnect
::
SyncService
).
to
receive
(
:execute
)
subject
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