-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[server] Extract ScmService to be used by both APIs #19098
Conversation
// (AT) when it comes to token renewal, the awaited http requests may | ||
// cause "parallel" calls to repeat the renewal, which will fail. | ||
// Caching for pending operations should solve this issue. | ||
const key = `${host}-${user.id}`; | ||
const key = `${host}-${userId}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙈 Caching tokens for the sake of deduplication of renewal requests?! EXP-950
@@ -891,13 +891,6 @@ export interface GuessGitTokenScopesParams { | |||
host: string; | |||
repoUrl: string; | |||
gitCommand: string; | |||
currentToken: GitToken; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this on purpose. 'Should avoid sending sensitive information if not needed.
Here we'd be in the position to obtain the token from DB to perform the write permissions check if required.
@AlexTugarev if you can fill in how to test section to what to pay attention in the dashboard it would help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked through the code generally look good, i left questions please have a look.
Testing now. I triggered preview envs, waiting...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did following tests:
- created a new project
- during creation check that I see suggested repositories and can search them
- use a repository which is not suggested for the project
- then created a workspace for such project, checked that i still can see and search suggested repositories with a project repository
- in the workspace try
git push
- seen that it failed and showed me that public_repo permission is missing
- then to User -> Preferences and updated permissions, close UI and reopen to confirmed that it applied
- after that went back to thw worksapce and did
git push
againt, it worked
@AlexTugarev anything else to test?
I pre approved, please take time to add tests and address comments as you find it fit.
Should I test #19101 already in the same way? Or better to wait till this PR is merged and another is rebased?
29bd7a0
to
003b804
Compare
254a607
to
54798af
Compare
54798af
to
baaadc3
Compare
/unhold |
Description
This PR extracts (actually consolidates) an internal ScmService to be used by the API services (gRPC and WS).
This also implements the SCMService from #19075.
Summary generated by Copilot
🤖[deprecated] Generated by Copilot at 563b5eb
Refactored the server-side code to use a new
ScmService
class for all source control management operations, and exposed it to the public API via a newScmServiceAPI
class. Removed unused or redundant code and improved error handling and dependency injection. Updated theGitpodServerImpl
class to use the newScmService
class.Related Issue(s)
Fixes #
How to test
This PR refactors code paths used for
This UI parts should have the same behavior as before.
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold