Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a todocheck-bot for reopening issues on github if unclosed TODOs are present #57

Open
preslavmihaylov opened this issue Sep 7, 2020 · 7 comments
Labels
enhancement New feature or request epic

Comments

@preslavmihaylov
Copy link
Owner

The most tedious part of using todocheck is that when someone closes an issue as they assume it's done, all future todocheck CI steps start to fail as there are TODOs referenced to a closed issue.

This requires someone to manually reopen the issue in order to unblock all failing CI pipelines.

By having a bot automate this process, this would improve user experience \w todocheck tremendously.

The scope of this task is to create a github action called todocheck-bot, which triggers on "issue closed" events, runs todocheck against the repository & reopens the issue if there are TODOs linked against the closed issue.

This is a big undertaking & might even require a separate repository and/or several follow-up tasks. But this project seems to be possible using Github actions, similar to this project

@preslavmihaylov preslavmihaylov added enhancement New feature or request epic labels Sep 7, 2020
@bengsparks
Copy link
Contributor

I would be interested in taking part in this issue. Has any work on this started yet?

@preslavmihaylov
Copy link
Owner Author

No, no work is started for this yet. You can take it on.

I would initially start with making a github action which runs todocheck on CI & validates the TODOs in your codebase

@bengsparks
Copy link
Contributor

Here is the current state of work: https://github.com/bengsparks/todocheck-bot.
If issue references were included in the todocheck output, then the support for Github is about 90% complete.

@preslavmihaylov
Copy link
Owner Author

Aren't they included? You link todos with e.g. // TODO #25: ... and 25 is the issue ID in github

@bengsparks
Copy link
Contributor

The standard output does include them in their output:

ERROR: Issue doesn't exist
testing/scenarios/swift/main.kt:1: /* TODO 1: Add Spring dependencies (open issue) */

However, the JSON style output does not:

{
        "type": "Issue doesn't exist",
        "filename": "testing/scenarios/swift/main.kt",
        "line": 1,
        "message": ""
},

The JSON style output is probably the better option here, simply because it is easier to load into JS / TS, and the todocheck bot wouldn't have to reimplement the parsing already done by todocheck in order to extract the issue ref from the comment.

@preslavmihaylov
Copy link
Owner Author

Ahh, you're right. I've opened a follow-up issue for that - #162

Feel free to take that up as well if interested.

@bengsparks
Copy link
Contributor

bengsparks commented Sep 16, 2021

The first working proof of concept can be found here:
https://github.com/bengsparks/todocheck-bot/releases/tag/v0.0.2.

The workflow is triggered by this file.

It currently does nothing else except just reopening prematurely closed issues and lacks QoL features such as commenting why the issue was suddenly reopened.
Another interesting avenue to pursue might be to prevent merging PRs if issues that would be closed thereby are still in the codebase.

But I suppose now that GitHub is at least supported we can move discussion to repository mentioned above?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request epic
Projects
None yet
Development

No branches or pull requests

2 participants