status with short sha is not the same as with long sha #6280

Closed
opened 2025-11-02 06:50:56 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @amiga23 on GitHub (Nov 9, 2020).

  • Gitea version (or commit ref): 1.12.5 built with GNU Make 4.2.1, go1.14.9 : bindata, sqlite, sqlite_unlock_notify
  • Git version: 2.24.3
  • Operating system: Container image gitea/gitea:1.12.5 on aarch64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

  1. Create Status "pending" with short sha 👍
    curl -X POST "https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc?access_token=xxxxxx" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{  \"context\": \"argo\",  \"description\": \"Build started\",  \"state\": \"pending\",  \"target_url\": \"https://some.where/argo/workflows\"}"
    
  2. Check that status was created with short SHA 👍
    curl https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc
    
  3. Check that status was created with long SHA -> No it is not 👎
    Returns empty array
    curl https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc713f117a7295cefa8d5f44ada88ba5
    
  4. Check if status is shown in UI -> No it is not 👎
    https://try.gitea.io/status-test/status-test/commits/branch/master
  5. Create Status "success" with long sha 👍
    curl -X POST "https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc713f117a7295cefa8d5f44ada88ba5?access_token=xxxxxx" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{  \"context\": \"argo\",  \"description\": \"Build started\",  \"state\": \"success\",  \"target_url\": \"https://some.where/argo/workflows\"}"
    
  6. Check if Status was created with long SHA 👍
    Shows status "success"
    curl https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc713f117a7295cefa8d5f44ada88ba5
    
  7. Check if Status was created with short SHA 👎
    Still shows status "pending"
    curl https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc
    
  8. Check if Status is shown in UI 👍
    https://try.gitea.io/status-test/status-test/commits/branch/master

...

Screenshots

Originally created by @amiga23 on GitHub (Nov 9, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.12.5 built with GNU Make 4.2.1, go1.14.9 : bindata, sqlite, sqlite_unlock_notify - Git version: 2.24.3 - Operating system: Container image gitea/gitea:1.12.5 on aarch64 <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) - [ ] No - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description 1. Create Status "pending" with short sha :+1: ``` curl -X POST "https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc?access_token=xxxxxx" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"context\": \"argo\", \"description\": \"Build started\", \"state\": \"pending\", \"target_url\": \"https://some.where/argo/workflows\"}" ``` 2. Check that status was created with short SHA :+1: ``` curl https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc ``` 3. Check that status was created with long SHA -> No it is not :-1: Returns empty array ``` curl https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc713f117a7295cefa8d5f44ada88ba5 ``` 4. Check if status is shown in UI -> No it is not :-1: https://try.gitea.io/status-test/status-test/commits/branch/master 5. Create Status "success" with long sha :+1: ``` curl -X POST "https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc713f117a7295cefa8d5f44ada88ba5?access_token=xxxxxx" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"context\": \"argo\", \"description\": \"Build started\", \"state\": \"success\", \"target_url\": \"https://some.where/argo/workflows\"}" ``` 6. Check if Status was created with long SHA :+1: Shows status "success" ``` curl https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc713f117a7295cefa8d5f44ada88ba5 ``` 7. Check if Status was created with short SHA :-1: Still shows status "pending" ``` curl https://try.gitea.io/api/v1/repos/status-test/status-test/statuses/2d391d1efc ``` 8. Check if Status is shown in UI :+1: https://try.gitea.io/status-test/status-test/commits/branch/master ... ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/bug label 2025-11-02 06:50:56 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6280