-
Notifications
You must be signed in to change notification settings - Fork 0
Server build for target updates #4
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
Copilot
AI
Apr 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Copilot
AI
Apr 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
Copilot
AI
Apr 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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