Skip to content

[Feat]: Update Code to 1.80 #6316

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

Closed
benz0li opened this issue Jul 8, 2023 · 17 comments · Fixed by #6340
Closed

[Feat]: Update Code to 1.80 #6316

benz0li opened this issue Jul 8, 2023 · 17 comments · Fixed by #6340
Assignees
Labels
enhancement Some improvement that isn't a feature

Comments

@benz0li
Copy link
Contributor

benz0li commented Jul 8, 2023

What is your suggestion?

Update Code to 1.80

Why do you want this feature?

Are there any workarounds to get this functionality today?

Are you interested in submitting a PR for this?

@benz0li benz0li added the enhancement Some improvement that isn't a feature label Jul 8, 2023
@benz0li
Copy link
Contributor Author

benz0li commented Jul 8, 2023

@code-asher VS Code 1.80.0 was released two days ago: https://code.visualstudio.com/updates/v1_80

Take a .1/.2-release as base for a new code-server release.
ℹ️ .0-releases have had some fundamental bugs.

  1. use the .0/.1-releases as base for a release candidate (RC)
  2. test, debug and fix; maybe do another RC-release
  3. update codebase to the .2-release
  4. test, debug and fix
  5. release

@aleleba
Copy link

aleleba commented Jul 10, 2023

@code-asher I want to subscribe to this, we need to update the VSCode Version, maybe we can automate this process, I will be honored to help you in this task of automation if you want.

@aleleba
Copy link

aleleba commented Jul 11, 2023

@code-asher I have been reading the code of the project and notice that vscode is a submodule of this project, I found some documentation on how the project can automate the process of update the submodules with github actions. I attach some docs for this: https://tommoa.me/blog/github-auto-update-submodules/ . The development team can focus con make the product better and not need to remind to update submodules.

@code-asher
Copy link
Member

Updating the submodule is pretty easy, the more difficult part is resolving conflicts with the patches and I am not sure that can be fully automated.

@code-asher code-asher self-assigned this Jul 11, 2023
@aleleba
Copy link

aleleba commented Jul 14, 2023

@code-asher if you teach me on how to resolve this conflicts, I can assist the team on my free time 👍🏼

@code-asher
Copy link
Member

That would be fantastic! We use quilt for patches so the basic workflow is:

  1. Update VS Code submodule to the new version
  2. quilt push -f
  3. If there are conflicts then resolve them
  4. quilt refresh
  5. Back to step two until there are no more patches

If you are not familiar with quilt, the conflicts get placed in .rej files so resolving just means looking at those files and adding the changes back manually.

More details here: https://coder.com/docs/code-server/latest/CONTRIBUTING#version-updates-to-code

Often the conflicts are just simple line changes. Upstream added a new line, moved a line, etc, so we just have to re-apply our changes in the new context.

If you decide to tackle this please feel free to lean on me for any support you might need.

@aleleba
Copy link

aleleba commented Jul 15, 2023

@code-asher, this docs are great, I will start working on this the next week on my free time, thank you for the docs, I will be reading it, and let you know if I have some doubts, thank you to let me help on this amazing project.

@benz0li
Copy link
Contributor Author

benz0li commented Jul 15, 2023

@code-asher How to get the correct replacement SHA-256 value?

index.html.rej

--- lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
+++ lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index.html
@@ -5,7 +5,7 @@
 	<meta charset="UTF-8">
 
 	<meta http-equiv="Content-Security-Policy"
-		content="default-src 'none'; script-src 'sha256-N4YFn5ze5crjPqMK/opogKs7bSGWtf3lmjV/3LfbSOs=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
+		content="default-src 'none'; script-src 'sha256-B5FRTRmagxqZ2yiS/ip5EgFZJPHAF0G0O3NgwgN6hhg=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
 
 	<!-- Disable pinch zooming -->
 	<meta name="viewport"

@benz0li
Copy link
Contributor Author

benz0li commented Jul 15, 2023

@aleleba FYI: Docker image glcr.b-data.ch/jupyterlab/python/base:latest-devtools1 contains code-server and has all prerequisites installed to build code-server itself.
ℹ️ See JupyterLab Python docker stack for more information about this image.

Footnotes

  1. Multi-arch: linux/amd64, linux/arm64/v8

@benz0li
Copy link
Contributor Author

benz0li commented Jul 15, 2023

P.S.: 1.80.1 released

@code-asher
Copy link
Member

code-asher commented Jul 17, 2023 via email

@benz0li
Copy link
Contributor Author

benz0li commented Jul 19, 2023

My basic workflow from scratch:

Update Code

  1. Clone repository
    git clone https://github.com/coder/code-server.git
  2. Update VS Code submodule to the new version
    cd code-server
    git submodule init
    git submodule update
    cd lib/vscode
    git checkout 1.80.1
    cd ../..
  3. quilt push -f
    • If there are conflicts then resolve them
  4. quilt refresh
    • Back to step three until there are no more patches

Set version

export VERSION='4.15.0-rc.1'

Install dependencies

yarn

Build code-server

yarn build
yarn build:vscode
KEEP_MODULES=1 yarn release

Build release packages

yarn release:standalone
yarn test:integration
yarn package

Then, I deploy at https://coder.jupyter.b-data.ch/ (image R (base:test-devtools-docker)) and test some functionality manually.

@benz0li
Copy link
Contributor Author

benz0li commented Jul 19, 2023

Command code-server --version in JupyterLab Terminal returns 0.0.0 070a5a3179fe8213102854bcb37607bda690358f with Code 1.80.1.
ℹ️ In code-server > Help > About the version is correctly displayed: v4.15.0-rc.1

@code-asher Can you tell why that is?

@code-asher
Copy link
Member

Hmmm good question. It pulls the version from the package.json so maybe it did not get updated somehow?

That said, I launched https://coder.jupyter.b-data.ch and opened the JupyterLab terminal and it gives me the right version!

jupyterlab

@code-asher
Copy link
Member

code-asher commented Jul 19, 2023

Actually that is not the right version. Previous version. My bad. Will test a bit and see if I get the same issue.

@benz0li
Copy link
Contributor Author

benz0li commented Jul 20, 2023

Actually that is not the right version. Previous version. My bad. Will test a bit and see if I get the same issue.

Most likely you started image R (jupyterlab/r/verse:latest-devtools-docker) instead of R (base:test-devtools-docker).

@code-asher
Copy link
Member

code-asher commented Jul 20, 2023

Ahh thank you! Looks like we set the version in the release.yaml flow just before publishing releases.

If I recall correctly we have this because we wanted the ability to promote an RC to a full release without having to rebuild it (so we can just replace the version without rebuilding since that would technically be a different, untested build) but it has not been fully implemented yet (we still have to set VERSION during build time for the version embedded in VS Code).

I think at some point what we will need to do is remove VERSION and dynamically update lib/vscode/product.json the same way we do package.json instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants