Skip to content

Wizard: fallback to displaying all parameters and scriptts if a stable release is not available #3153

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Williangalvani
Copy link
Member

@Williangalvani Williangalvani commented Feb 19, 2025

This allows loading navigator parameters on navigator64, and loading parameters from stable versions on beta/dev firmware

Copy link

sourcery-ai bot commented Feb 19, 2025

Reviewer's Guide by Sourcery

This pull request enhances the Wizard component by implementing fallback mechanisms for firmware versioning and script loading. It ensures that if a stable firmware version is unavailable, the system falls back to beta or development versions. Similarly, if version-specific scripts are not found, the system defaults to displaying all Rover scripts. Additionally, the parameter set filtering logic was modified to display all parameters if the firmware version is 'DEV' or 'BETA', and the sanitized name of the parameter set was modified to include the last 3 parts of the path.

Sequence diagram for fetching firmware version with fallback

sequenceDiagram
  participant Wizard Component
  participant availableFirmwares
  participant SemVer

  Wizard Component->>availableFirmwares: fetchLatestFirmwareVersion()
  availableFirmwares-->>Wizard Component: Firmware[] (stable, beta, dev)
  alt stable firmware found
    Wizard Component->>SemVer: new SemVer(stable.name.split('-')[1])
    SemVer-->>Wizard Component: SemVer object
  else beta firmware found
    Wizard Component->>Console: console.warn('No stable firmware found, falling back to beta')
    Wizard Component-->>Wizard Component: return 'BETA'
  else dev firmware found
    Wizard Component->>Console: console.warn('No stable or beta firmware found, falling back to dev')
    Wizard Component-->>Wizard Component: return 'DEV'
  else no firmware found
    Wizard Component->>Console: console.error('No firmware found')
    Wizard Component-->>Wizard Component: return undefined
  end
Loading

File-Level Changes

Change Details Files
Modified the firmware version fetching logic to include fallback mechanisms for beta and development versions if a stable version is not available.
  • Modified fetchLatestFirmwareVersion to return 'BETA' or 'DEV' strings if stable firmware is not found.
  • Added checks for 'BETA' and 'DEV' firmwares in fetchLatestFirmwareVersion.
  • Modified the return type of fetchLatestFirmwareVersion to include string values.
  • Added console warnings when falling back to beta or dev firmwares.
  • Added a console error when no firmware is found.
core/frontend/src/components/wizard/DefaultParamLoader.vue
core/frontend/src/components/wizard/Wizard.vue
Adjusted the script filtering logic to include a fallback mechanism to display any Rover script if a version-specific script is not found.
  • Modified filtered_scripts to include a fallback to any Rover script if a version-specific script is not found.
  • Added a loop to try matching scripts with major version first, then fallback to any Rover script.
core/frontend/src/components/wizard/ScriptLoader.vue
Modified the parameter set filtering logic to display all parameters if the firmware version is 'DEV' or 'BETA'.
  • Modified filtered_param_sets to display all parameters if the firmware version is 'DEV' or 'BETA'.
core/frontend/src/components/wizard/DefaultParamLoader.vue
Modified the sanitized name of the parameter set to include the last 3 parts of the path.
  • Modified filtered_param_sets_names to include the last 3 parts of the path.
core/frontend/src/components/wizard/DefaultParamLoader.vue

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

1 participant