Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-66088

Incorrect GDSL in core jenkins

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Similar Issues:

      Description

      The main issue and reproducible examples are described in https://youtrack.jetbrains.com/issue/IDEA-272024

      The problem is in file https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/dsld/IntelliJ.gdsl 
      It doesn't compute type of properties my and instance properly, making them have just an empty type. There is a problem with IDEA because we do not expect that properties may have empty type, and we will fix it. Nevertheless, I doubt that you want to generate such properties and I believe it is a bug in your GDSL file.  

        Attachments

          Activity

          Hide
          knisht Konstantin added a comment -

          So, this GDSL script does the following thing:
          If there is a file aaa/bbb/Ccc/view.groovy, then it generates properties my and instance with type aaa.bbb.Ccc and descriptor with type aaa.bbb.Ccc.DescriptorImpl. It looks very similar to typing rules for it that described here.
          Clearly, if we have plain view.groovy without parent directories, it does not make sense to generate type for such properties, so I made a fix in this PR.

          Show
          knisht Konstantin added a comment - So, this GDSL script does the following thing: If there is a file aaa/bbb/Ccc/view.groovy , then it generates properties my and instance with type aaa.bbb.Ccc and descriptor with type aaa.bbb.Ccc.DescriptorImpl . It looks very similar to typing rules for it that described here . Clearly, if we have plain view.groovy without parent directories, it does not make sense to generate type for such properties, so I made a fix in this PR .
          Hide
          jglick Jesse Glick added a comment -

          I do not know anything about IDEA or GDSL.

          Offering a general type for my or instance in Groovy views is hopeless—could be anything. descriptor should of course be of some subtype of Descriptor; typing it merely as Descriptor is not going to be particularly helpful.

          IMHO Groovy views are just misguided. Jelly is good enough. Just keep all the logic in Java and have the view limit itself to simple if-then blocks, loops, looking up properties. There is no way you can get reliable static typing on stuff inside the view short of JENKINS-31203.

          Show
          jglick Jesse Glick added a comment - I do not know anything about IDEA or GDSL. Offering a general type for my or instance in Groovy views is hopeless—could be anything. descriptor should of course be of some subtype of Descriptor ; typing it merely as Descriptor is not going to be particularly helpful. IMHO Groovy views are just misguided. Jelly is good enough. Just keep all the logic in Java and have the view limit itself to simple if-then blocks, loops, looking up properties. There is no way you can get reliable static typing on stuff inside the view short of JENKINS-31203 .
          Hide
          timja Tim Jacomb added a comment -

          I think they will all point to classes of type descriptor but I may be wrong, Jesse Glick maybe you can help

          Show
          timja Tim Jacomb added a comment - I think they will all point to classes of type descriptor but I may be wrong, Jesse Glick maybe you can help
          Hide
          knisht Konstantin added a comment - - edited

          Tim Jacomb Thanks for the reply!

          I'd like to fix this problem since I see a lot of exceptions of this kind in our bugreports, but I'm not familiar with Jenkins and I'm not sure that the functionality of GDSL remains the same after my intervention. If you can point out where I can learn more about these properties of groovy scripts (my, instance, and descriptor, particularly their types are a subject of my curiosity), I'd appreciate it a lot. 

          Show
          knisht Konstantin added a comment - - edited Tim Jacomb  Thanks for the reply! I'd like to fix this problem since I see a lot of exceptions of this kind in our bugreports, but I'm not familiar with Jenkins and I'm not sure that the functionality of GDSL remains the same after my intervention. If you can point out where I can learn more about these properties of groovy scripts ( my , instance, and descriptor , particularly their types are a subject of my curiosity), I'd appreciate it a lot. 
          Hide
          timja Tim Jacomb added a comment -

          Konstantin a PR would be much appreciated, that file has been pretty much untouched since creation of it 9 years ago. Someone who knows GDSL already will probably fix it faster.

          thanks for the bug report

          Show
          timja Tim Jacomb added a comment - Konstantin a PR would be much appreciated, that file has been pretty much untouched since creation of it 9 years ago. Someone who knows GDSL already will probably fix it faster. thanks for the bug report

            People

            Assignee:
            knisht Konstantin
            Reporter:
            knisht Konstantin
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: