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

Cannot use branch name to get CI status #16384

Closed
2 of 6 tasks
pauloo27 opened this issue Jul 9, 2021 · 2 comments · Fixed by #16400
Closed
2 of 6 tasks

Cannot use branch name to get CI status #16384

pauloo27 opened this issue Jul 9, 2021 · 2 comments · Fixed by #16400
Labels
modifies/api This PR adds API routes or modifies them type/bug
Milestone

Comments

@pauloo27
Copy link

pauloo27 commented Jul 9, 2021

  • Gitea version (or commit ref): 1.15 (probably any version tho)
  • Git version:
  • Operating system:
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No (I couldn't find a repo with CI to test it)
  • Log gist:

Description

Running curl 'https://gitea.com/api/v1/repos/gitea/tea/commits/0f4f669cf00bb0bbf13707a5bc36aae4708d80dc/status' returns the CI status, but curl https://gitea.com/api/v1/repos/gitea/tea/commits/master/status return just empty values.

Screenshots

image
image

@6543 6543 added this to the 1.15.0 milestone Jul 9, 2021
@6543 6543 added modifies/api This PR adds API routes or modifies them type/bug labels Jul 9, 2021
@techknowlogick
Copy link
Member

I don't know that this is a bug, as branch names are refs, but this is looking for commit hashes. So instead of returning blank values it should be returning an error (especially as statuses are attached to commits rather than refs)

@pauloo27
Copy link
Author

pauloo27 commented Jul 9, 2021

I send as a bug, since "branch" is listed as a valid input in the docs.

image

@6543 6543 added the type/bug label Jul 11, 2021
6543 added a commit to 6543-forks/gitea that referenced this issue Jul 11, 2021
zeripath pushed a commit that referenced this issue Jul 13, 2021
* fix #16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil
lengyuqu pushed a commit to lengyuqu/gitea that referenced this issue Jul 13, 2021
* fix go-gitea#16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil
lunny added a commit that referenced this issue Jul 23, 2021
* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* Update templates/admin/hook_new.tmpl

Co-authored-by: a1012112796 <[email protected]>

* Update services/webhook/wechatwork.go

Co-authored-by: a1012112796 <[email protected]>

* 修善wechatwork

* 修善wechatwork

* fix

* Update locale_cs-CZ.ini

fix

* fix build

* fix

* fix build

* make webhooks.zh-cn.md

* delet unnecessary blank line

* delet unnecessary blank line

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* Update templates/admin/hook_new.tmpl

Co-authored-by: a1012112796 <[email protected]>

* Update services/webhook/wechatwork.go

Co-authored-by: a1012112796 <[email protected]>

* 修善wechatwork

* 修善wechatwork

* fix

* fix build

* fix

* fix build

* make webhooks.zh-cn.md

* delet unnecessary blank line

* delet unnecessary blank line

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix

* fix

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix wechat

* fix wechat

* fix wechat

* fix wechat

* Fix invalid params and typo of email templates (#16394)

Signed-off-by: Meano <[email protected]>

* Add LRU mem cache implementation (#16226)

The current default memory cache implementation is unbounded in size and number of
objects cached. This is hardly ideal.

This PR proposes creating a TwoQueue LRU cache as the underlying cache for Gitea.
The cache is limited by the number of objects stored in the cache (rather than size)
for simplicity. The default number of objects is 50000 - which is perhaps too small
as most of our objects cached are going to be much less than 1kB.

It may be worth considering using a different LRU implementation that actively limits
sizes or avoids GC - however, this is just a beginning implementation.

Signed-off-by: Andrew Thornton <[email protected]>

* [skip ci] Updated translations via Crowdin

* Replace `plugins/docker` with `techknowlogick/drone-docker`in ci (#16407)

* plugins/docker -> techknowlogick/drone-docker

* It is multi-arch

* docs: rewrite email setup (#16404)

* Add intro for both the docs page and mailer methods
  * Fix numbering level in SMTP section
  * Recommends implicit TLS

Signed-off-by: Bagas Sanjaya <[email protected]>

* Validate Issue Index before querying DB (#16406)

* Fix external renderer (#16401)

* fix external renderer

* use GBackground context as fallback

* no fallback, return error

Co-authored-by: Lauris BH <[email protected]>

* Add checkbox to delete pull branch after successful merge (#16049)

* Add checkbox to delete pull branch after successful merge

* Omit DeleteBranchAfterMerge field in json

* Log a warning instead of error when PR head branch deleted

* Add DefaultDeleteBranchAfterMerge to PullRequestConfig

* Add support for delete_branch_after_merge via API

* Fix for API: the branch should be deleted from the HEAD repo

If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo

* Don't delegate to CleanupBranch, only reuse branch deletion code

CleanupBranch contains too much logic that has already been performed by the Merge

* Reuse gitrepo in MergePullRequest

Co-authored-by: Andrew Thornton <[email protected]>

* [skip ci] Updated translations via Crowdin

* Detect encoding changes while parsing diff (#16330)

* Detect encoding changes while parsing diff

* Let branch/tag name be a valid ref to get CI status (#16400)

* fix #16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil

* fix

* fix

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix build

* fix build

* Apply suggestions from code review

Co-authored-by: a1012112796 <[email protected]>
Co-authored-by: myheavily <myheavily>
Co-authored-by: zhaoxin <[email protected]>
Co-authored-by: Meano <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: GiteaBot <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Bagas Sanjaya <[email protected]>
Co-authored-by: Norwin <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Jimmy Praet <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
* fix go-gitea#16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this issue Aug 10, 2021
* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* Update templates/admin/hook_new.tmpl

Co-authored-by: a1012112796 <[email protected]>

* Update services/webhook/wechatwork.go

Co-authored-by: a1012112796 <[email protected]>

* 修善wechatwork

* 修善wechatwork

* fix

* Update locale_cs-CZ.ini

fix

* fix build

* fix

* fix build

* make webhooks.zh-cn.md

* delet unnecessary blank line

* delet unnecessary blank line

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* Update templates/admin/hook_new.tmpl

Co-authored-by: a1012112796 <[email protected]>

* Update services/webhook/wechatwork.go

Co-authored-by: a1012112796 <[email protected]>

* 修善wechatwork

* 修善wechatwork

* fix

* fix build

* fix

* fix build

* make webhooks.zh-cn.md

* delet unnecessary blank line

* delet unnecessary blank line

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix

* fix

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix wechat

* fix wechat

* fix wechat

* fix wechat

* Fix invalid params and typo of email templates (go-gitea#16394)

Signed-off-by: Meano <[email protected]>

* Add LRU mem cache implementation (go-gitea#16226)

The current default memory cache implementation is unbounded in size and number of
objects cached. This is hardly ideal.

This PR proposes creating a TwoQueue LRU cache as the underlying cache for Gitea.
The cache is limited by the number of objects stored in the cache (rather than size)
for simplicity. The default number of objects is 50000 - which is perhaps too small
as most of our objects cached are going to be much less than 1kB.

It may be worth considering using a different LRU implementation that actively limits
sizes or avoids GC - however, this is just a beginning implementation.

Signed-off-by: Andrew Thornton <[email protected]>

* [skip ci] Updated translations via Crowdin

* Replace `plugins/docker` with `techknowlogick/drone-docker`in ci (go-gitea#16407)

* plugins/docker -> techknowlogick/drone-docker

* It is multi-arch

* docs: rewrite email setup (go-gitea#16404)

* Add intro for both the docs page and mailer methods
  * Fix numbering level in SMTP section
  * Recommends implicit TLS

Signed-off-by: Bagas Sanjaya <[email protected]>

* Validate Issue Index before querying DB (go-gitea#16406)

* Fix external renderer (go-gitea#16401)

* fix external renderer

* use GBackground context as fallback

* no fallback, return error

Co-authored-by: Lauris BH <[email protected]>

* Add checkbox to delete pull branch after successful merge (go-gitea#16049)

* Add checkbox to delete pull branch after successful merge

* Omit DeleteBranchAfterMerge field in json

* Log a warning instead of error when PR head branch deleted

* Add DefaultDeleteBranchAfterMerge to PullRequestConfig

* Add support for delete_branch_after_merge via API

* Fix for API: the branch should be deleted from the HEAD repo

If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo

* Don't delegate to CleanupBranch, only reuse branch deletion code

CleanupBranch contains too much logic that has already been performed by the Merge

* Reuse gitrepo in MergePullRequest

Co-authored-by: Andrew Thornton <[email protected]>

* [skip ci] Updated translations via Crowdin

* Detect encoding changes while parsing diff (go-gitea#16330)

* Detect encoding changes while parsing diff

* Let branch/tag name be a valid ref to get CI status (go-gitea#16400)

* fix go-gitea#16384#

* refactor: move shared helper func to utils package

* extend Tests

* use ctx.Repo.GitRepo if not nil

* fix

* fix

* 企业微信webhook

* 企业微信webhook

* 企业微信webhook

* fix build

* fix build

* Apply suggestions from code review

Co-authored-by: a1012112796 <[email protected]>
Co-authored-by: myheavily <myheavily>
Co-authored-by: zhaoxin <[email protected]>
Co-authored-by: Meano <[email protected]>
Co-authored-by: zeripath <[email protected]>
Co-authored-by: GiteaBot <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: Bagas Sanjaya <[email protected]>
Co-authored-by: Norwin <[email protected]>
Co-authored-by: Lauris BH <[email protected]>
Co-authored-by: Jimmy Praet <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants