All Projects → forcedotcom → git2gus

forcedotcom / git2gus

Licence: BSD-3-Clause license
A Github application to keep issues in sync with Agile Accelerator

Programming Languages

javascript
184084 projects - #8 most used programming language
EJS
674 projects

Projects that are alternatives of or similar to git2gus

Seam3
Cloudkit based persistent store for Core Data
Stars: ✭ 207 (+666.67%)
Mutual labels:  sync
Pull
🤖 Keep your forks up-to-date via automated PRs
Stars: ✭ 3,364 (+12359.26%)
Mutual labels:  sync
React Scroll Sync
Synced scroll position across multiple scrollable elements
Stars: ✭ 252 (+833.33%)
Mutual labels:  sync
Deck
decK: Configuration management and drift detection for Kong
Stars: ✭ 211 (+681.48%)
Mutual labels:  sync
S3sync
Really fast sync tool for S3
Stars: ✭ 224 (+729.63%)
Mutual labels:  sync
Go Fastdfs
go-fastdfs 是一个简单的分布式文件系统(私有云存储),具有无中心、高性能,高可靠,免维护等优点,支持断点续传,分块上传,小文件合并,自动同步,自动修复。Go-fastdfs is a simple distributed file system (private cloud storage), with no center, high performance, high reliability, maintenance free and other advantages, support breakpoint continuation, block upload, small file merge, automatic synchronization, automatic r…
Stars: ✭ 2,923 (+10725.93%)
Mutual labels:  sync
Syncmap
A typed implementation of the Go sync.Map using code generation
Stars: ✭ 200 (+640.74%)
Mutual labels:  sync
causefolio
For the community, by the community.
Stars: ✭ 44 (+62.96%)
Mutual labels:  work
Sync
JSON to Core Data and back. Swift Core Data Sync.
Stars: ✭ 2,538 (+9300%)
Mutual labels:  sync
Plex Sync
🎬 Command line utility for synchronizing Plex Media Server watched / seen status between multiple servers
Stars: ✭ 239 (+785.19%)
Mutual labels:  sync
Crdt Playground
Stars: ✭ 215 (+696.3%)
Mutual labels:  sync
Vuex Easy Firestore
Easy coupling of firestore and a vuex module. 2-way sync with 0 boilerplate!
Stars: ✭ 224 (+729.63%)
Mutual labels:  sync
Realmcontent
Light Realm-powered content management system
Stars: ✭ 237 (+777.78%)
Mutual labels:  sync
Sync
deprecated Brave sync server. (sync now uses a fork of the Chromium sync protocol.)
Stars: ✭ 208 (+670.37%)
Mutual labels:  sync
React Native Storage
local storage wrapper for both react-native and browser. Support size controlling, auto expiring, remote data auto syncing and getting batch data in one query.
Stars: ✭ 2,822 (+10351.85%)
Mutual labels:  sync
Gcr.io
🌀 sync the docker images of the gcr.io and quay.io
Stars: ✭ 200 (+640.74%)
Mutual labels:  sync
Realm Cocoa
Realm is a mobile database: a replacement for Core Data & SQLite
Stars: ✭ 14,778 (+54633.33%)
Mutual labels:  sync
ChronoChat
A simple but interesting demo to visualize how ChronoSync library works
Stars: ✭ 16 (-40.74%)
Mutual labels:  sync
client-side-databases
An implementation of the exact same app in Firestore, AWS Datastore, PouchDB, RxDB and WatermelonDB
Stars: ✭ 787 (+2814.81%)
Mutual labels:  sync
To Do
一个无后端待办事项应用,数据用 LeanCloud 进行同步。
Stars: ✭ 238 (+781.48%)
Mutual labels:  sync

Git2Gus Application

A GitHub application to keep issues in sync with Salesforce's Agile Accelerator.

This is an experimental project that is not yet supported, so while we appreciate feedback and welcome new issues, we can't guarantee response times and aren't ready to accept contributions. Thank you for understanding!

CircleCI

code style: prettier

Run Locally

First, make sure your dev environment is setup by reading the contributing section.

yarn
yarn dev

In another terminal launch smee to forward your github test app web hook events to your local dev machine.

smee -u <your smee address here> --path /webhook --port 1337

Now go and create issues in a test repo that has your test github app installed. Your GH app will forward web hook events to smee which will forward to your local node process. Since we can't connect to real GUS the best we can do is inspect the local database changes. Under development the database is a set of json files under <repo root>/.tmp/localDiskDb.

Contributing

An overall flow of the local development strategy:

+--------------------------+            +----------------------------+
|                          |            |                            |
|  Test Repo               |            |  Mock Github App           |
|                          |            |                            |
|                          |            |                            |
|  Create Issue            +----------->+  Detects issue created     |
|                          |            |                            |
|                          |            |                            |
|                          |            |                            |
+--------------------------+            +--------------+-------------+
                                                       |
                                           POSTs webhook via smee
                                                       |
                                                       v
+--------------------------+            +--------------+-------------+
|                          |            |                            |
|  local db file           |            |  Local git2gus node server |
|                          |            |                            |
|                          +<-----------+                            |
|  Manually verify         |            |  Creates GUS work entry    |
|  DB change               |            |  in local db file          |
|                          |            |                            |
+--------------------------+            +----------------------------+

git2gus a Github App, to contribute you'll need to follow Github's guide to set up your developement environment.

Steps to set up development:

  1. Create SMEE hook forwarder
smee -u <your smee address here> --path /webhook --port 1337
  1. Create a mock github app

    • The app needs Read & Write access to Issues, Pull Requests, and Commit Statuses. It also needs read access to "A single file" with the path .git2gus/config.json. You will also need to subscribe to events: Issue comment, Issues, and Label.
  2. Create a test repo and install mock github app to that repo

  3. Download github app PEM file, rename to private-key.pem, and place it in the project's root folder

    • If you want to set an env variable instead of copying the .pem file then you must use the name PRIVATE_KEY (instead of GITHUB_PRIVATE_KEY as the github instructions say) and you have to manually insert \n line characters between each line.
  4. Create .env file with github variables

    • NOTE: Some variable names are slightly different than the github guide, see example below.
    • You will need to specify a test organization/user to develop with as well as approved organizaitons your app will work with, see example below.
  5. Add variables specific to your Salesforce instance

    • Get your Record Type IDs from the Object Manager and copy the base URL from your Agile Accelerator, it should resemble the one included in the example.

    • When you later set up Heroku Connect, your database table and fields related to Agile Accelerator may have a prefix, which you will set as the SALESFORCE_PREFIX

  6. Add a link to your GitHub app (ex: the GitHub app for Salesforce's instance is https://github.com/apps/git2gus)

    • This will show up on the app's homepage
  • For SSO-enabled organizations, you must authenticate with a personal access token with full repo access. Using a personal access token is not required for non-SSO-enabled orgs. To use, in .env, set PERSONAL_ACCESS_TOKEN to your personal access token and TOKEN_ORGS to a comma-seperated list of organizations to use your personal access token with.

You're .env should look something like:

GITHUB_APP_ID=28467
GITHUB_WEBHOOK_SECRET=qqqq1111
GITHUB_APPROVED_ORGS=salesforce,sfdc,forcedotcom,salesforce-ux,SalesforceLabs,SalesforceFoundation
GITHUB_TEST_ORG=wes566
USER_STORY_RECORD_TYPE_ID=ABCDEFGHIJKLM
BUG_RECORD_TYPE_ID=NOPQRSTUVWXYZ
INVESTIGATION_RECORD_TYPE_ID=123456789012
WORK_ITEM_BASE_URL=https://myproject.lightning.force.com/lightning/r/ADM_Work__c/
GITHUB_APP_URL= https://github.com/apps/yourapplication
SALESFORCE_PREFIX=agf__

For use with SSO-enabled organizations, you would also have additional lines:

PERSONAL_ACCESS_TOKEN=abcdefghijklmnopqrstuvwxyz
TOKEN_ORGS=asdf

The GITHUB_TEST_ORG is the org where you have a repo with your test GH app installed to.

Set the user credentials for your Salesforce org with these environment variables. Other forms of authentication with Salesforce are not yet supported.

GUS_USER=005xxxxxxxxxxxxAAA
[email protected]
GUS_PASSWORD=example_password

Make sure your test app has Read & Write access to Issues, Pull Requests, and Commit Statuses. Also make sure it has read access to "A single file" and the path should be .git2gus/config.json. You will also need to subscribe to events: Issue comment, Issues, and Label.

Seeding your dev db

Sails has a built-in development db, called sails-disk, which is just a set of json files under <repo root>/.tmp/localDiskDb. The git2gus app will validate that the "build" you specified in the config is in the database so you'll need to make sure you've got an entry for that "build" in the adm_build__c.db file. For example, add a line like {"name":"218","sfid":"218","_id":1} to that file if your config is set to build "218".

Using

To use git2gus, you will need to set it up locally as described in the Contributing section and deploy it to a Heroku App with Postgres and Heroku Connect add-ons. The Postgres database will act as the app's database, and can then set up Heroku Connect between the Postgres database and your Salesforce instance.

To set your environment variables on Heroku, go to your apps settings tab and modify your config vars to reflect your .env file. Instead of uploading your private-key.pem, file, you can just copy its contents to a PRIVATE_KEY config var on your Heroku app's settings page.

To use, install your GitHub app on desired repositories. Your app's homepage will have set up and usage instructions for the actual syncing process between your GitHub repositories and your Salesforce instance.

Heroku Setup

To set up on your own Lightning Experience, host this app on Heroku and change the webhook URL of your GitHub app to point to [YOUR HEROKU APP URL]/webhook instead of smee.

To set up Heroku Connect, you may view the steps here.

In Heroku Connect, you will sync the ADM_Build_c, ADM_Change_List__c and ADM_Work__c tables. The fields are defined in herokuconnect.json. You can deploy that mapping with the Heroku Connect CLI plugin, but you'll have to change the connection settings before deploying.

As a reminder, if you see a prefix before the field name, set the SALESFORCE_PREFIX environment variable to that prefix.

It is recommended that you create a testing team. As a reminder, to create product tags, visit the app launcher and search "product tags". From here, you can create a product tag for your team, create assignment rules for bugs, user stories, and investigations, and then copy the product tag (you can generate a work URL for any assignment and copy the tag from the URL).

For a better logging experience, you may use the LogDNA add-on on Heroku. In your Heroku config vars, add your LogDNA API key as LOGDNA_INGESTION_KEY.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].