Skip to content

Patches 1.70 #5422

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

Merged
merged 20 commits into from
Aug 17, 2022
Merged

Patches 1.70 #5422

merged 20 commits into from
Aug 17, 2022

Conversation

fritterhoff
Copy link
Contributor

Hello :)

I started playing around with the new version 1.70. Some patches must be adjusted...

  • The telemetry will need a larger fix - I simply made it a nop client for my first tests
  • The storage service maybe must be checked ...
  • I assume the language fix is still required but I am not sure if the fix still works. The previously new file languagePacks.ts now contains the following fragment(?):
export class WebLanguagePacksService extends LanguagePackBaseService {
	// Web doesn't have a concept of language packs, so we just return an empty array
	getInstalledLanguages(): Promise<ILanguagePackItem[]> {
		return Promise.resolve([]);
	}
}

Feel free to close the PR if my changes don't help at all 😉

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 8, 2022

@fritterhoff first, thank you so much for doing this! This is a huge help 🎉

@code-asher since you have more context on some of these patches, do you mind reviewing?

@fritterhoff
Copy link
Contributor Author

For sure, some further work will be required... Esp. fixing the telemetry seems to be a bit cumberstone

@code-asher
Copy link
Member

Thanks for getting us started! I will hopefully have time later this week to finish it out. 🤞

@fritterhoff
Copy link
Contributor Author

fritterhoff commented Aug 10, 2022

FYI: I just rebased my branch on the code-server main branch. Sadly the CI needs an approval again 😉

@codecov
Copy link

codecov bot commented Aug 10, 2022

Codecov Report

Merging #5422 (92a6ca2) into main (bef78e6) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5422   +/-   ##
=======================================
  Coverage   72.44%   72.44%           
=======================================
  Files          30       30           
  Lines        1673     1673           
  Branches      366      366           
=======================================
  Hits         1212     1212           
  Misses        398      398           
  Partials       63       63           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bef78e6...92a6ca2. Read the comment docs.

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 10, 2022

I'm going to try adding a label to this PR which should auto-rebase (I think) and even deploy your PR to npm. Let's give it a try.

UPDATE: looks like I still have to Approve each time :/ I'll be out Thurs/Fri so @code-asher can help if you need an approval

@fritterhoff
Copy link
Contributor Author

Alright. Maybe it would help if a dummy PR created by me gets merged... According to GitHub only first time contributors require approval 🤣

@fritterhoff
Copy link
Contributor Author

From my point of view the e2e tests did fail due to an internal error and not due to my changes?

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 10, 2022

Yes, looks like an internal GitHub Actions error:

image

repo-ranger bot and others added 8 commits August 10, 2022 21:17
Also remove it from script-src since it is invalid anyway.
Also no need to set the key since it will be in the migration (and even
if not it will be set by the next function call).
Just to keep it consistent with the other imports.  We initially added
the patch like this so it was not part of the upgrade but might as well
fix it now.
@code-asher
Copy link
Member

code-asher commented Aug 12, 2022

Awesome work @fritterhoff, I implemented the telemetry and everything else looks great (I just added back some comments and made two other small tweaks not really related to the update).

Going to do a bit more testing then open this as ready for review.

@code-asher
Copy link
Member

Display language is not working for me, maybe there is some conflict between our patch and the stuff upstream has been adding. Ideally we would use upstream's but they mentioned their implementation is not quite ready so we might need to look into how to cut it out for now.

@fritterhoff
Copy link
Contributor Author

Awesome work @fritterhoff, I implemented the telemetry and everything else looks great (I just added back some comments and made two other small tweaks not really related to the update).

Going to do a bit more testing then open this as ready for review.

Great thanks for the feedback and sorry about the comments... in a first step I was happy that I had a working version 1.70 😉

Display language is not working for me, maybe there is some conflict between our patch and the stuff upstream has been adding. Ideally we would use upstream's but they mentioned their implementation is not quite ready so we might need to look into how to cut it out for now.

I'm not sure what the expected behavior is or what isn't working here? I only tried to install a language pack and that was working 😁 So feel free to give me a hint what got broken in the new version 😉

@code-asher
Copy link
Member

code-asher commented Aug 15, 2022 via email

@fritterhoff
Copy link
Contributor Author

Hi, I tried the German language pack. That worked fine. I'll check it again later and update my comment

@fritterhoff
Copy link
Contributor Author

So spanish and German work at least in the Installation fine. Chinese does not work.
Setting via the command menu does not work at all...

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 15, 2022

1.70 might have broken our language patch :( at least that's what we were discussing offline. Thank you for testing those and reporting back!

@fritterhoff
Copy link
Contributor Author

Well ok. I sort of expected something like that 😔

@code-asher
Copy link
Member

code-asher commented Aug 15, 2022 via email

@code-asher code-asher marked this pull request as ready for review August 16, 2022 23:13
@code-asher code-asher requested a review from a team August 16, 2022 23:13
@code-asher
Copy link
Member

code-asher commented Aug 16, 2022

Language issues should be sorted, I will do a final check on the CI artifact once it is ready then merge.

@repo-ranger repo-ranger bot merged commit 3231405 into coder:main Aug 17, 2022
code-asher added a commit that referenced this pull request Aug 17, 2022
* Update upstream Code to 1.70

* Update CSP hashes

* Update comment on remote authority

Also remove it from script-src since it is invalid anyway.

* Use absolute path for disable download patch

Just to keep it consistent with the other imports.  We initially added
the patch like this so it was not part of the upgrade but might as well
fix it now.

* Fix inability to change language while code-server is running

Co-authored-by: Asher <[email protected]>
+ // Add a unique ID based on the current path for per-workspace databases.
+ // This prevents workspaces on different machines that share the same domain
+ // and file path from colliding (since it does not appear IndexedDB can be
+ // scoped to a path) as long as they are hosted on different paths.
+ return this.payload.id + '-' + hash(location.pathname.toString().replace(/\/$/, "")).toString(16);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this commit affect the migration/state collisions e2e test we have?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope it operates the same way; things just moved around a little bit.

@@ -108,7 +108,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
import { Schemas } from 'vs/base/common/network';
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
import { IProductService } from 'vs/platform/product/common/productService';
+import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService';
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! I don't know why i didn't do that before lol thanks for fixing.

+ // This must not use Node's require otherwise it will be cached forever.
+ // Code can get away with this since the process actually restarts but
+ // that is not currently the case with code-server.
+ return JSON.parse(fs.readFileSync(configFile, "utf8"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! How did you figure this out?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually fixed this before but it was lost when we switched to the fork so basically I was stepping through the code until suddenly I remembered this issue.

The first time around it just involved stepping through the code one step at time to figure out why the language object was empty until I arrived at this line and realized it would never update since requires are cached. I am not sure where that knowledge came from, probably read it somewhere or maybe it was from when we implemented tarfs which hijacks require.

@fritterhoff fritterhoff deleted the patches-1.70 branch August 18, 2022 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants