#2058 fix github authentication for vsccode - #2072
Conversation
Coverage Report for CI Build 34616800230Coverage increased (+0.01%) to 73.918%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions5 previously-covered lines in 3 files lost coverage.
Coverage Stats💛 - Coveralls |
|
Tested it locally and the problem is fixed! I have a question/concern however: if I understand this correctly, removing |
…ntication # Conflicts: # CHANGELOG.adoc
…hentication # Conflicts: # CHANGELOG.adoc
…uando632/IDEasy into fix/2058-vscode-authentication
|
Yeah you are right. I have changed it to |
|
Tested it again locally and everything works as intended! |
…hentication # Conflicts: # cli/src/main/java/com/devonfw/tools/ide/tool/vscode/Vscode.java # cli/src/test/java/com/devonfw/tools/ide/tool/vscode/VscodeTest.java
…roject name in profile The profile name now contains the project name in addition to the workspace name, so that different IDEasy projects (that all have a 'main' workspace by default) no longer share a single VSCode profile. The switch from --user-data-dir to --profile is put behind the new feature toggle VSCODE_PROFILE_ENABLED (disabled by default) so that the legacy behaviour remains unchanged until the new one has been verified for all scenarios.
hohwille
left a comment
There was a problem hiding this comment.
@quando632 thanks for your update with the feature toggle. Now ready for merge. 👍
|
Retest on SNAPSHOT The only issue found is that plugins installed by IDEasy are not enabled in the freshly created profile. This is a known, minor issue and is already fixed by #2479 (pending review), so no separate bug issue is created here. |
This PR fixes #2058
Implemented changes
Vscode.javacan now isolate VSCode via a named--profileinstead of--user-data-dir.--user-data-dirmoves VSCode's IPC lock to a custom path. The OS-levelvscode://protocol handler (used by GitHub/Copilot OAuth callbacks) always targets VSCode's default data directory, so it could never find the running window and instead spawned a second, unauthenticated one.--profilekeeps the IPC lock at the default location while still giving each project and workspace its own isolated profile (separate auth sessions, extension state, settings). The profile name isideasy-«project»-«workspace»: it contains the project name in addition to the workspace name because every IDEasy project has amainworkspace by default and all of them would otherwise share a single profile.As discussed in the daily, the new behaviour is behind a feature toggle so that it can be merged without risk:
VSCODE_PROFILE_ENABLEDfalse(default)--user-data-dir=«ideMetadataPath»/configtrue--profile=ideasy-«project»-«workspace»Once we are confident that the new behaviour works in all scenarios (multiple projects, multiple workspaces, vscode/vscodium), a follow-up PR can activate it by default and eventually remove both the toggle and the old behaviour.
--extensions-dir(per-project plugin isolation) is unaffected in both cases.Note: enabling the toggle starts with a fresh VSCode profile. Settings, extension state and logins from the previous
--user-data-dirare not migrated, so you have to log in once after enabling it.Testing instructions
Automated tests
mvn -pl cli test -Dtest=VscodeTestBoth toggle states are covered:
testConfigureToolArgsUsesIdeMetadataPathForUserData- toggle disabled (default),--user-data-diris usedtestConfigureToolArgsUsesProfileIfFeatureToggleEnabled- toggle enabled,--profileincluding the project name is used1. Default behaviour is unchanged (toggle disabled)
Do not set
VSCODE_PROFILE_ENABLEDand run:Expected result:
--user-data-dirpointing into the IDE metadata folder.2. Enable the feature toggle
Add this to
$IDE_HOME/conf/ide.properties(user specific, not to the sharedsettings):VSCODE_PROFILE_ENABLED=trueThen run:
Expected result:
--profile=ideasy-«project»-«workspace»and without any--user-data-dir.3. Auth fix verification (toggle enabled)
Expected result:
4. Persistence verification (toggle enabled)
ide vscode.Expected result:
5. Per-project and per-workspace isolation (toggle enabled)
Expected result:
mainworkspace do not share a profile.6. Plugins and settings in the new profile (toggle enabled)
VSCode tracks extension enablement per profile, and user level settings live inside the user-data-dir.
Expected result / to be verified:
--extensions-dir) are present and enabled in the new profile..vscode/settings.json(e.g.java.jdt.ls.java.home) are still applied, since VSCode reads them from the opened workspace folder independent of the profile.Checklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)with
internal