Skip to content

Commit ccaea2b

Browse files
committed
Check the scmsync feature toggle in the scmsync checker concern
1 parent b2adde4 commit ccaea2b

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/api/app/controllers/concerns/scmsync_checker.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module ScmsyncChecker
44
extend ActiveSupport::Concern
55

66
def check_scmsync
7+
return if Flipper.enabled?(:scmsync, User.session)
78
return if @project&.scmsync.blank?
89

910
flash[:error] = "The project #{@project.name} is configured through scmsync. This is not supported by the OBS frontend"

src/api/app/controllers/webui/package_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class Webui::PackageController < Webui::WebuiController
1616
save_person save_group remove_role view_file
1717
buildresult rpmlint_result rpmlint_log rpmlint_summary files]
1818

19-
before_action :check_scmsync, only: %i[statistics users requests revisions],
20-
unless: -> { action_name.in?(%w[users revisions]) && Flipper.enabled?(:scmsync, User.session) }
19+
before_action :check_scmsync, only: %i[statistics users requests revisions]
2120

2221
before_action :set_package, only: %i[edit update show requests statistics revisions
2322
branch_diff_info rdiff remove

src/api/app/controllers/webui/packages/binaries_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class BinariesController < Webui::WebuiController
1212

1313
before_action :require_login, except: [:index]
1414
before_action :set_project
15-
before_action :check_scmsync, unless: -> { Flipper.enabled?(:scmsync, User.session) }
15+
before_action :check_scmsync
1616
before_action :set_package, unless: -> { Flipper.enabled?(:scmsync, User.session) }
1717
before_action :set_package_with_scmsync, if: -> { Flipper.enabled?(:scmsync, User.session) }
1818
before_action :set_multibuild_flavor

src/api/app/controllers/webui/packages/build_reason_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class BuildReasonController < Webui::WebuiController
44
include ScmsyncChecker
55

66
before_action :set_project
7-
before_action :check_scmsync, unless: -> { Flipper.enabled?(:scmsync, User.session) }
7+
before_action :check_scmsync
88
before_action :set_package, unless: -> { Flipper.enabled?(:scmsync, User.session) }
99
before_action :set_package_with_scmsync, if: -> { Flipper.enabled?(:scmsync, User.session) }
1010
before_action :set_repository

src/api/app/controllers/webui/packages/files_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class FilesController < Webui::WebuiController
55
include ScmsyncChecker
66

77
before_action :set_project
8-
before_action :check_scmsync, only: :show, unless: -> { Flipper.enabled?(:scmsync, User.session) }
8+
before_action :check_scmsync, only: :show
99
before_action :set_package, unless: -> { Flipper.enabled?(:scmsync, User.session) }
1010
before_action :set_package_with_scmsync, if: -> { Flipper.enabled?(:scmsync, User.session) }
1111
before_action :set_filename, only: %i[show update destroy blame]

src/api/app/controllers/webui/packages/job_history_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class JobHistoryController < Webui::WebuiController
44
include ScmsyncChecker
55

66
before_action :set_project
7-
before_action :check_scmsync, unless: -> { Flipper.enabled?(:scmsync, User.session) }
7+
before_action :check_scmsync
88
before_action :set_package, unless: -> { Flipper.enabled?(:scmsync, User.session) }
99
before_action :set_package_with_scmsync, if: -> { Flipper.enabled?(:scmsync, User.session) }
1010
before_action :set_repository

src/api/app/controllers/webui/packages/meta_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class MetaController < Webui::WebuiController
77
before_action :set_package, unless: -> { Flipper.enabled?(:scmsync, User.session) }
88
before_action :set_package_with_scmsync, if: -> { Flipper.enabled?(:scmsync, User.session) }
99

10-
before_action :check_scmsync, unless: -> { Flipper.enabled?(:scmsync, User.session) }
10+
before_action :check_scmsync
1111
before_action :validate_xml, only: :update
1212
before_action :check_sourceaccess, only: :update
1313
before_action :changed_project, only: :update

src/api/app/controllers/webui/repositories_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Webui::RepositoriesController < Webui::WebuiController
22
include ScmsyncChecker
33

44
before_action :set_project
5-
before_action :check_scmsync, if: -> { params[:package] && !Flipper.enabled?(:scmsync, User.session) }
5+
before_action :check_scmsync, if: -> { params[:package] }
66
before_action :set_repository, only: %i[state mark_important]
77
before_action :set_architectures, only: %i[index change_flag]
88
before_action :set_package, only: %i[index change_flag], if: -> { params[:package] && !Flipper.enabled?(:scmsync, User.session) }

0 commit comments

Comments
 (0)