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

fix: go mod auto-update to commit to custom branch when dependency module is updated #4660

Closed
p0mvn opened this issue Mar 17, 2023 · 7 comments · Fixed by #4667
Closed

fix: go mod auto-update to commit to custom branch when dependency module is updated #4660

p0mvn opened this issue Mar 17, 2023 · 7 comments · Fixed by #4667

Comments

@p0mvn
Copy link
Member

p0mvn commented Mar 17, 2023

Background

In the following PR, I made changes to osmoutils:
#4659

The autoupdate job ran successfully but did not make a commit to my branch:
https://github.com/osmosis-labs/osmosis/actions/runs/4452408410/jobs/7820019622?pr=4659

Suggested Design

The CI should auto-commit to my branch when I change one of the dependency modules in the repository

Acceptance Criteria

  • auto-commits to custom branch
@p0mvn
Copy link
Member Author

p0mvn commented Mar 17, 2023

@pysel are you available to look into this please?

@p0mvn
Copy link
Member Author

p0mvn commented Mar 19, 2023

Also, noticed the following problem:

image

Whenever the bot commits, the CI is not run so you have to close the PR and reopen it. We should make sure that closing-reopening isn't necessary

@p0mvn
Copy link
Member Author

p0mvn commented Mar 19, 2023

Additionally, the bot seems to be comitting at the wrong time breaking the PR:

40986dd

Relevant PR: #4659

@pysel
Copy link
Member

pysel commented Mar 19, 2023

Additionally, the bot seems to be comitting at the wrong time breaking the PR:

40986dd

Relevant PR: #4659

hey @p0mvn, could you please elaborate on this? I do not really get this

@p0mvn
Copy link
Member Author

p0mvn commented Mar 19, 2023

So I manually fixed go.mod in my PR #4659, and the bot committed over it with the wrong change. The commit that broke it this: 40986dd

The way I think it currently works is that when a commit to any branch is made within a repository, this workflow runs.

Therefore, when I merge a PR that contains osmoutils changes to main, this action will make a commit to all open PRs

This is not desired.

The goal of this workflow is to commit directly to your custom branch when you update osmoutils or any other dependency module directly in your branch.

Let me know if that makes sense

@pysel
Copy link
Member

pysel commented Mar 20, 2023

yes, that makes sense. As I said, I checked that when pushing to your local branch, this workflow only runs on a local branch. However, if that is indeed how it works when a PR is merged, I could simply remove the main branch from those, which should be triggering this action. I think, this will be ok, because afaik folks do not push directly to main, so go.mod will still be updated at some point while working on the local branch.

CC: @p0mvn

@p0mvn
Copy link
Member Author

p0mvn commented Mar 20, 2023

yes, that makes sense. As I said, I checked that when pushing to your local branch, this workflow only runs on a local branch. However, if that is indeed how it works when a PR is merged, I could simply remove the main branch from those, which should be triggering this action. I think, this will be ok, because afaik folks do not push directly to main, so go.mod will still be updated at some point while working on the local branch.

CC: @p0mvn

Yes, removing main SGTM

@p0mvn p0mvn moved this from Needs Triage 🔍 to Needs PR Review in Osmosis Chain Development Jun 5, 2023
@github-project-automation github-project-automation bot moved this from Needs PR Review to Done ✅ in Osmosis Chain Development Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment