Skip to content
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

Move detect board up in promise structure #36593

Merged
merged 4 commits into from
Sep 11, 2020
Merged

Move detect board up in promise structure #36593

merged 4 commits into from
Sep 11, 2020

Conversation

epeach
Copy link

@epeach epeach commented Sep 3, 2020

Discussion of issue on Slack: https://codedotorg.slack.com/archives/C0T0EGE8L/p1597679764001300

Summary - A while ago, we fixed an issue - the fourth step on the maker setup-page would display a link to the Adafruit to flash firmware, but the directions at the link were for CPC and would not work for CPE. However, we received a report that there was a similar issue when the third step fails.

This PR adds both links for the third step. Previously, the board type was detected after the third step, so this PR also detects the board type before the third step. To do this, I pulled the detectBoardType method out of SetupChecker so that it had fewer dependencies (relies just on port).

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@epeach epeach requested a review from a team September 3, 2020 17:31
/**
* Detects the type of board plugged into the serial port. Defaults to BOARD_TYPE.OTHER.
*/
export function detectBoardTypeFromPort(port) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add unit tests for this function? it's pretty simple now, but my assumption is that we'll be refactoring this method to add logic for detecting micro:bit, and it'll be useful to have test coverage once we add more logic here

Copy link
Author

Choose a reason for hiding this comment

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

Good call - added!

Copy link
Contributor

@maddiedierker maddiedierker left a comment

Choose a reason for hiding this comment

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

LGTM!

@epeach epeach merged commit 654aa74 into staging Sep 11, 2020
@epeach epeach deleted the setup-fail-express branch September 11, 2020 19:54
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.

None yet

2 participants