Fix file_has_changed? check to support later commits
What does this MR do and why?
This MR fixes a file_has_changed?
method used when committing form the Web IDE, to support adding unrelated commits that are technically later than the latest commits for the specific file.
Screenshots or screen recordings
No user facing change in this MR, but this will fix an issue in an upcoming Web IDE MR.
Before | After |
---|---|
How to set up and validate locally
- Update the
@gitlab/web-ide
version tohttps://gitlab.com/gitlab-org/gitlab-web-ide/-/jobs/3873894772/artifacts/raw/tmp/packages/gitlab-web-ide-0.0.1-dev-20230304220143.tgz
which comes from this MR (see patch below). - Run
yarn install
and start the gdk. - Enable the new Web IDE by running
Feature.enable(:vscode_web_ide)
in a rails consolerails c
. - Visit the IDE for any project (for example,
/-/ide/project/gitlab-org/gitlab-test/edit/master/
) - Edit a file that was not touched by the latest commit on the current branch (for example,
files/js/application.js
) - Go to the "Source Control" tab and click "Commit & Push".
- Select "No Use the current branch".
- Commit should be successful
👍
Patch to update @gitlab/web-ide
version
@gitlab/web-ide
versiondiff --git a/package.json b/package.json
index 2f6732ccc0b8..255bff95c21f 100644
--- a/package.json
+++ b/package.json
@@ -58,7 +58,7 @@
"@gitlab/svgs": "3.22.0",
"@gitlab/ui": "56.2.0",
"@gitlab/visual-review-tools": "1.7.3",
- "@gitlab/web-ide": "0.0.1-dev-20230223005157",
+ "@gitlab/web-ide": "https://gitlab.com/gitlab-org/gitlab-web-ide/-/jobs/3873894772/artifacts/raw/tmp/packages/gitlab-web-ide-0.0.1-dev-20230304220143.tgz",
"@rails/actioncable": "6.1.4-7",
"@rails/ujs": "6.1.4-7",
"@sourcegraph/code-host-integration": "0.0.84",
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Paul Slaughter