Skip to content

Add script-run repo update warnings with opt-in auto-pull and local-change handling#914

Open
arjunsuresh with Copilot wants to merge 4 commits into
devfrom
copilot/add-update-detection-feature
Open

Add script-run repo update warnings with opt-in auto-pull and local-change handling#914
arjunsuresh with Copilot wants to merge 4 commits into
devfrom
copilot/add-update-detection-feature

Conversation

Copilot AI commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

🧾 PR Checklist

Script execution now detects when the underlying git-backed repo is behind upstream and surfaces a non-blocking warning by default. It also adds an opt-in --auto-pull-repo flow that handles local modifications safely instead of prompting on every run.

  • Default update signal (no forced prompt)

    • Detects upstream divergence for the selected script repo on top-level runs.
    • Warns with commit lag and changed file list (capped for readability).
  • Script-specific relevance

    • Flags when the currently selected script path is included in upstream changes.
  • Opt-in auto update

    • Adds auto_pull_repo / MLC_AUTO_PULL_REPO handling.
    • With local changes:
      • interactive mode: choose keep/discard/cancel
      • quiet mode: skip auto-pull safely
    • Pull path uses fast-forward-only semantics.
  • Resilience

    • Adds bounded git command timeouts.
    • Replaces hardcoded operational values with named constants.
# simplified flow added in script run path
status = _get_repo_update_status(repo_path, script_relative_path)
if status["update_available"]:
    warn_changed_files(status)
    if auto_pull_repo:
        _auto_pull_repo_updates(repo_path, quiet, logger, recursion_spaces)
  • Target branch is dev

📌 Note: PRs must be raised against dev. Do not commit directly to main.

📁 File Hygiene & Output Handling

  • No unintended files (e.g., logs, cache, temp files, pycache, output folders) are committed

📝 Comments & Communication

  • Proper inline comments are added to explain important or non-obvious changes
  • PR title and description clearly state what the PR does and why
  • Related issues (if any) are properly referenced (Fixes #, Related to #, etc.)

🛡️ Safety & Security

  • No secrets or credentials are committed
  • Paths, shell commands, and environment handling are safe and portable

Copilot AI changed the title [WIP] Add feature to detect updates in repository Add script-run repo update warnings with opt-in auto-pull and local-change handling Apr 20, 2026
Copilot AI requested a review from arjunsuresh April 20, 2026 21:43
@arjunsuresh
arjunsuresh marked this pull request as ready for review April 22, 2026 00:03
@arjunsuresh
arjunsuresh requested a review from a team as a code owner April 22, 2026 00:03
@arjunsuresh
arjunsuresh changed the base branch from main to dev May 8, 2026 19:08
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.

Is it possible to detect whether any updates available in the repo whenever we running a script?

2 participants