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

Gitea fails to complete all checks with more than 1 pattern in "Enable status check" #29628

Closed
makar112233 opened this issue Mar 6, 2024 · 4 comments · Fixed by #29631
Closed
Labels
Milestone

Comments

@makar112233
Copy link

Description

Hello.
I have a branch, which is protected with setting "Enable status check" and Build server, which is sending statuses of build in Gitea.
When I set only one pattern in a field, all checks are considered successful.
When I set multiply patterns in a filed, I got an error "Some required checks are missing"
You can see it on screenshots.

Gitea Version

1.21.7

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Multiply pattern

sc1

PR checks failed

sc2

Single patterns

sc3

PR checks successful

sc4

Git Version

latest

Operating System

linux

How are you running Gitea?

self-hosted

Database

PostgreSQL

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 6, 2024

Maybe there could be a workaround, for example, use these rules?

*Compile*
*Build amd64*
*Build el8*

(duplicate the Build)

Haven't tested it, but the bug seems to be caused by unmatched rules count & matched count.


Update:

Another question: are these patterns good enough to use?

Suppose the check rules are:

*Compile*
*Build*

there are some results:

Task1 Compile
Task2 Build
Task3 non-related

It passes the check.

Then if the results are:

Task1 Compile
Task2 Error ....
Task3 non-related Build ....

Then Task1 & Task3 make the results pass the check, but actually the Task2 should be "required".

IMO the best practice should be "clearly define the check rules", then there won't be bugs.

@makar112233
Copy link
Author

@wxiaoguang may be I didn’t understand the question, but in the field “Status check patterns” you need to write build tasks names, not statuses.
Example:
My build server send to Gitea status of these tasks, named:

Task1 Compile
Task2 Build
Task3 non-related

and in the field “Status check patterns” I need to specify

*Compile*
*Build*

It means that if Task1 and Task2 statuses will be “OK”, I would be able to merge.
But now this rule works only for one pattern. See screenshots below.

@wxiaoguang
Copy link
Contributor

I meant that in you case, there are 2 patterns to match 3 results. Could you try this one?

*Compile*
*Build amd64*
*Build el8*

Use 3 rules to match 3 results, maybe it could be a workaround.

@wxiaoguang
Copy link
Contributor

The changed behavior is from #29143, because the old behavior is considered to be a "bug".

If I understand correctly, suppose there are some results:

Task1 Compile
Task2 Build amd64
Task3 Build el8

And the rules are:

*Compile*
*Build*

Before 29143, then the blow cases all pass:

Task1 Compile
Task2 Build amd64
(Task3 fails)
Task1 Compile
(Task2 fails)
Task3 Build el8
Task1 Compile
Task2 Build amd64
Task3 Build el8

After 29143, by using 3 rules:

*Compile*
*Build amd64*
*Build el8*

Only the result with all tasks succeeding is considered to pass.

lunny pushed a commit that referenced this issue Mar 8, 2024
…29631)

Close #29628
rule
```
Test / Build*
Test / Build *
Test / Build 2*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)
rule2
```
Test / Build*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)

rule3
```
Test / Build*
Test / Build 1*
NotExist*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c)

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Mar 8, 2024
…o-gitea#29631)

Close go-gitea#29628
rule
```
Test / Build*
Test / Build *
Test / Build 2*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)
rule2
```
Test / Build*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)

rule3
```
Test / Build*
Test / Build 1*
NotExist*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c)

---------

Co-authored-by: Zettat123 <zettat123@gmail.com>
lunny pushed a commit that referenced this issue Mar 8, 2024
…29631) (#29655)

Backport #29631 by @charles7668

Close #29628
rule
```
Test / Build*
Test / Build *
Test / Build 2*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)
rule2
```
Test / Build*
Test / Build 1*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/19bef0a9-fa97-43c5-887b-dece76064aa8)

rule3
```
Test / Build*
Test / Build 1*
NotExist*
```

![image](https://github.com/go-gitea/gitea/assets/30816317/f6a5e832-2e1b-4049-915b-45bec5ef070c)

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
Co-authored-by: Zettat123 <zettat123@gmail.com>
@lunny lunny added this to the 1.21.8 milestone Mar 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants