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

Changelog for 1.21 missing CI approval notice #28570

Closed
WeirdPtr opened this issue Dec 21, 2023 · 2 comments · Fixed by #28582
Closed

Changelog for 1.21 missing CI approval notice #28570

WeirdPtr opened this issue Dec 21, 2023 · 2 comments · Fixed by #28582
Labels
Milestone

Comments

@WeirdPtr
Copy link

WeirdPtr commented Dec 21, 2023

Description

When upgrading from 1.20.5 to 1.21.2 the CI pipeline status checks were ignored in PRs.

I checked the release notes before updating the instance here, however nothing mentioned this change.

After investigating the database i found out, that when a repo had status checks enabled but no custom pattern was supplied it skipped the check.

When i updated the field status_check_contexts to [*] status checks worked again.

Query used to find "broken" branch status check entries:

select
    protected_branch.status_check_contexts,
    repository.id
from repository
     join protected_branch
       on protected_branch.repo_id = repository.id
where protected_branch.enable_status_check
      and ( protected_branch.status_check_contexts is null
            or protected_branch.status_check_contexts = 'null' )

Gitea Version

1.21.2

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.20.1

Operating System

Debian

How are you running Gitea?

Docker Compose
Image: gitea/gitea:1.21

Database

PostgreSQL

@kstruessmann
Copy link

Behaviour has changed as a result of this PR: Support for status check pattern (#24633)

@Zettat123
Copy link
Contributor

The feature introduced in #24633 should be compatible with status_check_contexts. However, if one or more of status_check_contexts is not a legal glob expressions, glob.Compile will fail and the contexts cannot match.

if pb != nil && pb.EnableStatusCheck {
ctx.Data["is_context_required"] = func(context string) bool {
for _, c := range pb.StatusCheckContexts {
if gp, err := glob.Compile(c); err == nil && gp.Match(context) {
return true
}
}
return false
}
ctx.Data["RequiredStatusCheckState"] = pull_service.MergeRequiredContextsCommitStatus(commitStatuses, pb.StatusCheckContexts)
}

I'll try to make a PR to fix it

@lunny lunny added this to the 1.21.4 milestone Dec 22, 2023
lunny pushed a commit that referenced this issue Dec 22, 2023
Fix #28570
Follow #24633

---
Copied from
#28570 (comment)

The feature introduced in #24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.


https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Dec 22, 2023
Fix go-gitea#28570
Follow go-gitea#24633

---
Copied from
go-gitea#28570 (comment)

The feature introduced in go-gitea#24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.


https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663
lunny pushed a commit that referenced this issue Dec 22, 2023
Backport #28582 by @Zettat123

Fix #28570
Follow #24633

---
Copied from
#28570 (comment)

The feature introduced in #24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.


https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663

Co-authored-by: Zettat123 <[email protected]>
techknowlogick pushed a commit to techknowlogick/gitea that referenced this issue Dec 23, 2023
Fix go-gitea#28570
Follow go-gitea#24633

---
Copied from
go-gitea#28570 (comment)

The feature introduced in go-gitea#24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.


https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this issue Jan 16, 2024
Backport #28582 by @Zettat123

Fix #28570
Follow #24633

---
Copied from
go-gitea/gitea#28570 (comment)

The feature introduced in #24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.

https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663

Co-authored-by: Zettat123 <[email protected]>
(cherry picked from commit 6a559ad)
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this issue Jan 17, 2024
Fix go-gitea#28570
Follow go-gitea#24633

---
Copied from
go-gitea#28570 (comment)

The feature introduced in go-gitea#24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.


https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
silverwind pushed a commit to silverwind/gitea that referenced this issue Feb 20, 2024
Fix go-gitea#28570
Follow go-gitea#24633

---
Copied from
go-gitea#28570 (comment)

The feature introduced in go-gitea#24633 should be compatible with
`status_check_contexts`. However, if one or more of
`status_check_contexts` is not a legal glob expressions, `glob.Compile`
will fail and the contexts cannot match.


https://github.com/go-gitea/gitea/blob/21229ed2c8ed00f57100adf9ebc5f4a08da9a66e/routers/web/repo/pull.go#L653-L663
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.

4 participants