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

Not all PRs are worthy of a story #13

Closed
toddburnside opened this issue Oct 22, 2020 · 3 comments
Closed

Not all PRs are worthy of a story #13

toddburnside opened this issue Oct 22, 2020 · 3 comments

Comments

@toddburnside
Copy link
Contributor

With our workflow, we end up with a lot of PRs that we don't need or want to track in clubhouse. This is cluttering up clubhouse.

I considered making a PR that would not create a PR if you put a token in a PR title or description, or not create a story for a draft PR, or something along those lines. But as I thought about it more, it seemed like a different approach would work better for us.

The clubhouse github integration is what I would consider opt-in. In order to associate a PR with a story, you need to name the branch with the story id in it, put a token in any of a number of places, or add a label to the PR. I think an opt-in approach to creating a new story for a PR would work better for us. For example, placing a token like [ch-new] in the PR description.

Another advantage of this approach is not needing to check all of the ways in which a story can be associated with an existing clubhouse story. This GitHub action currently only checks the branch name - so, I assume a new story would be created even if the PR was being associated with one of the other methods. This would eliminate the need to try to check all of the other ways. It would also allow the user to create a PR and associate it with an existing story later, without creating a spurious new story when the PR was created.

If you are interested in this approach, I could submit a PR with a new config key named something like opt-in-only. If set to true, it would only create the story if the [ch-new] token was in the PR description. It would skip the branch name check.

@singingwolfboy
Copy link
Owner

Let me direct you to the documentation for GitHub Actions where it describes the jobs.<job_id>.if syntax. You can use that to define whatever condition you want for whether this create-linked-clubhouse-story action should run.

Sometimes, the best solutions to a problem lie entirely outside of the codebase!

@toddburnside
Copy link
Contributor Author

Thank you for the pointer. I'll take a look. :)

@toddburnside
Copy link
Contributor Author

For future reference, I came up with the following line to limit story creation based on the PR body or a label.

if: contains(github.event.pull_request.body, '[ch-new]') || contains(github.event.pull_request.labels.*.name, 'new clubhouse story')

Thanks for the tip!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants