aeliot / todo-registrar
Register TODOs from source code in issue tracker
Installs: 2 996
Dependents: 0
Suggesters: 0
Security: 0
Stars: 15
Watchers: 1
Forks: 1
Open Issues: 17
Type:application
pkg:composer/aeliot/todo-registrar
Requires
- php: ^8.2
- ext-ctype: *
- ext-mbstring: *
- ext-simplexml: *
- ext-tokenizer: *
- aeliot/env-resolver: ^1.0.2
- aeliot/todo-registrar-contracts: ^1.0.2
- bugrov/yandex-tracker: 0.1.0
- guzzlehttp/guzzle: ^7.9
- http-interop/http-factory-guzzle: ^1.2
- kbsali/redmine-api: ^2.8
- knplabs/github-api: ^3.14
- lesstif/php-jira-rest-client: ^5.8
- m4tthumphrey/php-gitlab-api: ^11.14
- psr/container: ^2.0
- psr/http-client: ^1.0
- symfony/config: ^7.4
- symfony/console: ^7.4
- symfony/dependency-injection: ^7.4
- symfony/deprecation-contracts: ^3.6
- symfony/finder: ^5.4|^6.0|^7.0
- symfony/validator: ^7.4
- symfony/yaml: ^3.4|^4.0|^5.0|^6.0|^7.0
Requires (Dev)
- dg/bypass-finals: ^1.7
- phpstan/phpstan: ^2.0
- roave/security-advisories: dev-latest
- dev-main
- v3.x-dev
- v3.0.0
- v2.3.1
- 2.3.0
- v2.2.0.3
- v2.2.0.2
- v2.2.0.1
- v2.2.0
- v2.1.0
- v2.0.0
- v1.8.0
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.1.1
- v1.1.0
- v1.0.0
- dev-todo-action
- dev-todo-registrar
- dev-dev-doc
- dev-vscode
- dev-Case-of-config
- dev-forbid-empty-list-of-tags
- dev-inline-config-styles
- dev-processing-summary_old
- dev-doc-issue-template
- dev-dev-scripts-tests-phpstan
- dev-inline_config
This package is auto-updated.
Last update: 2026-01-09 17:33:15 UTC
README
It takes TODO/FIXME and other comments from your php-code and register them as issues in Issue Trackers like JIRA. With all necessary labels, linked issues and so on.
Motivation
Time to time developers left notes in code to not forget to do something. And they forget to do it. One of the main reason is that it is difficult to manage them.
Why do developers left comment in code instead of registering of issues? It is convenient. You don't need to deal with UI of Issue Tracker and to fill lots of field. And lots of times to register each issue. It takes time. The second reason, comment in code permit to mark exact place which have to be modified. And many other reasons. No matter why they do it. They do it and leave this comments for years.
Somebody have to manage it.
So, we need in tool which will be responsible for registering of issues and save time of developers. After that you can use all power of management to plan solving of lacks of your code.
This script do it for you. It registers issues with all necessary params. Then injects IDs/Keys of created issues into comment in code. This prevents creating of issues twice and injected marks helps to find proper places in code quickly.
How it works
- Detect TODO in comment.
- Create issue in issue tracker (list of supported).
- Inject number of ticket into TODO-comment.
Using
Basic using:
- Create configuration file.
- Call shell script with necessary command line options.
- Commit updated files. You can config your pipeline/job on CI which commits updates.
There are prepared several ways of using:
- Using of GitHub Action: TODO Registrar Action.
- Using of Docker Container.
- Using of PHAR file.
- Using of Composer Package.
I recommend TODO Registrar Action for repositories hosted on GitHub.
The next recommendation is using of Docker container. It provides fully isolated solution. There is no matter which version of PHP installed in yous system and which components required by Composer (no dependency hell).
The next one is using of single PHAR file. It frees you from dependency hell,
but you have to pay attention to version of PHP installed in you system and its modules.
However, this may be more familiar for you.
The last one is using of Composer package. The most common, but less flexible method.
Using of Docker Container
You can use the pre-built Docker image from GitHub Container Registry:
- Pull the latest image
docker pull ghcr.io/aeliot-tm/todo-registrar:latest
- Run script with necessary command line options
docker run --rm -it \ -v $(pwd):/code \ ghcr.io/aeliot-tm/todo-registrar:latest <options>
Important notes:
- Mount your project directory to
/code(this is the working directory inside the container). - Use
-itflags for interactive mode if you need to see real-time output. - The container uses unbuffered output, so messages will appear in real-time.
- Pass necessary environment variables instructions
-e $VAR_NAMEor by the creating of.envfile with necessary variables in the root of project. - PHAR file inside the container (
/usr/local/bin/todo-registrar). You can rely on it.
Using of PHAR file
- Download PHAR directly to root directory
wget -O todo-registrar.phar "https://github.com/Aeliot-Tm/todo-registrar/releases/latest/download/todo-registrar.phar" - Call script with necessary command line options
php todo-registrar.phar <options>
Additional instructions how to verify package read here.
Alternatively, you can install phar file by PHIVE
- Install phar file (by default it will be installed in directory
toolsin the root of project without extension)phive install todo-registrar
- Call script with necessary command line options
tools/todo-registrar <options>
Additional instructions read here.
Using of Composer Package
- Require the package as development dependency
composer require --dev aeliot/todo-registrar
- Call script with necessary command line options
vendor/bin/todo-registrar <options>
Command Line Options
First of all, pay attention to available options:
| Long Form | Short From | Description |
|---|---|---|
--config=/path/to/config |
-c /path/to/config |
Path to configuration file when it is not in default place |
-q, -v, -vv, -vvv |
Verbosity levels. The command uses Symfony Console verbosity levels |
NOTE: You can pass a special value--config=STDIN then script obtains YAML from STDIN.
Integration on CI
The main idea is monitoring of new TODOs on single branch of repository to avoid creation of duplicated issues by competing processes and avoid merge conflicts.
The branch should be quite stable (without development directly in it. At the same time,
it should be as close to development as possible for earlier catching of tech-debt.
Soon of all, it is called development, but main/master is useful too.
Configure you integration depending on used git-server:
- GitHub Action (use TODO Registrar Action)
- Configure GitLab CI
Configuration
First of all you have to create general config.
Additionally, script supports inline configuration - nice feature for the fine-tuning of each created issue. It helps flexibly configure different aspects of created issues like labels, components, relations to other issues and so on. So, it becomes mighty tool. 😊
Supported tags
It detects TODO and FIXME by default. At the same time, you can config your custom set of tags in config file.
Whey will be detected case insensitively.
Supported formats of comments:
It detects TODO-tags in:
- single-line comments started with both
//and#symbols - multiple-line comments
/* ... */ - phpDoc
/** ... **/.
Comments can be formatted differently:
// TODO: comment summary // TODO comment summary // TODO@assigne: comment summary /** * TODO: XX-001 comment summary * with some complex description */
And others. See all supported formats.
Supported Issue Trackers
Currently, todo-registrar supports the following issue trackers:
| Issue Tracker | Description |
|---|---|
| GitHub issues | Supported via API tokens. See description of configuration |
| GitLab | Supported via API tokens (HTTP Token or OAuth). See description of configuration |
| JIRA | Supported via API tokens. See description of configuration |
| Redmine | Supported via API keys or Basic Auth. See description of configuration |
| Yandex Tracker | Supported via OAuth tokens. See description of configuration |
| Any custom Issue Tracker | Read about customization |
Articles
RU: https://habr.com/ru/articles/832994/
