Skip to content

fix: version in about dialog #5057

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 4 commits into from
Mar 31, 2022
Merged

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Mar 31, 2022

Before 1.64 the entire product configuration was sent to the client but
that was removed so we have to add anything we want to use on the
client, like the code-server version (used in the about dialog).

It needs to be separate from the localize call since the language
version of that string is used and it will not include a spot for the
code-server version.

I also moved the "v" so we do not get "vUnknown".
Before 1.64 the entire product configuration was sent to the client but
that was removed so we have to add anything we want to use on the
client, like the code-server version (used in the about dialog).

Fixes coder#5027.
This will catch if we are not sending the actual version to the client.
@codecov
Copy link

codecov bot commented Mar 31, 2022

Codecov Report

Merging #5057 (6e86f8a) into main (d796cc2) will not change coverage.
The diff coverage is n/a.

❗ Current head 6e86f8a differs from pull request most recent head c8d8d08. Consider uploading reports for the commit c8d8d08 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5057   +/-   ##
=======================================
  Coverage   71.30%   71.30%           
=======================================
  Files          30       30           
  Lines        1683     1683           
  Branches      373      373           
=======================================
  Hits         1200     1200           
  Misses        413      413           
  Partials       70       70           

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 d796cc2...c8d8d08. Read the comment docs.

@code-asher code-asher marked this pull request as ready for review March 31, 2022 21:01
@code-asher code-asher requested a review from a team March 31, 2022 21:01
- "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
+ "code-server: v{4}\nCode: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
+ return localize('aboutCodeServerDetail',
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't looked into how localize works but I assume if it doesn't find something for aboutCodeServerDetail then it returns the string unlocalized aka this should just work?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. Really we could just leave out the localize call here since no one will be localizing it and it does not have anything that needs localizing anyway but...just in case I guess.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. I like that you opted for it since it matches the patterns used by the surrounding code.

Copy link
Member Author

Choose a reason for hiding this comment

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

My thinking exactly!

Copy link
Contributor

Choose a reason for hiding this comment

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

image

Comment on lines +9 to +13
const isDevMode = process.env.VSCODE_DEV === "1"

// Look for code-server info div.
const element = await codeServerPage.page.waitForSelector('div[role="dialog"] >> text=code-server')
const element = await codeServerPage.page.waitForSelector(
`div[role="dialog"] >> text=code-server: ${isDevMode ? "Unknown" : "v" + version}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice improvement!

@code-asher code-asher merged commit 5bc26e9 into coder:main Mar 31, 2022
@code-asher code-asher deleted the fix-version-dialog branch March 31, 2022 21:14
TinLe pushed a commit to TinLe/code-server that referenced this pull request Apr 23, 2022
* Fix code-server version not appearing in other languages

It needs to be separate from the localize call since the language
version of that string is used and it will not include a spot for the
code-server version.

I also moved the "v" so we do not get "vUnknown".

* Add code-server version to product configuration

Before 1.64 the entire product configuration was sent to the client but
that was removed so we have to add anything we want to use on the
client, like the code-server version (used in the about dialog).

Fixes coder#5027.

* Refresh patches

* Change version test to look for specific version

This will catch if we are not sending the actual version to the client.
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.

2 participants