Skip to content

Commit bd876c6

Browse files
authored
Merge pull request #3 from TheRoboticsClub/week3
Week3 with delay
2 parents 3ea1620 + c17c4c3 commit bd876c6

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/_posts/2024-08-05-Week-3.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
3+
title: "Week 3 - Bug Fixing and PR Review"
4+
image: ../assets/images/logo.png
5+
categories:
6+
- Weekly Log
7+
tags:
8+
- GitHub Pages
9+
10+
---
11+
12+
# Summary
13+
14+
This week, I collaborated with the community to identify and resolve bugs, as well as review various pull requests. My primary contribution involved setting up a CI/CD pipeline to enforce a uniform code style and standardizing the frontend's interaction with both the Robotics Backend and the BT Studio backend.
15+
16+
# Style Pipeline
17+
18+
During my collaboration last week, I noticed that developers often introduced unnecessary diffs due to inconsistent code styles. As the project approaches maturity, it is becoming critical to address these issues.
19+
20+
After consulting with the developers, I configured two GitHub workflows: one for Python and another for JavaScript/JSX files.
21+
22+
For Python, we opted for the [Black Formatter](https://github.com/psf/black), a PEP8-compliant, opinionated code formatter. For JavaScript, we chose [Prettier](https://prettier.io/), one of the most widely adopted formatters in the industry. Currently, these pipelines are configured not to auto-format the code, as we believe that each developer should be responsible for writing code that adheres to the established style guidelines and familiarizing themselves with the formatting conventions.
23+
24+
# Refactoring with Async Functions
25+
26+
The BT Studio frontend had been increasingly relying on complex promise chains to manage communications with the Robotics Backend and the *tree_api*. To improve this, I proposed refactoring the codebase to utilize [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function). By allowing the use of the `await` keyword, async functions enable more readable and maintainable code, effectively handling asynchronous operations with cleaner promise-based behavior.
27+
28+
## Related PR
29+
30+
* [API Calls Standardized Using Async Functions and Await](https://github.com/JdeRobot/bt-studio/pull/174)
31+
32+
# Subtrees in PyTrees
33+
34+
This week, I also began exploring how to integrate subtrees into *PyTrees*, the Behavior Tree library used in BT Studio. In BT Studio, the graphical diagram is converted from JSON to XML, which is then parsed and executed by the *tree_gardener* library. This library constructs the trees as BehaviorTree objects within the *PyTrees* framework. I discovered that *PyTrees* provides [methods](https://py-trees.readthedocs.io/en/devel/modules.html#module-py_trees.trees) for inserting subtrees and performing various tree operations. I have started conducting offline tests to better understand and implement these features. I discussed with my mentors to make some offline demos for next week.
35+
36+
# Other contributions
37+
38+
## Contributed PRs
39+
40+
* [Better node selection highlight](https://github.com/JdeRobot/bt-studio/pull/170)
41+
* [Properly loading colors](https://github.com/JdeRobot/bt-studio/pull/168)
42+
* [Cleaning unnecesary cache files](https://github.com/JdeRobot/bt-studio/pull/156)
43+
44+
# Reviewed PRs
45+
46+
* [Adding zoom to fit button](https://github.com/JdeRobot/bt-studio/pull/147)
47+
* [Basic settings menu](https://github.com/JdeRobot/bt-studio/pull/142)

0 commit comments

Comments
 (0)