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

Remove commit status running and warning to align GitHub #25839

Merged

Conversation

CaiCandong
Copy link
Member

@CaiCandong CaiCandong commented Jul 12, 2023

Fix #25776. Close #25826.

In the discussion of #25776, @wolfogre's suggestion was to remove the commit status of running and warning to keep it consistent with github.

references:

⚠️ BREAKING ⚠️

So the commit status of Gitea will be consistent with GitHub, only pending, success, error and failure, while warning and running are not supported anymore.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 12, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 12, 2023
Copy link
Member

@wolfogre wolfogre left a comment

Choose a reason for hiding this comment

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

Please check also templates/repo/commit_status.tmpl

services/actions/commit_status.go Outdated Show resolved Hide resolved
services/convert/status.go Outdated Show resolved Hide resolved
@wolfogre wolfogre added the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Jul 12, 2023
@wolfogre wolfogre added this to the 1.21.0 milestone Jul 12, 2023
@CaiCandong CaiCandong changed the title Remove commit status running and warning to align github WIP: Remove commit status running and warning to align github Jul 12, 2023
@CaiCandong CaiCandong marked this pull request as draft July 12, 2023 05:47
@CaiCandong CaiCandong marked this pull request as ready for review July 12, 2023 07:10
@CaiCandong CaiCandong changed the title WIP: Remove commit status running and warning to align github Remove commit status running and warning to align github Jul 12, 2023
@delvh
Copy link
Member

delvh commented Jul 12, 2023

Hmm… I'm conflicted about that decision.
Sure, it would be compatible with GitHub.
On the other hand, it would also remove functionality that GitHub is basically lacking at the moment.
(At least running, I haven't quite understood yet either when warning would be triggered)

@wolfogre
Copy link
Member

Hmm… I'm conflicted about that decision. Sure, it would be compatible with GitHub. On the other hand, it would also remove functionality that GitHub is basically lacking at the moment. (At least running, I haven't quite understood yet either when warning would be triggered)

I don't think people care about whether a commit status is running or pending.

Yeah, for Gitea Actions, pending could be Blocked or Waiting, but the commit status is not designed for Actions. For most applications, I believe it's enough to just say "it's pending".

@wolfogre
Copy link
Member

wolfogre commented Jul 12, 2023

Since it's my original idea, I won't approve it until it has been approved by the other two maintainers.

If most people are against this one and want more functionality than GitHub, maybe #25826 is a good choice.

Please feel free to approve or request changes, this one or #25826

@silverwind
Copy link
Member

silverwind commented Jul 12, 2023

From my experience GitHub UI definitely has pending and warning states, even if the API does not expose it:

  • pending: Yellow dot, not yet started because no worker has picked it up or other dependencies not satisfied. Might be a job-only state.
  • warning: Orange exclamation triangle. Happens when PRs need approval to run. State is seen on a per-PR basis.

I guess it makes some sense to be API-compatible with GitHub, but internally I guess we would still need them for above two reasons.

@CaiCandong
Copy link
Member Author

From my experience GitHub UI definitely has pending and warning states, even if the API does not expose it:

According to the github documentation:create-a-commit-status, creating a status only accepts error, failure, pending, success. My opinion is that our status definition should be consistent with github, but the specific semantic information we can express in description.

@silverwind
Copy link
Member

silverwind commented Jul 13, 2023

You're right we have to distinguish:

  • Commit status can be error, failure, pending, success.
  • Workflow run status can be completed, action_required, cancelled, failure, neutral, skipped, stale, success, timed_out, in_progress, queued, requested, waiting, pending.

So I'm fine with reducing the commit status to those GitHub-compatible values.

@silverwind
Copy link
Member

Can we ensure that for our actions workflow runs, the statuses there are correctly mapped down to those 4 values?

@wolfogre
Copy link
Member

Can we ensure that for our actions workflow runs, the statuses there are correctly mapped down to those 4 values?

I'm sure, but we should be aware that it could lose some detail, you know, it's “mapping down”.

@lunny
Copy link
Member

lunny commented Jul 14, 2023

Even if we don't reduce those two statuses, Gitea is also compatible with Github. Why these two statuses are unnecessary?

@CaiCandong CaiCandong changed the title Remove commit status running and warning to align github Proposal remove commit status running and warning to align github Jul 14, 2023
@wolfogre
Copy link
Member

So pending and running are exactly the same now, see #25935 (comment)

@silverwind
Copy link
Member

There might be some remaining unused conditionals in UI now for the icon, need to check.

silverwind pushed a commit that referenced this pull request Jul 21, 2023
…#26036)

Also added comments so the next time the dashboard repo list won't be
forgotten

Follows #25839

Signed-off-by: Yarden Shoham <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 21, 2023
* giteaoffical/main: (22 commits)
  Serve pre-defined files in "public", add "security.txt", add CORS header for ".well-known" (go-gitea#25974)
  Use frontend fetch for branch dropdown component  (go-gitea#25719)
  Remove commit status running and warning from the dashboard repo list (go-gitea#26036)
  Refactor to use urfave/cli/v2 (go-gitea#25959)
  Remove commit status running and warning to align GitHub (go-gitea#25839)
  Fix escape problems in the branch selector (go-gitea#25875)
  Update README.md to fix the broken link of Hugo (go-gitea#26008)
  Support copy protected branch from template repository (go-gitea#25889)
  Update JS dependencies (go-gitea#26025)
  Reduce margins on admin pages (go-gitea#26026)
  Actions Artifacts support uploading multiple files and directories (go-gitea#24874)
  [skip ci] Updated translations via Crowdin
  Remove redundant "RouteMethods" method (go-gitea#26024)
  Adding remaining enum for migration repo model type. (go-gitea#26021)
  RPM Registry: Show zypper commands for SUSE based distros as well (go-gitea#25981)
  Fix the route for pull-request's authors (go-gitea#26016)
  Remove nfnt/resize and oliamb/cutter (go-gitea#25999)
  Correctly refer to dev tags as nightly in the docker docs (go-gitea#26004)
  Fix env config parsing for "GITEA____APP_NAME" (go-gitea#26001)
  Add file status for API "Get a single commit from a repository" (go-gitea#16205) (go-gitea#25831)
  ...
@CaiCandong CaiCandong deleted the feature-remove-commit-status-running-and-warning branch July 24, 2023 07:38
lunny pushed a commit that referenced this pull request Jul 25, 2023
This problem occurs because in #25839, the warning status has been
removed, but there is something in the tmpl that hasn't been changed.
related #25839
close #26118
@jpraet
Copy link
Member

jpraet commented Sep 21, 2023

Noticed this PR in the 1.21-rc0 changelog. I think commit status "warning" was useful for checks where you want to draw the attention of the developer, but not block the merge of the PR. e.g. sonar static code analysis has severities, and we want to block the merge for newly introduced [Blocker, Critical, Major] violations, and give a warning for [Minor] violations.
Or for example block the merge on code coverage < 50%, but give a warning on code coverage < 70%.

image

And jenkinsci/gitea-plugin will also break because it uses warning to report unstable build (test failures):

image

@silverwind
Copy link
Member

silverwind commented Sep 21, 2023

I guess these have to migrate to failure now. Overall I think we're better off being compatible with GitHub, so that integrations can be seamlessly be integrated in both Gitea and GitHub.

@silverwind
Copy link
Member

silverwind commented Sep 21, 2023

On second thought, warning does seem like a valid use case. I wonder how GitHub avoided adding it so far. They do have inline annotations with Gitea does not have, and I think those can be both warnings and errors.

@silverwind
Copy link
Member

I checked another data point, GitLab. Here is a table illustrating the commit statuses of each:

pending running cancelled warning failed success error
github and gitlab pending - - - failure success error
gitlab pending running cancelled - failed success error
gitea before pending running - warning failure success error

@lafriks
Copy link
Member

lafriks commented Sep 21, 2023

Personally I don't see any benefit from this change. Why do we need this to be compatible with GitHub in expense of breaking existing integrations?

@silverwind
Copy link
Member

I guess I agree to restoring warning, but do we need running?

@jpraet
Copy link
Member

jpraet commented Sep 21, 2023

running was only introduced quite recently (in v1.19) #21937, so less risk of breaking any existing integrations

@silverwind
Copy link
Member

silverwind commented Sep 22, 2023

So, partial revert of this that edits the migration as well? Of course the damage to existing statuses is already done for anyone using prereleases.

@harryzcy
Copy link
Contributor

harryzcy commented Oct 4, 2023

Do we actually want to revert this? If we do, it's better to do this sooner so the damage is minimal

@silverwind
Copy link
Member

Yes, someone please raise a PR with the revert. We also need to disable this part of the migration.

If no one raises the revert, I can probably do it in a few days.

@delvh
Copy link
Member

delvh commented Oct 4, 2023

I think there is already an existing revert PR.
I simply don't know which exactly anymore.

@silverwind
Copy link
Member

#27504 for the partial revert.

silverwind added a commit that referenced this pull request Oct 8, 2023
Partial revert of #25839. This
commit status is used by a number of external integrations, so I think
we should not remove it (See
#25839 (comment)).
This is a rare case where an existing migration needed to be alterted to
avoid data loss.

---------

Co-authored-by: delvh <[email protected]>
Co-authored-by: Giteabot <[email protected]>
GiteaBot added a commit to GiteaBot/gitea that referenced this pull request Oct 8, 2023
Partial revert of go-gitea#25839. This
commit status is used by a number of external integrations, so I think
we should not remove it (See
go-gitea#25839 (comment)).
This is a rare case where an existing migration needed to be alterted to
avoid data loss.

---------

Co-authored-by: delvh <[email protected]>
Co-authored-by: Giteabot <[email protected]>
silverwind added a commit that referenced this pull request Oct 9, 2023
Backport #27504 by @silverwind

Partial revert of #25839. This
commit status is used by a number of external integrations, so I think
we should not remove it (See
#25839 (comment)).
This is a rare case where an existing migration needed to be alterted to
avoid data loss.

Co-authored-by: silverwind <[email protected]>
Co-authored-by: delvh <[email protected]>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Oct 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect aggregated status of commit statuses
10 participants