-
Notifications
You must be signed in to change notification settings - Fork 608
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
ci: manual job for updating in-repo go mods; ci to warn if files changed #4667
Conversation
ec81947
to
d465e07
Compare
98abbdc
to
a6a3d85
Compare
hey @p0mvn. A quick update on this: There is a problem with this workflow when a push with changes is a We could solve that by giving the ability to the developer to run this workflow manually, however, I think this completely ruins the point of this automation. Another idea is to run the updating script ALWAYS when a The third idea I have, is to change the wdyt? |
@@ -33,14 +33,29 @@ jobs: | |||
run: | | |||
echo "CURRENT_BRANCH=$(echo ${GITHUB_REF} | sed 's|refs/heads/||')" >> $GITHUB_OUTPUT | |||
|
|||
- name: Run script | |||
# This step fixes a bug, due to which the push to any branch, for example: to person-A/name, triggered this workflow on branch person-b/name, |
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.
nit: can we put this before "Setup Go"
# This step fixes a bug, due to which the push to any branch, for example: to person-A/name, triggered this workflow on branch person-b/name, | ||
# and updated the go.mod on branch person-B/name with commit from branch person-A/name | ||
- name: Check if the current branch contains commit that triggered the workflow | ||
id: valid_branch | ||
run: | | ||
CURRENT_BRANCH=${{ steps.extract_branch.outputs.CURRENT_BRANCH }} | ||
COMMIT_EXISTS_ON=$(echo $(git branch --contains ${{ github.event.after}} ) | grep $CURRENT_BRANCH) | ||
|
||
if [[ "$COMMIT_EXISTS_ON" == *"$CURRENT_BRANCH"* ]]; | ||
then | ||
echo "VALID=1" >> $GITHUB_OUTPUT | ||
fi | ||
|
||
- name: Run script | ||
if: ${{ steps.valid_branch.outputs.VALID }} == 1 |
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.
So assume I'm on branch roman/A
and you are on ruslan/B
Then, I modify osmoutils
on my branch. Then, this workflow will run for both roman/A
and ruslan/B
. However, it will not continue past this step on ruslan/B
. Is my understanding correct?
I'm wondering if there is a way to not run this job on other branches at all to avoid having a queue in CI.
Let me know what you think
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.
Yes, that is right. However, as mentioned here, I haven't seen such behavior by changing, for example, osmoutils
on my local branch. I checked the Action
tab, which showed me, that this workflow was running only for my branch.
A more detailed explanation you may find in the attached link above
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.
let me know what you think on removing main
from this workflow's triggers
Thanks for the breakdown of the options.
This makes sense to me as a temporary solution
What do you mean by all This seems fine to me. It is actually preferable that you are always depending on the modules directly in your branch.
This is not what we would like to have. In this case, I can update |
Yes, but only when a force push happens, to avoid checking
Hmm, I do not really understand this. In comparison, right now we are checking This is what I mean by CC: @p0mvn |
d1ffc17
to
86c200f
Compare
7b91156
to
cf3528b
Compare
8c5f41a
to
82b2c80
Compare
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
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.
…ged (#4667) * add suggested change * check for valid branch * change-wip * debugging * wip * debugging * debugging * debugging * debugging * debugging * debugging * debugging * remove change in osmoutils * Update .github/workflows/go-mod-auto-bump.yml * Update .github/workflows/go-mod-auto-bump.yml * change * remove debug echos * docs: correctly name a step * change * change osmoutils * add token * git diff with latest main commit * remove echo * remove osmoutils changes * improve docs * remove main branch from triggers * fix bug: running on wrong branch * remove legacy conditions * PAT * v3 checkout * osmoutils change * bring back script * change * config * change * better commit message + try w/o token * change * bring back token * change * remove osmoutils change * only commit+push changes when they were added * change * nit * reset change * tidy and changelog * restore go.modsum * better CHANGELOG * use mod/sum from main * make manual * Update CHANGELOG.md --------- Co-authored-by: Jacob Gadikian <[email protected]> Co-authored-by: Roman <[email protected]>
Closes: #4660
Description
This PR introduces a manual CI job to update
go.mod
forosmomath
,osmoutils
,x/ibc-hooks
andx/epochs
if changed.The changes introduced in this PR include:
Tested manually on a fork