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

Job not found #65

Open
fgm opened this issue May 20, 2020 · 1 comment
Open

Job not found #65

fgm opened this issue May 20, 2020 · 1 comment

Comments

@fgm
Copy link

fgm commented May 20, 2020

  • Gogs version (or commit ref): 0.12.0+dev
  • Jenkins version: 2.222.3
  • gogs-webhook-plugin version: 1.10.15
  • Jenkins modules used in combination with gogs-webhook-plugin: none
  • JSON Output of webhook:
    • Request:
      Request URL: https://(server)/gogs-webhook/?job=thejob
      Request method: POST
      Content-Type: application/json
      X-Github-Delivery: 2650ce88-b70f-4425-8e8c-ec79bcbfe6af
      X-Github-Event: push
      X-Gogs-Delivery: 2650ce88-b70f-4425-8e8c-ec79bcbfe6af
      X-Gogs-Event: push
      X-Gogs-Signature: 
      
    • Response
      Content-Length: 69
      Content-Type: application/json
      Date: Wed, 20 May 2020 13:46:54 GMT
      Server: Jetty(9.4.27.v20200227)
      X-Content-Type-Options: nosniff
      
      {"result":"ERROR","message":"Job 'thejob' is not defined in Jenkins"}
      

Description

This seems similar to my original issue in #8, but more recently #36 as I first had the issue with the job in a folder (thefolder/thejob), so I recreated it at root, without a folder, and it is listed with the standard Jenkins API. It may be related to #22 as this is a multibranch pipeline.

(server)/api/json?tree=jobs[name,builds[number,actions[parameters[name,value]]]]&pretty=true

  "_class": "hudson.model.Hudson",
  "jobs": [
    {
      "_class": "com.cloudbees.hudson.plugins.folder.Folder",
      "name": "thefolder"
    },
    {
      "_class": "org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject",
      "name": "thejob"
    }
    {
      "_class": "hudson.model.FreeStyleProject",
      "name": "test",
      "builds": [
        
      ]
    }
   ]
}

Branch discovery works normally in the Jenkins UI. When I use the same format to test a non-multibranch job (the test job), it works normally, hence the link to #22. Such normal jobs also work in folders (calling ?job=thefolder/test)

Same error when trying the hook on ?job=thejob/master, although it works with other branches beyond master, as described near the end of #8.

@fgm
Copy link
Author

fgm commented May 20, 2020

I /think/ I found what's happening: apparently, if a branch does not contain a Jenkinsfile it is marked as not found, which may or may not be desired, but should probably be documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant