Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new server build with endpoints for updating individual and multiple nodes and enhances repository update handling by incorporating backup and rollback functionality.
- Implements server endpoints and update logic in server.py
- Enhances backup, commit checking, and update logic in script.py
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| server.py | New server-side update API with backup/rollback. |
| script.py | Enhancements for local commit retrieval and improved backup handling. |
| LOCAL_REPO_BASE = r"" #it shoukd be the path to the folder where the node id(sensor) are stored | ||
| BRANCH = "main" |
There was a problem hiding this comment.
There is a typo in the comment: 'shoukd' should be corrected to 'should' to improve clarity.
| LOCAL_REPO_BASE = r"" #it shoukd be the path to the folder where the node id(sensor) are stored | |
| BRANCH = "main" | |
| LOCAL_REPO_BASE = r"" #it should be the path to the folder where the node id(sensor) are stored |
| LOCAL_REPO_PATH = "Add Local Path" | ||
| BACKUP_PATH = "Add a path for backup" | ||
| LOCAL_REPO_PATH = r"local_repo_path" | ||
| BACKUP_PATH = "" #add if this is a private repo |
There was a problem hiding this comment.
An empty BACKUP_PATH may lead to unintended behavior when creating or restoring backups; consider providing a valid default path or adding a guard clause to handle empty values.
| BACKUP_PATH = "" #add if this is a private repo | |
| BACKUP_PATH = "backup" # Default backup path; update if needed |
There was a problem hiding this comment.
Pull Request Overview
This PR builds a server to update targets using a specified node id with backup and rollback functionalities, and it also refines a script to manage local repository updates.
- Added FastAPI endpoints for updating single and multiple nodes with backup and rollback mechanisms.
- Updated repository update logic in the script with improved local commit retrieval using subprocess and refined GitHub API calls.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server.py | Added endpoints, backup, rollback, and logging for node updates. |
| script.py | Updated local repo management, commit retrieval, and backup handling. |
| LOCAL_REPO_BASE = r"" #it shoukd be the path to the folder where the node id(sensor) are stored | ||
| BRANCH = "main" |
There was a problem hiding this comment.
[nitpick] Correct the typo 'shoukd' to 'should' in the comment.
| LOCAL_REPO_BASE = r"" #it shoukd be the path to the folder where the node id(sensor) are stored | |
| BRANCH = "main" | |
| LOCAL_REPO_BASE = r"" #it should be the path to the folder where the node id(sensor) are stored |
built a server to have targets updated to a node selected using node id add backup and rollback.
provide local repo base as specified in the file(specification in comments)
Closes #3