Translates between GitHub issues and SoA nodes
The phloem is the part of a tree that transports nutrients created by photosynthesis to other parts of the tree that need them. This code listens for new issues created in any number of GitHub repos and creates leaf nodes inside corresponding frames in the State of Affairs tree boards of a Miro organization.
-
- Start ngrok on port 8089:
ngrok http 8089or./ngrok http 8089
- Start ngrok on port 8089:
-
- Create a webhook in the GitHub repo.
- Enter your ngrok url with
payload/issuesappended as the Payload URL:http://********.ngrok.io/payload/issues - Set the content type to "application/json"
- During setup, under "Which events would you like to trigger this webhook?", first select "Let me select individual events." Then check "Issues" and un-check "Pushes".
- Save the webhook
- Create a webhook with these settings in each repo you want to link to the Miro board.
-
- Go to Miro > [Your organization] > Settings > Profile settings > Your apps [Beta].
- Add a new app and note the Client id and secret.
- Select the following scopes:
boards:readboards:writeboards_content:readboards_content:write
- Click "Install app and get OAuth Token" and follow the instructions.
- Note the access token Miro gives you.
-
- For each connected GitHub repo, create a frame in any Miro board in the organization.
-
- Make a config file called
config.rbwith the following consts defined. A sample config file (sample_config.rb) is provided to copy and edit.CLIENT_ID- Found in "manage apps" settings in MiroCLIENT_SECRET- Found in "manage apps" settings in MiroACCESS_TOKEN- API access token from MiroBOARD_ID- ID of Miro board, found in the board's URL: https://miro.com/app/board/[board id]/REPOS- Defines which repo links to which frame on which board. Each entry consists of a repo name which corresponds two pieces of data that define the frame in which new nodes will be created when an issue is opened:- Board ID: The board ID of a board is in its URL. In this URL
https://miro.com/app/board/i9E_keXrQeL=/the board id isi9E_keXrQeL=. - Widget ID: The ID of a frame. Right-click on the frame in Miro and select "Copy link". The link will look like
https://miro.com/app/board/i9E_keXrQeL=/?moveToWidget=2238459382770409338. The number at the end,2238459382770409338, is the Widget ID.
- Board ID: The board ID of a board is in its URL. In this URL
- Make a config file called
Done! New issues should now appear in the triage frame corresponding to their repo! You can move the frames anywhere on the board.
Run the server with ruby index.rb. When an issue is created you should see debugging output.
For development, stop and restart the Sinatra server when you make changes. Make sure to stop the server once you're done or it'll keep running "headless."