Add a check for shallow repos and move validation logic to the
GitRepo class. Additionally report the real number of commits behind.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use git-config to set track the current Moonraker instance managing a
a git repo. If multiple instances are detected log and create a repo
warning.
Singed-off-by: Eric Callahan <arksine.code@gmail.com>
Submodules contain a .git file that includes the path to the
actual repository folder. Extract that path and use it for
lock file detection.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use git-branch to determine current the current branch and
head state instead of git-status. The former is a porcelain
command with guaranteed output.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Streamline the rollback defaults so only one dict object
is explicitly defined in "capture_state_for_rollback()".
Validate the rollback branch on detached heads before
setting it.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use the newly implemented versions utility for git version parsing.
This allows for simple access to version information and
version comparison.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
If a git repo not configured on the dev channel it is necessary
to move the HEAD to the commit for the correct tag.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
When logging stderr in realtime omit the program name. It often
does not provide useful context. The program itself can provide
context through its own logging facilities.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add a debug logging helper to the base class. Use unique
logging prefixes for subclasses of AppDeploy.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Move specific configuration out of __init__ into several methods
that may be called by subclasses. This allows child implementations
to define and share specific sets of configuration that they require
without forcing all implementations to do so.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Remove hardcoded beta binding between Moonraker and Klipper.
This could result in a user getting stuck on a commit that requires
a future patch.
The original purpose of binding versions was to avoid a scenario
where Klipper introduces a feature incompatible with the current
Moonraker beta. Rather than binding the better solution is to
fix the incompatibility and tag a new beta.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This functionality was intended to allow for an automated
reinstallation between "git_repo" and "zip" types. The
"zip" type remains unused, and attempting to automate
this would likely be unreliable.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
If the exectuable in the virtualenv is not "python" attempt to
detect the python executable. Use the pip entry point for the
pip command.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Set the minimum value for the sync_rate to 1 second, rather
than above 1 second. When transitioning from a null spool
to a named spool clear tracked extrusion.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Require that "web" installations provide release info to validate
existing installations. For known web clients provide a fallback
that uses the manifest to validate the installation.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Do not report invalid if the remote or branch does not match
the configured values. In these conditions report them as
"repo_warnings" that frontends may display to the user.
Hard recovery now requires a recovery URL detected from the git
repo's "origin" remote. This closes a potential security issue where a
malicioius repo could be cloned over an installed repo.
Signed-off-by: Eric Callahan <arskine.code@gmail.com>
This closes a securitiy vulernability where the client could
be used to download and save a file from any configured
location.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This wrapper is an object that may be used to build requests
procedurally rather than submit all request parameters in
a call to "request()", "get()", etc. This is primarily useful for
usage in a Jinja2 context.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>