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

Idea: Run a command on a PR branch #88

Open
silverwind opened this issue May 29, 2023 · 6 comments
Open

Idea: Run a command on a PR branch #88

silverwind opened this issue May 29, 2023 · 6 comments

Comments

@silverwind
Copy link
Collaborator

silverwind commented May 29, 2023

The bot could accept a mention with a command like

@GiteaBot run `make fmt`

If this exact syntax is matched, check out the branch, run the command, and commit the results with a message run `make fmt` requested by @silverwind. Usage should be restricted to maintainer roles and above.

@yardenshoham
Copy link
Collaborator

I'll give it a shot this weekend. Which tools would I need to add to the docker image? Go, Node, Make...?

@silverwind
Copy link
Collaborator Author

silverwind commented May 29, 2023

git, go, node (with npm), make, curl at least. Maybe just use the test_env image which should have all of them.

@yardenshoham
Copy link
Collaborator

Unlike a backport, which happens on push this might have a request coming in when a make fmt is already running so I have to think about queuing work as there's only one of these that might run at a time

@silverwind
Copy link
Collaborator Author

silverwind commented May 31, 2023

Could use a temporary label like command/pending to prevent duplicate runs. Also, it serves a double purpose in indicating to users that the command was accepted.

@yardenshoham
Copy link
Collaborator

I'm talking about 2 maintainers triggering a command while we only have 1 git repo in the filesystem (we can't use it concurrently). I wonder if there are locks in javascript

@silverwind
Copy link
Collaborator Author

I don't suppose these action scripts run all within the same process, right? If so, no amount of in-process lock will help, but if the file system is shared between executions, you could put some sort of lockfile into it.

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