Skip to content

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

Closed
@amiga23

Description

@amiga23
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions