kubernetes / test-infra

Test infrastructure for the Kubernetes project.
Apache License 2.0
3.83k stars 2.65k forks source link

Automatically add issues/PR to a project board based on a GitHub query #9925

Closed cblecker closed 4 months ago

cblecker commented 5 years ago

One missing feature of GitHub's project boards is the ability to automatically add issues/PRs to a project board based on a GitHub search query.

Two examples of how this would be useful:

We'd probably only want to respond to label add or issue/PR open events rather than poll on a cron, because we'd want the ability to manually remove from a project board if it doesn't apply. But the thought is if we add a framework that we can configure with query = project card create, then we could reuse it in a lot of different places.

GitHub API docs: https://developer.github.com/v3/projects/cards/#create-a-project-card

cc: @jdumars @bgrant0607 @spiffxp @dims also cc @idvoretskyi @guineveresaenger because this is something that IMO GitHub should do out of the box, considering the "Add a Card" button accepts a search query to find cards in the first place to add. 👀

dims commented 5 years ago

I like it @cblecker ! basically add things to Backlog right?

nikhita commented 5 years ago

/kind feature

wwwil commented 5 years ago

Hi! I've started on a solution to this and have something working which I'm going to tidy up and submit a PR for.

I plan to store the projects and associated queries in the plugins.yaml in the format:

projects:
  - name: my-project
    org: my-org
    query:
      state: open
      org: my-org
      labels:
        - my-label

I'm quite new to this project, Kubernetes and Go so any advice or feedback is appreciated! Thanks!

stevekuznetsov commented 5 years ago

Hello @wwwil!

I would suggest using "org/repo" as your keys as per other configurations. Look at the Tide configuration for query syntax exposed as configuration.

stevekuznetsov commented 5 years ago

Also, I would suggest writing a design document either as a pull request to test-infra or as a Google doc that you can share with kubernetes-sig-testing@googlegroups.com. I think there are a lot of potential open questions here:

Often it's best to try to get answers to these questions before code is written so you don't have to re-write code in the future.

stevekuznetsov commented 5 years ago

Also would love to hear from @idvoretskyi @guineveresaenger to see if this is something that GitHub might implement, we wouldn't want to duplicate work!

wwwil commented 5 years ago

I'll check the Tide config and can change the keys. At the moment I have designed it as a plugin and it responds to PR open, close, reopen, add label and remove label events.

I'll enquire more about issues before getting started in future. I just started writing it as a way to learn about this project and practise writing Go, so I wasn't sure if I'd be able to make it work and I'm not too worried about it having been unnecessary in this case.

How would I go about providing a design document as a pull request? Would that just be an 'empty' pull request with the design proposal in the description?

cblecker commented 5 years ago

also cc @jessfraz 👀

jessfraz commented 5 years ago

I can ask about it internally definitely seems like something that’s perfect for an action though, but will pass this along and let you all know

Thanks for pinging me, keep doing this :)

bgrant0607 commented 5 years ago

This would be awesome, btw. Our KEP tracking board is completely out of date now that KEPs moved.

idvoretskyi commented 5 years ago

@cblecker great suggestion, +1

stevekuznetsov commented 5 years ago

@wwwil a markdown file could work - however if you have most of the code already written it may not make the most sense. Maybe open the PR when you're ready and we can hash out some ideas there, or comment on this issue and we could do it here.

My two largest questions are:

wwwil commented 5 years ago

I've submitted a pull request for what I have so far. I hope it make's sense, I'm quite new to this so any feedback is appreciated.

Currently the plugin uses the data in the pull request event so the fields that can be used in a query are limited to the ones the plugin can work with.

As it's responding to pull request events I think that makes it best effort, as it won't add existing pull requests that match the query unless they change.

guineveresaenger commented 5 years ago

My apologies for missing this so far! I’ll look into this and ask around for sure. 🙂

justaugustus commented 5 years ago

/assign /sig pm architecture testing

justaugustus commented 5 years ago

Very interested in this! @wwwil -- when you have a design proposal in mind, can you also share it with kubernetes-pm@googlegroups.com?

wwwil commented 5 years ago

@justaugustus I've updated my PR body to reflect the current design: https://github.com/kubernetes/test-infra/pull/10401

How should I go about sharing it? I've not really used Google groups much.

fejta-bot commented 5 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

spiffxp commented 5 years ago

/assign @hh @brahmaroutu /remove-lifecycle stale this came up during the k8s-conformance meeting, there was discussion of a "project manager" plugin

fejta-bot commented 5 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

justaugustus commented 5 years ago

/remove-lifecycle stale /lifecycle frozen /priority important-soon /milestone v1.17

justaugustus commented 5 years ago

Twitter thread on this: https://twitter.com/carolynvs/status/1166033270032801793?s=20 @guineveresaenger @carolynvs @jeremyrickard

Some work going on here: https://github.com/kubernetes/test-infra/pull/12326

justaugustus commented 4 years ago

What's the current status on this? /milestone v1.18

justaugustus commented 4 years ago

/remove-sig pm /sig contributor-experience

spiffxp commented 4 years ago

/remove-lifecycle frozen /remove-priority important-soon I still think this could be really cool but have no idea where it's at, and I don't think having it frozen has helped it move forward

saschagrunert commented 3 years ago

/cc

fejta-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

spiffxp commented 3 years ago

/remove-lifecycle stale /help

k8s-ci-robot commented 3 years ago

@spiffxp: This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to [this](https://github.com/kubernetes/test-infra/issues/9925): >/remove-lifecycle stale >/help Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
fejta-bot commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

fejta-bot commented 3 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten

k8s-triage-robot commented 3 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community. /close

k8s-ci-robot commented 3 years ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes/test-infra/issues/9925#issuecomment-889384380): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. > >Send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
sandipanpanda commented 2 years ago

/reopen Since this is still an issue. Should a /lifecycle frozen label be added to this to prevent it from automatically closing again in future, since no one is available to work on this for now.

k8s-ci-robot commented 2 years ago

@sandipanpanda: Reopened this issue.

In response to [this](https://github.com/kubernetes/test-infra/issues/9925#issuecomment-967803565): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
justaugustus commented 2 years ago

/lifecycle frozen /unassign

omerbensaadon commented 1 year ago

Hey have y'all seen this: https://github.com/actions/add-to-project

I think it would actually solve this problem quite nicely :D

I know there were some permissions issues with that action when I've brought it up in the past... 🤔 we're working on native auto-add functionality right now but it won't be ready for awhile

BenTheElder commented 4 months ago

This and https://github.com/kubernetes/community/issues/5535 are sort of a dupe.

The implementation would most likely live in github.com/kubernetes-sigs/prow now, kubernetes/community is a more visible place to discuss workflow changes and kubernetes-sigs/prow is the best place to discuss implementation details / tooling feature requests.

We do have https://github.com/kubernetes-sigs/prow/tree/main/pkg/plugins/projectmanager after https://github.com/kubernetes/test-infra/pull/12326 but any expansion on this hasn't been discussed here for years now and should be discussed in kubernetes-sigs/prow going forward.