Open ChrisHirsch opened 2 years ago
So the good news is that this is incredibly easy to do as the code already HAS this as shown here: https://github.com/robotpy/pyfrc/blob/25afdc204051b36d087123a353906bd88f6eb644/pyfrc/mains/cli_deploy.py#L453 23 days ago from this changeset: https://github.com/robotpy/pyfrc/commit/507a907f3c90f6661382a425e5346a6436b5cd15
This will detect if we're in a git repo and then write out a deploy.json which contains the right info.
The real stuff that needs to be done is to update the RIO because 2222.4.1.2 has this code whereas 2022.3.1.1 does NOT RoboRIO has WPILib version 2022.3.1.1 ERROR: expected WPILib version 2022.4.1.2
Once we have the info written to disk then the robot code just needs to open the file, parse JSON, and publish the info to the network tables.
cat ./home/lvuser/py/deploy.json {"deploy-host": "DESKTOP-80HA89O", "deploy-user": "ehsra", "deploy-date": "2023-03-02T17:54:14", "code-path": "C:\Users\ehsra\Documents\Github\Robot-2023", "git-hash": "3f4e89f138d9d78093bd4869e0cac9b61becd2b9", "git-desc": "3f4e89f-dirty", "git-branch": "fix-recal-nbeasley"}admin@roboRIO-3200-FRC:/#
PR for 2023 implementation is here: https://github.com/Raptacon/Robot-2023/pull/136
Description
By showing the code version from the tag, the drive team can confirm the correct version
Is your feature request related to a problem? Please describe. Currently the deployed code must be witnessed, instead, let's make it easy to see. If it's a tag, show the tag. Otherwise show branch and hash
Describe the solution you'd like As part of the deploy script, get the hash and branch info and write to the bot. Read that info and write to network tables.