Skip to content

Conversation

@ChrisHirsch
Copy link
Contributor

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Associated Issue(s)

Issue: #110

Steps to Test

  1. Deploy Bot
  2. Observe Git Sha in shuffle board matches sha in deployed code

Changelog

Added Git Sha for deployed version

What?

Read from the deploy.json file (happens each deploy), parse it and then add value of git-hash to shuffleboard

Why?

The drivers want to know which version of code they are running with.

@ChrisHirsch ChrisHirsch requested a review from anisaa2326 March 4, 2023 00:37
# We should only need to do this once
wpilib.SmartDashboard.putString("Robot Version", self.getDeployInfo("git-hash"))
wpilib.SmartDashboard.putString("Git Branch", self.getDeployInfo("git-branch"))
wpilib.SmartDashboard.putString(
Copy link
Member

Choose a reason for hiding this comment

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

consider: creat a new network table for versions and config info. Seems like we should get better at organizing our data

else:
return f"Key: {key} Not Found in JSON"
except OSError:
return "unknown"
Copy link
Member

Choose a reason for hiding this comment

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

always capture error and print at least summary with error (except when it's normal and you don't want it. Like files does not exist you and it's expected to be missing sometimes). But unknown errors always print at least the summary. stack is preferred but optional. future you will thank you.

except OSError:
return "unknown"
except json.JSONDecodeError:
return "bad json in deploy file check for unescaped \ "
Copy link
Member

Choose a reason for hiding this comment

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

does decode error give any helpful tips back to location of error?


log = logging.getLogger("configMapper")


Copy link
Member

Choose a reason for hiding this comment

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

global: format only changes please revert in untouched files. if we want to update style do it on purpose I'm another Mr for style clean up. applys to other files in review also.

Copy link
Member

Choose a reason for hiding this comment

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

this file may have other changes. If so we should talk about differing styles and auto formatters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants