Stage all changes by default in Web IDE
What does this MR do?
This is a fix for issue #33441 (closed)
Always stage all changes by default. This was already existing for deleting a file. This commit also adds staging by default to the below cases:
- Adding/uploading a new file
- Renaming a file
- Editing a file
Here's a table that outlines the old behaviour and the new behaviour:
Action | Old Result | New Result |
---|---|---|
Create a new file | File is not staged | File is staged |
Upload a file | File is not staged | File is staged |
Rename a file | File is not staged | File is staged |
Edit a file | File is not staged | File is staged |
Delete a file | File is staged | File is staged |
This doesn't change the behaviour for trees (folders), since git doesn't allow staging just folders:
Action | Old Result | New Result |
---|---|---|
Add a new folder | Folder is not staged | Folder is not staged |
Rename an empty / newly added folder | Folder is not staged | Folder is not staged |
Acceptance Criteria
Testing this branch locally
This change is behind a feature flag :stage_all_by_default
. In the rails console (rails c
), enter the following command to enable your feature flag:
Feature.enable(:stage_all_by_default)
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Amy Qualls