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

feat(automate): automate version bump for pre-commit repo #12

Merged
merged 31 commits into from
Aug 16, 2024

Conversation

yosefAlsuhaibani
Copy link
Collaborator

@yosefAlsuhaibani yosefAlsuhaibani commented Aug 2, 2024

@kopecs kopecs self-requested a review August 2, 2024 20:43
@yosefAlsuhaibani yosefAlsuhaibani marked this pull request as ready for review August 6, 2024 21:59
@akuhlens akuhlens force-pushed the yosef/auto-version-bump branch from 6ead1d0 to a2d5182 Compare August 6, 2024 22:22
Comment on lines 40 to 43
on:
push:
branches:
- develop
Copy link
Collaborator

Choose a reason for hiding this comment

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

What would happen here if we make multiple commits on a given version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The thought behind this workflow is that it is ran only after the bump version workflow's PR is merged which is just one single squashed merge commit; I'm not sure if there is any more invariants I should be concerned about in this repo:

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

( am still trying to debug this workflow as for some reason it does not trigger after an auto merge, at least thats what I saw in the test-pre-commit repo)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alright I've deleted this workflow: the way this is automated now is

  • bump_version.yml: Commits on a branch, pushes the branch & tags a commit on the branch
  • autoapprove.yml: If PR is made by semgrep-ci[bot], approve & wait for checks to pass; then auth as semgrep-ci[bot], move the tag to develop. (delete the tag made on the branch, then push a tag on develop)

yosefAlsuhaibani and others added 6 commits August 14, 2024 17:42
Co-authored-by: Cooper Pierce <[email protected]>
* Add work from other fork

* Hardcode configs + remove inc

* adding remotes command

* going to version 2 of checkout

* using version 4 of checkout

* using with submodules: true

* remove fake reviwer`

* add gh token

* aaa

* Add autoapprove bot

* Remove approvals and merge from bump_version

* remove bogus reviewer

* wack script

* Fix bump ver

* Restore state?

* change name

* fix typo

* Bump setup to 1.82.0

* Bump pre-commit yaml to 1.81.0 (#16)

Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>

* Bump pre-commit yaml to 1.84.1 (#18)

Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>

* Bump setup to 1.33.22 (#19)

Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>

* simplify workflow

* Make 2nd step its own workflow

* no dup name

* maybe fix error

* remove dup key

* don't hardcode bump yaml

* Bump setup to 3.33.3 (#21)

Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>

* Change trigger hook

* Bump setup to 2.22.2 (#22)

Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>

* remove dispatch

* try on:push

* Bump setup to 3.33.3 (#23)

Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>

* Bump setup to 1.84.1 (#24)

Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>

* push a tag

* make sed portable

* reset version

* commit all files

* Bump setup to 1.84.1 (#26)

Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>

* Cooper edit

* sync

* actually get token

* perms

* Bump setup to 1.84.0 (#29)

Co-authored-by: yosefAlsuhaibani <[email protected]>

* Don't negate?

* Bump setup to 1.84.1 (#30)

Co-authored-by: yosefAlsuhaibani <[email protected]>

* escape properlly?

* Bump setup to 1.84.0 (#31)

Co-authored-by: yosefAlsuhaibani <[email protected]>

* remove conditional

* Bump setup to 1.84.1 (#32)

Co-authored-by: yosefAlsuhaibani <[email protected]>

* add back conditional

* fake file

* Change ext

* Bump setup to 1.84.0 (#34)

Co-authored-by: yosefAlsuhaibani <[email protected]>

* Update autoapprove?

* Fix checks

* add --squash

* del tag and tag

* Bump setup to 1.84.1 (#37)

Co-authored-by: yosefAlsuhaibani <[email protected]>

* add ref: develop

* Bump setup to 1.84.0 (#38)

Co-authored-by: yosefAlsuhaibani <[email protected]>

* Bump setup to 1.84.1 (#39)

Co-authored-by: yosefAlsuhaibani <[email protected]>

* Remove tag-version script and workflow

* Add a small comment why we change ids

* Don't push bogus changes

* bogus

---------

Co-authored-by: Yosef Alsuhaibani <[email protected]>
Co-authored-by: Andre Kuhlenschmidt <[email protected]>
Co-authored-by: semgrep-ci[bot] <semgrep-ci[bot]@users.noreply.github.com>
Co-authored-by: semgrep-ci[bot] <106279034+semgrep-ci[bot]@users.noreply.github.com>
Co-authored-by: yosefAlsuhaibani <[email protected]>
Copy link
Contributor

@akuhlens akuhlens left a comment

Choose a reason for hiding this comment

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

Looks good to me. Add a comment showing where it is used in the semgrep repo.

@yosefAlsuhaibani yosefAlsuhaibani merged commit ab2cd55 into develop Aug 16, 2024
2 checks passed
jobs:
approve-bot:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login == 'semgrep-ci[bot]'}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this always triggers for semgrep-ci[bot], let's just keep in mind we may need to narrow this to also require the PR title is chore: release or whatever if we run into additional cases we want this bot to make a PR here. Seems fine for now though.

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.

ci: set up release automation
4 participants