-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Feature/initial GitHub action #194
Conversation
This reverts commit d0f28ff.
Github action to run pytest and coverage
Carrying over from #191:
Yes, 12 is a lot. At the moment, every run finishes in less than a minute so it's not a big deal. With slower CI runs, I usually cut down to just oldest and newest Python versions (so 3.8 and 3.12) and only run the full set of versions before release or on the main branch on a schedule rather than on every push to a PR. One downside to a lot of builds is that GitHub has concurrency limits, but they're 20 jobs total and 5 Mac jobs, so currently a single run of the matrix is under the limit and jobs shouldn't be getting queued. Also, it's not so bad since the CI is quick. For slower CI, there is more chance that multiple PRs could get pushes around the same time and one PR's jobs would be queued behind the other. Another downside is that any flakiness gets amplified -- there is 12 times the chance of an error versus running the tests in only one environment. Hopefully this isn't much of an issue -- you just re-run the failed job. It gets annoying with slower CI, especially when using auto-merge where you come back and find something you thought would have merged didn't because one job failed for something like pip hitting a fluke networking error downloading a dependency. The final downside I can think of is just the environment -- using a bit more CPU cycles than may be necessary.
Interesting. I haven't seen many open source projects using AppVeyor or Travis recently. I think they have fallen out of favor since GitHub Actions came out with a larger free tier and better GitHub integration. I think we can just remove their config files and integrations in the repo settings as part of enabling GitHub Actions here. The AppVeyor log seems kind of flaky any way (but it gives errors for certain event types normally): |
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.
This looks good to me to start out.
I don't know if we should confirm in a discussion what kind of approval process we want for PRs going forward before merging?
lgtm. very nice to see tests running! We can revisit which versions are run in CI if we have trouble with long queue times.
Yea, a defined approval process would speed things up |
Yes, this looks good to me -- thanks! I am in favor of merging. Two comments for going forward from here:
But, that is all for future (maybe near-future) work. We have not established how to decide on what and when to merge. I vote for calling this an early win and merge as it is. I'll suggest an approach I've used with
|
Ok, I went ahead and merged it. I hope that wasn't in violation of the >1 week for discussion to merge your own PR. I assumed since folks all approved there wasn't going to be further discussion. Please let me know if so. Also a question about the policy: Is it preferred to never merge your own PR if there are other people available to do so? Also, sadly, I forgot to squash merge it so it was just a regular merge. I don't know if there's a way to correct that after the fact. I think there are settings in the repo to always force squash merges if that is what we'd like to do. Finally one more note: This github action does not upload to codecov. It looks like at one time this repo was engaged with codecov. This may be another resource we need to get access to from @lebigot. I will open an issue for this. |
Test matrix runs on Windows/Mac/Linux, Python 3.8-3.12
Regarding the squash merge -- I did a force push to squash the commits from this PR. It's not the best practice to rewrite history but the changes hadn't been on master for long. Be sure to rebase if you pulled in the last few hours. I am adding some branch protection rules to master. These are just what I think is the ideal flow (require status checks to pass, require approval, require linear history), but we are all repo owners so we can override them if we want to. |
I think this sounds good, and I would add that there should be some consideration of the impact of the change. Right now, we have four (or five depending on lebigot's availability) people pretty interested in the repo and can probably give quick feedback to any PR. Over time people might get pulled more on other things. A small change like updating an outdated CI setting might not need approval if no one is responsive but something that changes behavior should at least get a second opinion. |
.. image:: https://ci.appveyor.com/api/projects/status/j5238244myqx0a0r?svg=true | ||
:target: https://ci.appveyor.com/project/lebigot/uncertainties | ||
.. image:: https://img.shields.io/github/actions/workflow/status/lmfit/uncertainties/python-package.yml?logo=github%20actions | ||
:target: https://github.com/lmfit/uncertainties/blob/main/.github/workflows/python-package.yml |
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.
this badge in the readme results in a "404 file not found", so that doesn't seem correct
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.
Aah, good catch. I think the branch name should be master
instead of main
. I'll work on this.
Force-pushing to the Also squash-merge isn't always what you want. Ideally, once a PR is finalized you'd go back, clean-up the commit history in logical changes, force-push to the PR branch, and then do a "merge". |
@wshanks Thanks! I agree with you and @reneeotten that squash-merge here was a fine thing to do immediately after the non-squashed merge, but that this should be viewed as "unusual" and "rarely recommended". And thanks for adding the branch protection. I completely agree that we have a small number (3 to 6) interested folks here, an original maintainer who has deliberately stepped back but is interested in commenting/helping. This is a perfect case to try to emphasize normal GitHub project practices of
I also agree with @reneeotten (and from our experience at But also: these are all recommendations and not hard rules. They are mostly in place to keep everyone on an equal footing and in possession of some part of "ownership"/"responsibility". If someone is merging their own PRs without waiting for comments, and rewriting commit histories, then they are sort of expecting that others are not engaged and contributing. And that becomes self-fulfilling. |
Sorry @newville I'm having a hard time understanding what you mean here (I'm trying to learn "normal GitHub project practices" here). Do you mean that even if one or more other maintainers have given formal or verbal approval of a PR (like in this PR) the PR author should still wait weeks before merging the PR? Is the timeline or are the conditions different if a different maintainer feels the urge to merge the PR? |
I meant: avoid merging your own PRs. Well, unless it is clear that no one else is going to it.
In my opinion: We are in a fortunate position of having 3 or more people who are knowledgeable and active enough about this code to be "maintainers": both developers who can make Pull Requests and mergers who can merge Pull Requests. So, if maintainer A makes a PR, let's wait and hope that maintainer B or C will merge that. That makes it clear that this project has a community that is working together on the code. It's also fine to wait a few days or a week for any merge. We are not going super fast here. If you feel like people are responding too slowly or have said they agree but haven't merged, let's try to ping each other a few times. If it is clear that no one is responding or merging to anything, then maybe you've become the sole maintainer -- this happens, sometimes for months at a time. But, if you are expecting maintainers to come back, then it is advisable to continue to go slowly, still waiting multiple days or weeks to merge PRs. If you don't do this, the project has sort of become a single-developer project. Maybe there will be outside PRs to the sole maintainer, but there will not be multiple maintainers if one person just pushing to the master/main branch continuously. Response times to Issues, Discussions, and PRs are measured in days and weeks. It is OK to ping people. |
This is good to have agreement on. When reviewing PRs from other people with write access, my default behavior is to approve and let the author merge, but I can merge more proactively if we want to avoid merging our own PRs here. I think certainly merging your own PR without a review should be avoided.
Agreed!
Yes, I agree that having multiple commits is sometimes nicer (that was what I was acknowledging with my comment about rebasing here), but it requires a better understanding of git and more intricate handling of code changes than the squash approach (and can still leave broken commits in the history since usually only the last commit in a PR is tested). We can see what the PRs coming in here look like 🙂 This PR's commit history I don't think added much importance for example. It still gives some but that could be found by seeing the PR number in the squashed commit description and looking up the PR on GitHub. |
See #194 (comment) Test the correct url [here on my fork](https://github.com/jagerber48/uncertainties/tree/bugfix/build_badge_url).
Continuation of #191. Making the PR to get github actions going from a local rather than forked branch.