Skip to content

Conversation

@y-sudharshan
Copy link
Contributor

@y-sudharshan y-sudharshan commented Apr 29, 2025

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

@y-sudharshan y-sudharshan self-assigned this Apr 29, 2025
Copy link

Copilot AI left a 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.

Comment on lines +11 to +12
LOCAL_REPO_BASE = r"" #it shoukd be the path to the folder where the node id(sensor) are stored
BRANCH = "main"
Copy link

Copilot AI Apr 29, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
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
Copy link

Copilot AI Apr 29, 2025

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.

Suggested change
BACKUP_PATH = "" #add if this is a private repo
BACKUP_PATH = "backup" # Default backup path; update if needed

Copilot uses AI. Check for mistakes.
@y-sudharshan y-sudharshan requested a review from Copilot April 29, 2025 08:36
Copy link

Copilot AI left a 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.

Comment on lines +11 to +12
LOCAL_REPO_BASE = r"" #it shoukd be the path to the folder where the node id(sensor) are stored
BRANCH = "main"
Copy link

Copilot AI Apr 29, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Develpo a dedicated update server for nodes

2 participants