Giter Club home page Giter Club logo

mouse's People

Contributors

kiedtl avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

mouse's Issues

Mouse does not commit changes

Mouse does not commit changes at some point, and as a result, Mouse crashes on `mouse backup when git-crypt refuses to unlock the repository and mouse tries to parse the encryptes json.

The output error for mouse backup:

ERROR An unhandled exception was thrown in Mouse.
ERROR Please report the following error code:
INFO    Error string: exception@mouse(v1.1.4):[34~37~libexec/mouse-backup.ps1@entrypoint/cmd_exec]:[backup|]:[5.1.17134.407]:[Desktop::10.0.17134.0]::[NotSpecified: (:) [ConvertFrom-Json], ArgumentException]::[System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand]::[]::[C:\Users\*****]::[ConsoleHost]@incident[a6bd033d6ef75fca64e5bd587c272fe2202ff601]

I think this is caused when Mouse crashes and does not have time to commit changes elsewhere. I suggest adding a finally block to the main entrypoint so that is mouse crashes, it still commits any changes (if there are any) and locks the repository.

Mouse does not pop location after `mouse sync` command

It looks like Mouse does not pop location after executing mouse sync:

kiedtl ~ ❯❯❯ mouse sync
Error: this repository is already locked.
From github.com:Kiedtl/my-mouse-repo
 * branch            master     -> FETCH_HEAD
Already up to date.
Everything up-to-date
Synchronized repository with GitHub.
Error: this repository is already locked.
kiedtl ~\..\dat git: master ≢ ❯❯❯

Mouse relocks repo after being told to unlock it

After executing the command mouse protect unlock, Mouse then re-locks the repository.
I think it has to do with this code in bin/mouse.ps1, line 103:

        # --snip--
    }
    finally {
        git-crypt lock
    }
}

This locks the repo after each command, even if that command unlocked the repository in purpose.
I suggest we replace that code with this:

        # --snip--
    }
    finally {
        if (!($cmd -eq "protect")) {
            git-crypt lock
        }
    }
}

Better error tracking and logging

Mouse currently does not report exceptions that occur to a central bug tracking database, it instead merely shows a generated error string to the user, which I strongly suspect never will be possible be reported.
I suggest that we utilize Sentry.io to store our error reports and then export them to GitHub Issues. Yes, Sentry DOES NOT support PowerShell, but it does support .NET Standard/Core/Framework/Whatever, so we can either:

  • write our own class to report errors
  • or utilize [vtsingaras/RavenPowerShell](Mouse currently does not report exceptions that occur to a central bug tracking database, it instead merely shows a generated error string to the user, which I strongly suspect never will be possible be reported.
    I suggest that we utilize Sentry.io to store our error reports and then export them to GitHub Issues. Yes, Sentry DOES NOT support PowerShell, but it does support .NET Standard/Core/Framework/Whatever, so we can either:
  • write our own class to report errors
  • or utilize [vtsingaras/RavenPowerShell), which I strongly recommend.
    I tried out the RavenPowerShell class, but it seemed pretty buggy. After hooking it up to this function:
. "C:\Users\blah\mouse\lib\ravenclient.ps1"
. "C:\Users\blah\mouse\lib\errors.ps1"
[string]$dsn = "<blah blah blah blah blah blah blah blah>"

$ravenClient = New-RavenClient -SentryDsn $dsn

try {
    throw "big bad error"

} catch {
    $ravenClient.CaptureException($_)
}

I received several errors.
Anyway.
I think we can just debug this class and add it to our project.

Another thing we need to think about is a better logging scheme.
For v1.2.0, we should add a --show-logs flag to all our commands that will output detailed logging information, including the output of Git and Git-Crypt, which is currently being silenced. It will make life a lot easier for the people who test and debug this application. Even when the logging flags are not set, Mouse should still log to a file (which I think ought to be in share/logs/whateverlogsname.log, but it could be anywhere else).

I think that the logging feature should be implemented in the same way that every other class on Mouse is implemented, by creating a file lib/logging.ps1 and implementing a function of the type function Write-Log([string]$outmachine, [string]$statuscode, [string]$text, [string]$outfile ); where the $outmachine is the program producing the output (like Git or Mouse or Git_Crypt), where the statuscode is the statuscode, and the text is the log itself.
The log should follow the form of ::

2019-01-07T11:31:58.5634006-05:00 MOUSE UE404: The file or directory requested was not found.

Mouse current version should not be hardcoded in version.dat

Until now, Mouse has gotten its current version string from the share/version.dat file. I suggest instead that in all files, Mouse instead receives its version string from a central function in lib/core.ps1. This can save a lot of unnecessary commiting in internal updates.
Everytime we need to bump the version number, we can simply update that central function.

restor command does not work

On typing mouse restore .scoop, the following exception is thrown:

At C:\Users\blah\.mouse\app\libexec\mouse-restore.ps1:126 char:1
+ }
+ ~
Unexpected token '}' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : UnexpectedToken

`mouse develop` does not work

when using the develop command, even when the current branch is master, develop command displays the following output:

fatal: not a git repository (or any of the parent directories): .git
INFO  On branch develop
INFO  Switching to branch master
fatal: not a git repository (or any of the parent directories): .git

and ends at the ~/.mouse location, instead of popping at where the last location was.

`mouse update` doesn't update

When updating Mouse with the mouse update command, the following output is observed:

kiedtl ~ ❯❯❯ mouse update
fatal: not a git repository (or any of the parent directories): .git
Updating Mouse... done
Successfully updated Mouse.
fatal: not a git repository (or any of the parent directories): .git
git-crypt: Error: 'git status' failed - is this a Git repository?
kiedtl ~ ❯❯❯

I appears that Mouse is cding to the wrong location.

Change config location

I suggest that the config location be changed back to $HOME/.mouse/app/share/config.json instead of where is now, with a gitignore to prevent git from tracking the config file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.