Giter VIP home page Giter VIP logo

github-webhook-cloud-function's People

Contributors

eddies avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

github-webhook-cloud-function's Issues

Memoize API calls to Trello

Memoize API calls to Trello

The API calls to Trello for getBoardId and getCustomFields should be memoized to avoid making more HTTP requests than necessary.

Trello Card Ids at end of branch names

Trello Card Ids at end of branch names

We presently support branch names that lead with the trello card id immediately followed by a forward slash, e.g. nqPiDKmw/9-grand-canyon-national-park.

This is inconvenient in a day-to-day command-line workflow. It requires developers to remember the card id when switching branches, e.g. git checkout nqPiDKmw/9-grand-canyon-national-park. It would be preferable if the card id was at the end of the branch name, e.g. grand-canyon-national-park#nqPiDKmw (or with some other separator). This would allow developers to switch/checkout branches without having to remember the card id.

All of the logic for parsing the branch name for the card id is isolated to getShortLink

Flexible placement of Trello Card IDs

Flexible placement of Trello Card IDs

#20 changed the behavior of the cloud function to require the Trello card id at the end of the branch name, e.g. grand-canyon-national-park#nqPiDKmw.

The previous behavior expected the Trello card id at the beginning, e.g. nqPiDKmw/9-grand-canyon-national-park (which mapped neatly onto the latter part of the Trello card url).

Either style of branch naming should be allowed.

Capture force push events

Description

When a branch is force pushed, the Trello comment should indicate that the push was forced, e.g.

josh force pushed ... instead of the current josh pushed ...

PR comment wipes out review status

PR comment wipes out review status

Steps to Reproduce the Problem

  1. Assign a reviewer to a PR
  2. Verify that the associated Trello card's "review" field contains the assigned reviewer
  3. Reviewer requests changes
  4. Verify that the associated Trello card's "review" field is updated with the "changes requested" status (i.e. a red circle)
  5. Make a comment to the PR
  6. The associated Trello card's "review" field is now empty

Update dev dependencies (2019-02)

Update dev dependencies (2019-02)

Update eslint, eslint-plugin-import and jest:

Package               Current  Latest
eslint                  5.4.0  5.14.0
eslint-plugin-import   2.14.0  2.16.0
jest                   23.5.0  24.1.0

PR Status with Custom Fields

PR Status with Custom Fields

Use Trello's Custom Fields to indicate PR status on a card.

Currently, github-webhook-cloud-function adds an attachment URL to a Trello card when a PR is opened. It would be great if the front of the card could indicate the PR status: open, closed or merged.

Labels could be used as an indicator, but by default, you only see the label color, so you would have to know what color meant what, even more problematic if you were already using the label color for something else.

A Custom Fields of type list, could have three options: open, closed and merged, and each can have a color assigned.

Relevant Links

Maintain persistent connections

Maintain persistent connections

Per https://cloud.google.com/functions/docs/bestpractices/networking, we should

...maintain persistent connections in a function. Failure to do so can result in quickly exhausting connection quotas

and provides an example of using http.Agent({keepAlive: true}) to "maintain persistent connections instead of creating a new connection upon every function invocation".

Relevant Links

(I'm not sure if the second link applies, in which case we may run into issues if we implement this)

HTTP 207 Multi-Status

HTTP 207 Multi-Status

pull_request events with action opened can result in multiple API calls to Trello, e.g.:

  • POST an attachment URL
  • GET boardId
  • GET Custom Fields for a board
  • POST Custom Field to a board
  • PUT custom field to a card

If the Custom Fields Power-Up is not enabled for a board, the POST Custom Field will fail with a 403 Forbidden.

If the board has a Custom Field named 'PR' but is missing one of 'Open', 'Closed' or 'Merged' list options, the PUT will fail with a 500.

So, the attachment URL could succeed but one or more of the subsequent operations could fail. One way to handle this in the response is to return an HTTP 207 Multi-Status.

Alternatively, we could use a 200 with a better response body. Presently, however, we're returning 200s for events that we are not supporting (but doesn't represent an error), e.g. a pull_request event with action 'labeled'. Because we use a different status code (201) for events we do support, it's easy to distinguish the two when parsing logs on GCP and Webhook results from GitHub.

Relevant Links

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.