-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Add project workflow feature so users can define how to execute steps when project related events fired #30205
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
base: main
Are you sure you want to change the base?
Conversation
… when project related events fired
|
|
|
I would really like to see this merged, I am waiting for the ability to automatically set a project for a new issue via the issue template (#25028). GitHub provides this through an "org-name/BOARD_ID" syntax as announced here. I think having to set up an action for that (which would also require to set up a runner?) is quite cumbersome for such a simple feature. |
I do not know, but firing up multiple containers to just set a specific label or remove a label, or even re-open or close an issue as part of the workflow seems to be overkill to me, what do you think? |
What's the status here now? This is quite a wanted feature. |
Yes, this is a good reason to use the internal implementation rather than CI/CD. I will continue this work. |
Great, thx for your feedback. I am really looking forward to it. |
|
As far as I understand the description, this will depend on Workflows? |
No. This is project workflow which is different from Actions workflow. |
|
And what's better? Storing the workflows in the special YAML files on the default branch or storing them in the database? This is a block to prevent me from continuing the work. |
|
I would purpose to store them in the database. Branches are for code changes and depending stuff but this is a projekt management feature that is specific for gitea. i.e.: If you mirror your code to an other git system like github the projekt workflows are only garbage there. |
but storing in the db will require some form of UI to create/edit. |
For my defence I didn't know about the templates and the storage path. In that case I would agree to that argument. |
|
Thank you for working on this important feature. Many users, including myself, are eagerly anticipating the addition of project workflows to Gitea. This functionality would greatly enhance project management capabilities within the platform. |
| ActionsUserID: NewActionsUser, | ||
| GhostUserID: NewGhostUser, | ||
| ActionsUserID: NewActionsUser, | ||
| ProjectWorkflowsUserID: NewProjectWorkflowsUser, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need a general "gitea system account user" for more similar cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be better to use different system bot account IDs for different features, so we can clearly identify which actions come from which subsystem and assign appropriate permissions to each bot account.
Using a single, general system account does reduce code complexity and maintenance overhead. However, adding an additional system account does not seem to require much effort, and it is not a frequent operation. Given the benefits in clarity and permission isolation, using separate system accounts for different features may be the better approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are just keeping adding "breaking changes" to tell end users that "if you have a user named 'project-workflow', you need to rename it before upgrade", and then "if you have a user named 'xxxx' ...", "if you have a user named 'yyyy' ... "
And you just keep forgetting adding the new names to reservedUsernames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can also remove those reserved names. A bot account should not have a profile and have a
botlabel which is different from a normal account. i.e. This is an bot account from Github, it will be point to a/apps/xxxxbut not a normal profile. And there is abotlabel near the name.
How does it answer the question? What if the end user already has a user named "project-workflow" in their instance?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will not conflict at the moment. The original user could be visited still and the bot account will be displayed "project-workflow" with a following bot label. Even if it may confuse users, but it will not affect the original user. The issue is related how to handle different user types which should have a complete solution in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe "at the moment"
OK, that's your choice to keep introducing fragile designs and confusing end users. If you believe it's right, I won't block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, I don't believe you are able to figure out "how to handle different user types which should have a complete solution in another PR"
There are still buggy designs or patches unresolved, for example:
- Add new user types
reserved,bot, andremote#24026 (comment) - Allow admin to change user's type #33758 (review)
- Need a complete fix for broken
GetUserByName#36208
Already a mess, just keep making the whole system more messy.
|
|
||
| const ( | ||
| ProjectWorkflowsUserID int64 = -3 | ||
| ProjectWorkflowsUserName = "project-workflows" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be a bad name and is likely to conflict with end user's name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All system bot type user have a [bot] prefix before the name and it should have no profile page. Then it's different from the user who have the same name.
|
@lunny can I support you in any way to fix the issues that came up in the review? |
Yes, please send PRs to my fork repository. |

This PR introduces project workflows, allowing users to configure event-based automations directly from the UI.
Users can define filters and actions for each workflow event, and duplicate existing events when needed.
Concepts
Every workflow is composed of
event,filters, andactions.Available Events
Currently, the following nine events are supported:
Each event type supports its own set of filters and actions.
Available Filters
There are four types of filters that can be configured for an event:
issues only,pull requests only, orissues and pull requests.Available Actions
There are four types of actions that can be executed when an event is triggered:
Enable/Disable an event workflow
Each event workflow can be individually enabled or disabled. When disabled, the workflow will be ignored even if the event occurs. This feature is useful when you want to temporarily stop certain automated actions without deleting the workflow configuration.
Clone an event workflow
When you need multiple workflows for the same event, you can clone an existing event to create a new one with different filters and actions. This allows you to customize how the same event behaves under different conditions, making workflows more flexible and powerful.
Screen shots
Documentation PR https://gitea.com/gitea/docs/pulls/308