An action for keeping track of technical debt as it is created
To use this action within your workflow, you need to include the following code:
steps:
- name: Generate technical debt issue
uses: teepsdonnelly/debt-collector@v1.0.0
with:
token: ${{github.token}}
You can customise this command using the following variables
Variable | Default | Required? | Description |
---|---|---|---|
title_prefix | [DEBT] | false | The prefix used for debt collection issues |
title_start | <!--\\[DEBT_ISSUE_TITLE\\]--> |
false | # Used to find the Title. See regex |
title_end | line | false | # Used to find the title end location. Options: [paragraph, line, regex] |
title_end_regex | false | # Used if title_end is regex. See regex | |
body_start | <!--\\[DEBT_BODY_START\\]--> |
false | # Used to find the body start location. See regex |
body_end | paragraph | false | # Used to find the body end location. Options: [paragraph, line, regex]* |
body_end_regex | <!--\\[DEBT_BODY_END\\]--> |
false | # Used if body_end is regex See regex |
token | github.token | true | The github token used by this action |
*line is defined as everything upto the first dot.
We use regex to power this action to allow for natural language to be used when creating the technical debt. By default we use markdown comments to detect a technical issue, but this could easily be configured to work with inline phrases.
E.g. A new technical debt of [here goes title]. To resolve we should [here goes body]
Don't know regex? Get started simply using RegExr
When defining regex for this action. You NEED to be aware of the following statements.
- Regex should be double escaped. So regex of
<!--\[DEBT_BODY_START\]-->
should be<!--\\[DEBT_BODY_START\\]-->
- Regex should not start with a forwardslash as we automatically apply it
- Regex should not end with a forwardslash or flags.
- We automatically apply the flag
multiline
- We automatically apply the flag
case insensitive
Your pull request body / comment / original post must contain any required descriptors as outlined in your workflow, and any optional ones you wish to propagate to your issue to be generated by the action:
- [DEBT_ISSUE_TITLE] (Required) -- A title for the GitHub issue to be generated
- [DEBT_ISSUE_BODY] (Optional) -- A description for the GitHub issue to be generated
## New Debt Created
<!--[DEBT_ISSUE_TITLE]--> Refactor logging in with social accounts. <!--[DEBT_ISSUE_BODY] --> Currently, the logic for logging in with social accounts is at the view layer in the app. It needs to be moved out into a helper class and we should utilize the ViewModel appropriately to give the View what it needs. Let's keep our views as dumb as possible for readability and maintainability.
Refactor logging in with social accounts. Currently, the logic for logging in with social accounts is at the view layer in the app. It needs to be moved out into a helper class and we should utilize the ViewModel appropriately to give the View what it needs. Let's keep our views as dumb as possible for readability and maintainability.
This will automatically trigger creation of the technical debt issue in GitHub that can be later utilized to fix the technical debt introduced by a particular pull request.
Helps track the progress of this project
- Checks if pull request comment contains descriptors for technical debt, if so it creates a GitHub issue based on technical debt descriptors used, as outlined below
- Check to see if debt (issue) already exists (Assigned. @tgtgamer)
- Store debt in json for later use (Assigned. @tgtgamer)
- Add comment debt finding (//DEBT, #DEBT, /** DEBT)
- Estimate descriptor. It would be nice (and scary) to see some relative level of effort pile up with the debt
- Aggregation of technical debt metrics and support for badging on repo, similar to Code Coverage badging, to enable keeping track of technical debt versus maintainable code at a glance