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

How to depend on successful tests? #137

Closed
jaraco opened this issue Dec 22, 2020 · 7 comments
Closed

How to depend on successful tests? #137

jaraco opened this issue Dec 22, 2020 · 7 comments

Comments

@jaraco
Copy link

jaraco commented Dec 22, 2020

I followed the usage docs and created a new action in my project, but when I did and tried to use automerge, it merged before the tests ran:

image

Presumably projects don't need an automerge action that's enacted immediately. What are the steps necessary to gate on tests passing? Given that's probably the most common usage scenario, could the usage be updated to include this important configuration detail (or point to an example that implements it that way)?

@luanraithz
Copy link

Can't you protect your main branch by adding the required status checks?

https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/enabling-required-status-checks

@jaraco
Copy link
Author

jaraco commented Dec 23, 2020

Thanks Luan for the response.

Can't you protect your main branch by adding the required status checks?

Yes, perhaps, but that will be rather tedious to accomplish across dozens of projects, especially if it needs to be done manually through the UI. Requiring a separate, manual step opens up opportunity for misconfiguration.

Additionally, adding constraints on particular branches adds technical debt to those repositories. For example, this repository recently migrated from master to main for the default branch. Having rules dependent on these branch names adds to the complexity of managing such branches.

Ideally, I'd like a way that committing a change to the repository would enable the automerge functionality and gate them on the tests and work with a repository that's configured with the default settings.

Is requiring status checks the recommended procedure for using automerge? If so, I'd expect that prerequisite to be documented in the Usage.

@pascalgn
Copy link
Owner

Duplicate of #118

@pascalgn pascalgn marked this as a duplicate of #118 Dec 30, 2020
@jaraco
Copy link
Author

jaraco commented Dec 30, 2020

Would you consider accepting a pull request that updates the Usage documentation to add "enable protected branches and required checks" as a prerequisite step?

@pascalgn
Copy link
Owner

I've updated the README a bit

@jaraco
Copy link
Author

jaraco commented Dec 30, 2020

I've also learned that although it's possible to enable these checks through the API, it's not possible to know the names of the checks to know which to enable. They must be enabled one-by-one manually through the web UI :(.

This constraint is enough of an impediment that I'll probably not be able to use this feature until there's better support for automation.

@jaraco
Copy link
Author

jaraco commented Dec 30, 2020

I've updated the README a bit

Thanks for that. I still think it would be useful for the Usage section to have a prerequisite step, something like "first configure the repo with protected branches and required checks." For me, the nuances of setting up protected branches still feels hidden in the introductory section, and without a careful reading of that section, it's not clear that if applied to a repository configured with the default settings, the automerge action is unlikely to work as intended. It's a necessary step to first configure some branch protection with status checks (unless you want "tag with automerge" to have the same effect as clicking "merge").

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

3 participants