Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9835

Closed
Open
Created Nov 17, 2015 by Administrator@rootOwner

before_sha = null

Created by: rustjson

curl localhost:3000/ci/api/v1/builds/register.json This to get a pending build. but return this: "before_sha":"0000000000000000000000000000000000000000","allow_git_fetch":true,"project_name":"Jason / Abced","options":{},"timeout":3600,"variables":

In the database:

mysql> select * from ci_commits limit 1\G;
*************************** 1. row ***************************
           id: 1
   project_id: NULL
          ref: NULL
          sha: e382b257ef3275a3b40d2977691e7153aa32dcb7
   before_sha: NULL
    push_data: NULL
   created_at: 2015-11-17 02:56:11
   updated_at: 2015-11-17 02:56:12
          tag: 0
  yaml_errors: Undefined yaml error
 committed_at: 2015-11-17 02:56:11
gl_project_id: 10
1 row in set (0.00 sec)

Code:

gitlab-ce/app/models/project.rb:775:in `ensure_ci_commit`
gitlab-ce/app/services/ci/create_commit_service.rb:19:in `execute'
gitlab-ce/lib/ci/api/commits.rb:55:in `block (2 levels) in <class:Commits>'

By using byebug, I am pretty sure this was the place where ci_build was being created. But I believe ci_commits.create(sha: sha) won't write before_sha and this was the reason while I finally got a NULL. BTW, I invoke this API manually, cause I did't found out which trigger invoked this API when I am pushing commits.

Assignee
Assign to
Time tracking