GithubHelp home page GithubHelp logo

cdzombak / thingshub Goto Github PK

View Code? Open in Web Editor NEW
17.0 4.0 2.0 592 KB

[UNMAINTAINED] Synchronize issues assigned to you from a Github repo into Things.

License: MIT License

Ruby 0.91% Objective-C 92.08% Makefile 1.00% C 0.32% Roff 3.42% Shell 2.26%
things3 github applescript scriptingbridge sync

thingshub's Introduction

Unmaintained

No Maintenance Intended

Unmaintained: Due to several factors (apparent Things.app instability when using Scripting Bridge, bugs like #34 resulting in odd duplicates and project splits, and the GitHub Authorizations API going away which will require rewriting large parts of the software), I’m no longer devoting any time to this project.


ThingsHub

Synchronize issues assigned to you, one-way, from a Github repo into Things.

Usage

Configuration

ThingsHub checks for a config file at ~/.thingshubconfig, then traverses from the home directory down to the current dir (or from the root to the current dir, if the current directory isn't in ~), merging in .thingshubconfig files as it finds them.

This means you can put global configuration and defaults (eg. githubLogin, tagNamespace) in ~/.thingshubconfig, leaving project-specific settings (eg. repoOwner, repoName, areaName, projectPrefix) in your-project-dir/.thingshubconfig, sort of like using git's configuration system.

Configuration parameters may additionally be specified on the command line, like -githubLogin cdzombak. Parameters specified on the command line override those found in any configuration files.

See thingshubconfig.example in this distribution for details on the configuration format.

You may also want to add .thingshubconfig to your ~/.gitignore.

Run with the -verbose flag to see the final, resolved configuration.

Parameters

These may be used in a configuration file (param = value) or on the CLI (-param value).

  • githubLogin: your Github username. Required.
  • tagNamespace: namespace to use as a prefix for tags imported from Github. Optional; default is "github".
  • delegate: the sync delegate used to communicate with the local task manager app. Optional; default is Things. Currently only Things is supported.
  • map.label name (-"map.label name" on the CLI, if you need spaces): map a Github label to a local tag name. Optional.
  • repoOwner: the owner of the Github repo to sync. Required.
  • repoName: the Github repo to sync. Required.
  • areaName: the area in Things to use for this project. Optional; default is none.
  • projectPrefix: prefix which will be applied to project names & tasks’ titles (before the issue number). Optional; default is none.

Run

The simplest usage is just to run thingshub and specify all configuration options on the command line.

Alternatively, run thingshub from a project's directory, optionally specifying configuration options via the CLI. ThingsHub will configure itself from your configuration files as described in the Configuration section.

Logout/Reset Github OAuth Token

thingshub -logout <GitHub Username>

Version Check

thingshub -version

Installation

Current version: v1.1.1.

Installation requires Xcode.

Get the most recent release and run make install. This will install thingshub to /usr/local/bin and its man page to /usr/local/share/man/man1.

Troubleshooting

Ensure that the target directories exist and you can write to them.

Workflow

  • This never updates GitHub from Things; GitHub is the source of truth.
  • This will always create issues in Anytime. You can move them to Today/Upcoming/Someday as desired.
  • This will move issues to areas/projects to reflect milestone changes. This doesn't change the todo between Today/Anytime/Upcoming/Someday.

Why one way sync? Why GitHub as the source of truth?

  • Issues may be modified by many people online, increasing the chance of conflicts if you modify an issue locally.
    • Conflict management is easy this way, and we probably won't lose much data.
  • Issues are often closed as side effects of other operations (merges, commits), so closing issues in your client usually won't make much sense.
  • Descriptions on Todos are often used in your task management software for personal notes.
  • The entire one-way sync operation is idempotent, so partial sync failures are easily recoverable; just re-trigger the sync.

Sync (to Things)

  • Milestones, if any, are represented as projects in your selected Area, or if no Area, as projects in Anytime/Someday. Projects' due dates reflect the milestone due date.
  • Milestones: each project's due date, tags, and status are updated every sync. Name and notes are only touched when creating a new Project.
  • A project is not created for an open milestone if you have no issues assigned to you in that milestone.
  • Issues without a milestone are placed directly in the selected Area, or if no Area, into Anytime. (If updating an existing task, we won't move it back into Anytime, though.)
  • Todos and projects are marked as incomplete/complete based on open/close status in Github. Todos/projects that exist for deleted/unassigned milestones/issues are marked as canceled.
  • We only search for existing issues in Today, Anytime, Upcoming, Someday, Projects, and Trash — not Inbox or Logbook.
  • We don't touch due dates or handle scheduling for tasks.
  • Issues: todo's project/area, tags, name, and status are updated every sync. Notes are only touched when the todo is created.
  • Pull requests are treated the same as issues, with "(PR #xxx)" instead of just "(#xxx)" in the name.

Tags

  • When a todo is created/updated, remove any extant "github:" tags, and apply "github:" tags that are currently on the issue.
  • When creating/updating a todo/project, add a "via:github" tag.

Contributors

Thanks to:

License

MIT; see LICENSE in this distribution.

Dev Notes

  • Run make bootstrap to set up a local, self-contained environment for CocoaPods. Its only external dependency is Bundler.
  • make pods runs bundle exec pod install for you.

Implementation details

Things

Identifying synced items:

The following will be placed in the notes field for relevant projects/todos:

  • //thingshub/ORG/REPO/issue/###//
  • //thingshub/ORG/REPO/milestone/###//

Reference Material

Things and Scripting Bridge

RAC

Github API

KVC, Predicates

NSRunLoop

thingshub's People

Contributors

andrewsardone avatar cdzombak avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

thingshub's Issues

Migrate away from deprecated GitHub Authorizations API

From GitHub:

We will remove the Authorizations API endpoint on November 13, 2020. We recommend updating your application to use the web flow https://developer.github.com/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow

You can learn more about these changes by visiting our developer blog https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/

Unfortunately the version of OctoKit this app uses is extremely old, and this migration might be too much effort to be worth the trouble.

Update README

Include:

  • new sync rules and implementation details
  • usage and configuration instructions

Unable to run thingshub

Trying to run thingshub on my Mac.

My .thingshubconfig is:

githubLogin = sergeyzwezdin
repoOwner = sergeyzwezdin
repoName = <some private repo>

When I run the thingshub in console I see the following error:

$ thingshub

Merging config file /Users/sergey/.thingshubconfig
Merging config file /Users/sergey/.../.thingshubconfig
ℹ️ No Things area is selected. If you expected tasks and projects to be created in an area, ensure the area exists and is spelled correctly in your configuration.
Syncing: Milestones
2020-04-19 14:15:59.827 thingshub[33772:2428029] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[SBProxyByCode setName:]: object has not been added to a container yet; selector not recognized [self = 0x7ff980c98050]'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff32c44d07 __exceptionPreprocess + 250
        1   libobjc.A.dylib                     0x00007fff6b9695bf objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff32c44b65 +[NSException raise:format:] + 189
        3   CoreFoundation                      0x00007fff32ba957b ___forwarding___ + 1427
        4   CoreFoundation                      0x00007fff32ba8f58 _CF_forwarding_prep_0 + 120
        5   thingshub                           0x000000010c4fdcec thingshub + 11500
        6   thingshub                           0x000000010c5012a8 thingshub + 25256
        7   thingshub                           0x000000010c555b65 thingshub + 371557
        8   thingshub                           0x000000010c53d822 thingshub + 272418
        9   thingshub                           0x000000010c555b65 thingshub + 371557
        10  thingshub                           0x000000010c53d822 thingshub + 272418
        11  thingshub                           0x000000010c555b65 thingshub + 371557
        12  thingshub                           0x000000010c53f08f thingshub + 278671
        13  thingshub                           0x000000010c55610a thingshub + 373002
        14  thingshub                           0x000000010c53f012 thingshub + 278546
        15  thingshub                           0x000000010c550ee4 thingshub + 351972
        16  thingshub                           0x000000010c54fb18 thingshub + 346904
        17  thingshub                           0x000000010c54fcdd thingshub + 347357
        18  thingshub                           0x000000010c555b65 thingshub + 371557
        19  thingshub                           0x000000010c53d822 thingshub + 272418
        20  thingshub                           0x000000010c555b65 thingshub + 371557
        21  thingshub                           0x000000010c53f08f thingshub + 278671
        22  thingshub                           0x000000010c55610a thingshub + 373002
        23  thingshub                           0x000000010c53f012 thingshub + 278546
        24  thingshub                           0x000000010c550ee4 thingshub + 351972
        25  thingshub                           0x000000010c54fb18 thingshub + 346904
        26  thingshub                           0x000000010c54fcdd thingshub + 347357
        27  thingshub                           0x000000010c555b65 thingshub + 371557
        28  thingshub                           0x000000010c53d822 thingshub + 272418
        29  thingshub                           0x000000010c545e56 thingshub + 306774
        30  thingshub                           0x000000010c54610a thingshub + 307466
        31  thingshub                           0x000000010c555b65 thingshub + 371557
        32  thingshub                           0x000000010c53d822 thingshub + 272418
        33  thingshub                           0x000000010c555b65 thingshub + 371557
        34  thingshub                           0x000000010c53f08f thingshub + 278671
        35  thingshub                           0x000000010c55610a thingshub + 373002
        36  thingshub                           0x000000010c53f012 thingshub + 278546
        37  thingshub                           0x000000010c550ee4 thingshub + 351972
        38  thingshub                           0x000000010c54fb18 thingshub + 346904
        39  thingshub                           0x000000010c54fcdd thingshub + 347357
        40  thingshub                           0x000000010c555b65 thingshub + 371557
        41  thingshub                           0x000000010c53d822 thingshub + 272418
        42  thingshub                           0x000000010c555b65 thingshub + 371557
        43  thingshub                           0x000000010c53f08f thingshub + 278671
        44  thingshub                           0x000000010c55610a thingshub + 373002
        45  thingshub                           0x000000010c53f012 thingshub + 278546
        46  thingshub                           0x000000010c550ee4 thingshub + 351972
        47  thingshub                           0x000000010c54fb18 thingshub + 346904
        48  thingshub                           0x000000010c54fcdd thingshub + 347357
        49  thingshub                           0x000000010c555b65 thingshub + 371557
        50  thingshub                           0x000000010c53d822 thingshub + 272418
        51  thingshub                           0x000000010c53d822 thingshub + 272418
        52  thingshub                           0x000000010c55546a thingshub + 369770
        53  thingshub                           0x000000010c555562 thingshub + 370018
        54  thingshub                           0x000000010c53ea1f thingshub + 277023
        55  thingshub                           0x000000010c53d822 thingshub + 272418
        56  thingshub                           0x000000010c53d822 thingshub + 272418
        57  thingshub                           0x000000010c555b65 thingshub + 371557
        58  thingshub                           0x000000010c53d822 thingshub + 272418
        59  thingshub                           0x000000010c555b65 thingshub + 371557
        60  thingshub                           0x000000010c53f08f thingshub + 278671
        61  thingshub                           0x000000010c55610a thingshub + 373002
        62  thingshub                           0x000000010c53f012 thingshub + 278546
        63  thingshub                           0x000000010c550ee4 thingshub + 351972
        64  thingshub                           0x000000010c54fb18 thingshub + 346904
        65  thingshub                           0x000000010c54fcdd thingshub + 347357
        66  thingshub                           0x000000010c555b65 thingshub + 371557
        67  thingshub                           0x000000010c53d822 thingshub + 272418
        68  thingshub                           0x000000010c5242c5 thingshub + 168645
        69  thingshub                           0x000000010c53a03a thingshub + 258106
        70  thingshub                           0x000000010c55610a thingshub + 373002
        71  thingshub                           0x000000010c539d7a thingshub + 257402
        72  thingshub                           0x000000010c550ee4 thingshub + 351972
        73  thingshub                           0x000000010c54f776 thingshub + 345974
        74  thingshub                           0x000000010c53a03a thingshub + 258106
        75  thingshub                           0x000000010c55610a thingshub + 373002
        76  thingshub                           0x000000010c539d7a thingshub + 257402
        77  thingshub                           0x000000010c550ee4 thingshub + 351972
        78  thingshub                           0x000000010c5500a6 thingshub + 348326
        79  thingshub                           0x000000010c53a03a thingshub + 258106
        80  thingshub                           0x000000010c53e31f thingshub + 275231
        81  libdispatch.dylib                   0x00007fff6cab66c4 _dispatch_call_block_and_release + 12
        82  libdispatch.dylib                   0x00007fff6cab7658 _dispatch_client_callout + 8
        83  libdispatch.dylib                   0x00007fff6cabcc44 _dispatch_lane_serial_drain + 597
        84  libdispatch.dylib                   0x00007fff6cabd5d6 _dispatch_lane_invoke + 363
        85  libdispatch.dylib                   0x00007fff6cac6c09 _dispatch_workloop_worker_thread + 596
        86  libsystem_pthread.dylib             0x00007fff6cd11a3d _pthread_wqthread + 290
        87  libsystem_pthread.dylib             0x00007fff6cd10b77 start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException
[1]    33772 abort      thingshub

Am I miss anything in configuration?

Fix login-twice race condition

> thingshub -githubLogin cdzombak -repoOwner cdzombak -repoName thingshub -areaName Developer -projectPrefix ThingsHub -delegate Things
Merging config file /Users/205703/.thingshubconfig
Warning: invalid configuration line (invalid key): "githubRepo = Override Me"
Github password for user cdzombak:
x
Github password for user cdzombak:
Two-factor auth code:
x

Authentication failed: Sign In Required
Sync failed: Sign In Required

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.