Skip to content

Feature: Check for latest version and show message in CLI#822

Merged
mohdsayed merged 16 commits into
release/v0.11.0from
feat/version-check
Sep 6, 2024
Merged

Feature: Check for latest version and show message in CLI#822
mohdsayed merged 16 commits into
release/v0.11.0from
feat/version-check

Conversation

@mohdsayed

@mohdsayed mohdsayed commented Aug 27, 2024

Copy link
Copy Markdown
Collaborator

Description

Add version check to the PSAT CLI to notify users when they are running an outdated version. Also, add the version is included in all generated reports for CLI and extension.

Relevant Technical Choices

  • Use the update-notifier package to check for the latest version and notify users.
  • Use the package version from package.json instead of hardcoding it.
  • Pass the version to the report and use it in the header component.
  • Retrieve the current extension version and include it in the header of the extension report.
  • Add psatVersion in downloaded report JSON file.

Testing Instructions

  • Go to packages/cli/package.json and reduce the version number.
  • Build and run the CLI to test if it can check and notify about the update.
  • The latest version check occurs after a certain time (e.g., 1 day) instead of running every time to reduce its impact on time and performance. This is currently disabled for easier QA testing. Once QA is complete, we'll enable it for further testing.
  • Open the dashboard report and verify that the current CLI version appears in the report header.
  • Download a report from the extension and confirm that the current extension version is displayed (which may differ from the CLI version).
  • Download report from the CLI dashboard and check if it includes psatVersion key in JSON file.

Additional Information:

Screenshot/Screencast

image


Checklist

  • I have thoroughly tested this code to the best of my abilities.
  • I have reviewed the code myself before requesting a review.
  • This code is covered by unit tests to verify that it works as intended.
  • The QA of this PR is done by a member of the QA team (to be checked by QA).

Fixes #815

@mohdsayed mohdsayed self-assigned this Aug 28, 2024
@pavanpatil1

Copy link
Copy Markdown
Collaborator

Hi @mohdsayed, I’ve reviewed the PR, and it mostly works fine. However, did notice a few issues, added below:

  • The report.html file does not display the version number. It should include the CLI/Extension version number in the report.
Screenshot 2024-08-29 at 1 54 34 PM
  • In dark mode, the extension number is difficult to see and not clearly visible.
Screenshot 2024-08-29 at 1 51 15 PM
  • Can we update the update notification something like as follows?
You are currently using PSAT CLI version v0.10.0. A newer version, v0.10.1, is available.

To update to the latest version, please run the following command: npm i -g @google-psat/cli 
  • After downgrading the CLI version (@psat/cli) in package.json, the "update available" message did not appear on the first run. It only started showing up after the second run.

@amedina amedina added this to the v0.11 milestone Aug 30, 2024
@amedina amedina added the enhancement New feature or request label Aug 30, 2024
@milindmore22 milindmore22 mentioned this pull request Sep 2, 2024
32 tasks
@mohdsayed

Copy link
Copy Markdown
Collaborator Author

@pavanpatil1

The report.html file does not display the version number. It should include the CLI/Extension version number in the report.

Fixed

In dark mode, the extension number is difficult to see and not clearly visible.

Fixed

Can we update the update notification something like as follows?

I think that's a lot of text to read. What we are showing is very precise and already approved.

After downgrading the CLI version (@psat/cli) in package.json, the "update available" message did not appear on the first run. It only started showing up after the second run.

I just learned that the package update-notifier we are using works that way. Read the comment in their example.js file. I will have to seek some alternative.

@mohdsayed

Copy link
Copy Markdown
Collaborator Author

@pavanpatil1

After downgrading the CLI version (@psat/cli) in package.json, the "update available" message did not appear on the first run. It only started showing up after the second run.

Pushed a fix for it, can you please try again.

@mohdsayed mohdsayed requested a review from amovar18 September 6, 2024 06:13
@pavanpatil1

Copy link
Copy Markdown
Collaborator

Verified the latest changes. Those are working fine.

@amovar18 amovar18 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@mohdsayed mohdsayed changed the base branch from develop to release/v0.11.0 September 6, 2024 07:01
@mohdsayed mohdsayed merged commit 43671b7 into release/v0.11.0 Sep 6, 2024
@mohdsayed mohdsayed deleted the feat/version-check branch September 6, 2024 07:01
@mohdsayed mohdsayed changed the title CLI: Check for latest version and show message Feature: Check for latest version and show message in CLI Sep 18, 2024
@mohdsayed mohdsayed mentioned this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants