Fix: Replace defunct Probot with GitHub Action workflow to auto-close PRs #122299

Merged
Sergey Sharybin merged 5 commits from bartvdbraak/blender:close-github-prs into main 2024-05-28 10:24:28 +02:00

The Probot configuration we previously used to auto-close PRs (and Issues) on GitHub is no longer functioning. To address this, I've created a GitHub Actions workflow that performs the same task. This workflow is triggered whenever a pull request is created. With the current setup, pull requests are marked as stale immediately (0 days) and are subsequently closed right away (0 days).

The Probot configuration we previously used to auto-close PRs (and Issues) on GitHub is no longer functioning. To address this, I've created a GitHub Actions workflow that performs the same task. This workflow is triggered whenever a pull request is created. With the current setup, pull requests are marked as stale immediately (0 days) and are subsequently closed right away (0 days).
Bart van der Braak added 1 commit 2024-05-27 09:59:08 +02:00
Author
Member

Also, I have tested this configuration on a fork I created:
https://github.com/bartvdbraak/blender-122299/pull/3

Also, I have tested this configuration on a fork I created: https://github.com/bartvdbraak/blender-122299/pull/3
Author
Member

Please note that if others fork this repository for their own development purposes (and use GitHub), this workflow will also run on their fork. If this is not desirable, I can add a condition to ensure it only runs on our GitHub mirror:

...
    runs-on: ubuntu-latest
    if: github.repository == 'blender/blender'
    # Permissions given to GitHub Actions bot.
    permissions:
      pull-requests: write
...
Please note that if others fork this repository for their own development purposes (and use GitHub), this workflow will also run on their fork. If this is not desirable, I can add a condition to ensure it only runs on our GitHub mirror: ``` ... runs-on: ubuntu-latest if: github.repository == 'blender/blender' # Permissions given to GitHub Actions bot. permissions: pull-requests: write ... ```
Iliya Katushenock added this to the Platforms, Builds Tests & Devices project 2024-05-27 17:17:01 +02:00

@brecht / @Sergey (not sure on which desk i should put this, so just do ping probably related devs/)

@brecht / @Sergey (not sure on which desk i should put this, so just do ping probably related devs/)

I think it is perfectly fine to replace non-working probot with workflow action. It would be good to limit it to only our own repositories, as others might rely on being able to receive PRs.

I think it is perfectly fine to replace non-working probot with workflow action. It would be good to limit it to only our own repositories, as others might rely on being able to receive PRs.
Bart van der Braak added 2 commits 2024-05-27 17:34:20 +02:00

@bartvdbraak The PR is marked as WIP/draft. Do you still plan to work on something, or is it ready for final reviews?

@bartvdbraak The PR is marked as WIP/draft. Do you still plan to work on something, or is it ready for final reviews?
Author
Member

I think it is perfectly fine to replace non-working probot with workflow action. It would be good to limit it to only our own repositories, as others might rely on being able to receive PRs.

I've added a change to limit job execution to our read-only mirror (blender/blender on GitHub). Tested on this fork: https://github.com/bartvdbraak/blender-122299/pull/4

> I think it is perfectly fine to replace non-working probot with workflow action. It would be good to limit it to only our own repositories, as others might rely on being able to receive PRs. I've added a change to limit job execution to our read-only mirror (`blender/blender` on GitHub). Tested on this fork: https://github.com/bartvdbraak/blender-122299/pull/4
Bart van der Braak changed title from WIP: Replace Probot with GitHub Action workflow that auto-closes PRs to Replace Probot with GitHub Action workflow that auto-closes PRs 2024-05-27 17:37:44 +02:00
Bart van der Braak changed title from Replace Probot with GitHub Action workflow that auto-closes PRs to GitHub: Replace Probot with GitHub Action workflow that auto-closes PRs 2024-05-27 17:37:54 +02:00
Author
Member

@bartvdbraak The PR is marked as WIP/draft. Do you still plan to work on something, or is it ready for final reviews?

It's ready for reviews, I replaced the WIP prefix with GitHub.

> @bartvdbraak The PR is marked as WIP/draft. Do you still plan to work on something, or is it ready for final reviews? It's ready for reviews, I replaced the `WIP` prefix with `GitHub`.
Sergey Sharybin reviewed 2024-05-27 17:58:07 +02:00
@ -0,0 +26,4 @@
days-before-pr-close: 0
# Message posted when closing a pull request.
stale-pr-message: |
This pull request has been automatically closed because this repository is read-only. Blender development happens on [projects.blender.org](https://projects.blender.org).

Maybe This pull request has been automatically closed because this repository is a read-only mirror ?

Maybe `This pull request has been automatically closed because this repository is a read-only mirror` ?
Author
Member

That is worded better, indeed.

That is worded better, indeed.
bartvdbraak marked this conversation as resolved
Bart van der Braak changed title from GitHub: Replace Probot with GitHub Action workflow that auto-closes PRs to Fix: Replace defunct Probot with GitHub Action workflow to auto-close PRs 2024-05-27 18:02:55 +02:00
Bart van der Braak added 1 commit 2024-05-27 18:11:01 +02:00
Sergey Sharybin approved these changes 2024-05-27 18:24:30 +02:00
Brecht Van Lommel reviewed 2024-05-27 18:26:11 +02:00
@ -0,0 +13,4 @@
name: Close Pull Requests
runs-on: ubuntu-latest
# Only run this job in the read-only mirror repository.
if: github.repository == 'blender/blender'

You may want to check contains(github.server_url, 'github.com') as well. Otherwise if/when we enable actions on projects.blender.org, this would auto close pull requests here.

You may want to check `contains(github.server_url, 'github.com')` as well. Otherwise if/when we enable actions on projects.blender.org, this would auto close pull requests here.
Author
Member

As far as I could gather from Gitea documentation and some personal experimentation, it doesn't by default run workflow files that are in .github/workflows. However, you're right that it can't hurt to make this more explicit to GitHub indeed. Thanks for pointing that out!

As far as I could gather from Gitea documentation and some personal experimentation, it doesn't by default run workflow files that are in .github/workflows. However, you're right that it can't hurt to make this more explicit to GitHub indeed. Thanks for pointing that out!
bartvdbraak marked this conversation as resolved
Bart van der Braak added 1 commit 2024-05-27 19:09:08 +02:00
Brecht Van Lommel approved these changes 2024-05-27 19:14:48 +02:00
Sergey Sharybin merged commit 180764c981 into main 2024-05-28 10:24:28 +02:00
Sergey Sharybin deleted branch close-github-prs 2024-05-28 10:24:31 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#122299
No description provided.