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

Cruft PR workflow #168

Merged
merged 29 commits into from
Jun 1, 2023
Merged

Cruft PR workflow #168

merged 29 commits into from
Jun 1, 2023

Conversation

flying-sheep
Copy link
Member

@flying-sheep flying-sheep commented Apr 27, 2023

@flying-sheep flying-sheep changed the title WIP cruft PR workflow Cruft PR workflow Apr 27, 2023
@flying-sheep
Copy link
Member Author

blocked by astral-sh/ruff#4134

@github-actions
Copy link

A PR has been generated to the instance repo:
scverse/cookiecutter-scverse-instance#57

You can check out the PR to preview your changes
in an instance of the cookiecutter template. The PR will be kept in sync with
this PR automatically.

@flying-sheep flying-sheep marked this pull request as ready for review April 28, 2023 12:30
@flying-sheep flying-sheep requested a review from grst April 29, 2023 10:52
Copy link
Collaborator

@grst grst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks beautiful!
Now how do we best go about merging this and testing this in a real world setting?

In general, I would suggest that the next release of the cookiecutter template only includes the changes from this PR (i.e. delete sync.yaml). This makes it easier to communicate to the template users that we switched to a new system and the respective PRs will be easy to review and merge (there shouldn't be any merge conflicts).

scripts/pyproject.toml Show resolved Hide resolved
scripts/pyproject.toml Outdated Show resolved Hide resolved
Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
@flying-sheep
Copy link
Member Author

In general, I would suggest that the next release of the cookiecutter template only includes the changes from this PR (i.e. delete sync.yaml).

OK, how should we do that?

@grst
Copy link
Collaborator

grst commented May 5, 2023

merge this PR and cherry-pick it in the v0.2.x branch, then make a release and see what happens?

Or is there a better way of testing your "on release" action before actually making a release?

@grst grst mentioned this pull request May 31, 2023
@flying-sheep
Copy link
Member Author

flying-sheep commented Jun 1, 2023

I don’t think so, AFAIK there’s no “mock GitHub” we could send requests to.

But I’ll do this:

  • replace the list of repos with a test repo in 0fe5718
  • do what you said (cherry-pick, release), see if everything works in the test repo
  • Once we’re sure everything works, switch to the real list
  • cherry-pick, release

@flying-sheep flying-sheep merged commit 656a2f9 into main Jun 1, 2023
@flying-sheep flying-sheep deleted the cruft-prs branch June 1, 2023 12:45
flying-sheep added a commit that referenced this pull request Jun 1, 2023
Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>
@grst
Copy link
Collaborator

grst commented Jun 6, 2023

I think we need another release on the 0.2.x branch? Or does this work already? I don't think there has been a successful sync run yet: https://github.com/scverse/cookiecutter-scverse/actions/workflows/cruft-prs.yml

@flying-sheep
Copy link
Member Author

You’re right!

@grst grst mentioned this pull request Jun 6, 2023
grst added a commit that referenced this pull request Nov 28, 2023
* Revert "fix typo (#165)"

This reverts commit 5f091ed.

* Cruft PR workflow (#168)

Co-authored-by: Gregor Sturm <mail@gregor-sturm.de>

* Fix `git clone` in cruft PR workflow (#196)

* depend on cruft in cruft PRs workflow (#197)

* Fix cruft invocation typo (#198)

* Use namespaced head in cruft PRs (#199)

* Use user.login instead of user.name (#200)

* Finish cruft PRs (#201)

* Cruft PRs: wait for fork creation (#202)

* Another backoff for cruft (#207)

* Add retry with backoff also for clone

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update template sync

 - better logging
 - check out release tag instead of main
 - put repo owner in PR branch name to deal with forks

* fix tests

* fix tests

* Make name of forked repos include the original user

* debug log

* fix artifact upload

* Fetch main branch from upstream

* Fix get fork

* fix clone url

* fmt

* comment on why pre-commit is a runtime dep

* less positional

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Wrap entire command in try/catch

* Skip PR if already exists for current version.

This allows to re-run the entire action on failures
without creating noise in the repos where the update
was successful.

* Fix log messages

* Fix tests

* Try fix test

* Arming bot: Apply to all repos

* Fix global exception handler

* Fix global exception handler

* Simplify code

* Allow maintainer to modify the PR

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix logging for existing PRs

* Set git default branch in tests

---------

Co-authored-by: Philipp A <flying-sheep@web.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

Template sync fails when changes are made to workflow files
2 participants