-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Update job status on rerun - avoid duplicate email notification #35575
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
Draft
badhezi
wants to merge
25
commits into
go-gitea:main
Choose a base branch
from
badhezi:hezi/update-run-status-on-rerun
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+0
−1
Draft
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8d799c2
use the correct context data for PR link template in issue card
badhezi f2a2acf
Merge branch 'main' into main
badhezi 5cc1bda
Merge branch 'main' into main
GiteaBot 54d37d1
Merge branch 'main' into main
GiteaBot ac25150
Merge branch 'go-gitea:main' into main
badhezi e11a339
Merge branch 'go-gitea:main' into main
badhezi 104eecc
Merge branch 'go-gitea:main' into main
badhezi bcc4ade
Merge branch 'go-gitea:main' into main
badhezi a7aaa79
Merge branch 'go-gitea:main' into main
badhezi b46d314
Merge branch 'go-gitea:main' into main
badhezi 4e2434b
Merge branch 'go-gitea:main' into main
badhezi 7f72fe9
Merge branch 'go-gitea:main' into main
badhezi c6acfc1
Merge branch 'go-gitea:main' into main
badhezi 016c2f3
Merge branch 'go-gitea:main' into main
badhezi a3c2953
Merge branch 'go-gitea:main' into main
badhezi 4d7ea0d
Merge branch 'go-gitea:main' into main
badhezi bfa2d10
Merge branch 'go-gitea:main' into main
badhezi 0d50b75
Merge branch 'go-gitea:main' into main
badhezi 5ad8708
Merge branch 'go-gitea:main' into main
badhezi 7fb93fe
Merge branch 'go-gitea:main' into main
badhezi 80e3c30
Merge branch 'go-gitea:main' into main
badhezi d0386a6
update job.Status on re-run trigger to avoid duplicate email notifica…
badhezi 540b853
fix comment
badhezi 854cd39
skip redundant workflow run status update
badhezi 686a4f6
Merge branch 'main' into hezi/update-run-status-on-rerun
badhezi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems that the new code does nothing. It isn't updated into datebase (see
UpdateRun(ctx, run, "started", "stopped", "previous_duration")
)And can you add a test to make sure that the behavior is expected?
Uh oh!
There was an error while loading. Please reload this page.
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.
thanks, you are of course correct. I mixed up ActionRun and ActionRunJob also.
I'll add test cases for this as well.
@NorthRealm is there a particular reason why we need this call at all?
gitea/routers/web/repo/actions/view.go
Line 437 in c453210
It's only being called on a rerun and it's sole purpose is sending email updates about the status of the ActoinJobRun which is yet to be changed. (we only change the ActionJob at this stage)
I don't see why we need call it before the run started (I might be missing something?)
IMO we can just remove this line and the notification will be sent at the end of the run without sending a redundant one when re-running.
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.
6bcdd7e
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.
I never produced the issue 😅 sorry, I kinda lose track
@ChristopherHX Could you please look at it again 🤦
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.
I see now the problem is that the status is not set back to in progress.
Seems fine for me to temporary remove this event, until it's rewritten to send an expected event.
IMO We need to sent a workflow_run event that is requested not completed.
It is not expected to have a email delivered here, but I expect an event.
A test that checks a rerun does not create a workflow_run completion event is preferred.
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.
Actially I have written tests that verify the existence of this event..., need to look at this.