Query group level web-based commit signing
What does this MR do and why?
This merge request implements GraphQL query integration for group-level web-based commit signing settings. The changes enable the UI to fetch the current state of web-based commit signing from the backend using GraphQL instead of passing it as initial data attributes.
Key changes across 19 files
-
New GraphQL Query (
ee/app/assets/javascripts/graphql_shared/queries/web_based_commit_signing.query.graphql)- Adds
getWebBasedCommitSigningquery that supports both group and project levels - Uses
@includeand@skipdirectives to conditionally query group or project data - Retrieves
webBasedCommitSigningEnabledfield from the appropriate entity
- Adds
-
Component Migration to EE - Multiple files moved from
app/toee/:-
checkbox.vue,settings.vue,init_settings.js, and related files - Storybook stories and test files relocated to EE directory
- View templates moved to EE-specific paths
-
-
Checkbox Component Refactoring (
ee/app/assets/javascripts/vue_shared/components/web_based_commit_signing/checkbox.vue)- Replaced
initialValueprop with Apollo query integration - Added
apolloconfiguration to fetch data usinggetWebBasedCommitSigningQuery - Implements error handling with Sentry integration via
captureException - For projects, currently reads inherited group setting (project-level setting commented out pending backend support)
- Checkbox is temporarily read-only for project level (
isDisabledreturnstruewhen!isGroupLevel)
- Replaced
-
Props Cleanup - Removed props no longer needed:
-
initialValue- replaced by Apollo query -
groupWebBasedCommitSigningEnabled- now fetched via GraphQL - Simplified data passing from templates (removed
web_based_commit_signing_enableddata attributes)
-
-
Page Initialization Updates:
- Group settings: Created new EE-specific entry point (
ee/app/assets/javascripts/pages/groups/settings/index.js) - Repository settings: Updated to import from EE paths and initialize the component
- Project settings: Updated imports to use EE versions
- Group settings: Created new EE-specific entry point (
-
Test Updates (
ee/spec/frontend/vue_shared/components/web_based_commit_signing/checkbox_spec.js)- Rewritten to test Apollo integration
- Added mock Apollo provider with query handlers
- Tests for both group and project levels with different query responses
- Tests for error handling and Sentry integration
- Removed old tests for removed props
-
Feature Spec (
ee/spec/features/groups/settings/repository_spec.rb)- Added tests for General subsection visibility based on
web_based_commit_signing_uifeature flag - Verifies checkbox rendering and checked state
- Added tests for General subsection visibility based on
Coming next...
These MRs are getting rather long for one submition.
- MR with the mutation
- MR allowing editing on the project level
References
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
![]() |
![]() |
How to set up and validate locally
- In rails console enable the feature flag
Feature.enable(:web_based_commit_signing_ui) - Go to Group / Settings / Repository
- Make sure you can see General sub-section and that
getWebBasedCommitSigningquery was called and the value retrieved matches the state of the checkbox.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #580999 (closed)
Edited by Paulina Sedlak-Jakubowska




