Coder Social home page Coder Social logo

osowskit / jira-link-updater Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 3.0 37 KB

GitHub App that replaces JIRA IDs in Issue comments with a URL to the JIRA issue

Home Page: https://github.com/apps/jira-link-updater

Ruby 100.00%
github-app jira github-enterprise

jira-link-updater's Issues

Handle missing JIRA URL

Problem

#7 requires that the JIRA fqdn is stored in a YAML file.

Discussion

It is possible to create an issue in each repository that can't load a JIRA URL stating jira-link-updater GitHub App requires the YAML file, displays a warning if the YAML is malformed, and possibly creates the YAML file as a template.

Gracefully handle both .com and Enterprise

This app was written to assume GitHub Enterprise instance with a single JIRA url. This limits installations for both companies with multiple JIRA instances and .com users.

  • Handle API calls for both GHE and .com
  • #7 load JIRA hostname per repository
  • Consider queuing webhook events and processing them later

Load JIRA hostname from repository file

Problem

Loading the JIRA_HOSTNAME from an environment variable ties a single running app to one url. This limits allowing multiple JIRA instances - either on an internal network or for supporting github.com.

Requirements

  • Define YAML file that needs to exist in each repository
  • Modify App permissions to read a single file
  • Modify App to read and use this information
  • Determine how to cache JIRA URLs
    • Reading this file for each webhook can have serious performance implications

Handle matches in Issue `body`

Handle pull_request created event and replace matches in body

Consider replacing ID in the title hyperlinks in title don't show up so can be ignored

Allow comment edits to trigger link replacement

The source currently ignores issue_comment : updated events to naively avoid processing this integration updating a comment

# Ignore Updated or Deleted comments
if webhook_action == "opened"

The webhook payload will contain returns a sender:type:Bot that can be checked to ignore an update by this integration. However, for a user update - this may not prevent the app attempting to nest the link.

Handle Webhooks at Scale

Problem

Very active repositories may eventually time out with serial processing of webhooks. GitHub may also be temporarily unavailable so handle retrying.

Discussion

  • Store webhook events and process them separately.
  • Gracefully fail when GitHub's API is unavailable
  • Cache the jira URL instead of loading it each webhook

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.