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

Job name Enforcer

    XMLWordPrintable

    Details

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

      Description

      The aim of this feature is to be able to add constraints on job's name.
      For instance a simple use case is to be sure the jobs created follow a naming convention.

      This feature comes from the following thread in the jenkins-developer ML.
      https://groups.google.com/forum/?hl=fr#!topic/jenkinsci-dev/rsxUpaNAe18

        Attachments

          Activity

          Hide
          domi Dominik Bartholdi added a comment -

          I have this pretty much implemented, just need to clean things up a bit more...
          There will be a new extension point which allows you to not only reject job names, but also to transform these in to a new name.
          The thing is, that will also have to add this check to a job update - because a rename of the job must be controlled too.

          I will provide two implementation of this new extension:

          • default: does nothing, same as today
          • regex: does exactly what you have provided in your code

          I'll get back to you as soon as I'm further.

          Show
          domi Dominik Bartholdi added a comment - I have this pretty much implemented, just need to clean things up a bit more... There will be a new extension point which allows you to not only reject job names, but also to transform these in to a new name. The thing is, that will also have to add this check to a job update - because a rename of the job must be controlled too. I will provide two implementation of this new extension: default: does nothing, same as today regex: does exactly what you have provided in your code I'll get back to you as soon as I'm further.
          Hide
          domi Dominik Bartholdi added a comment -

          This is now implemented:
          https://github.com/jenkinsci/jenkins/commit/a2d9bac03da99d739ecf7ce0be9ba793b93d2c88

          I added a new ExtensionPoint: 'jenkins.model.ProjectNamingStrategy' and two implementations:

          • Default (no restriction, same as today)
          • Pattern (takes a regular expression to restrict the possible names)

          ...will be in 1.454

          Show
          domi Dominik Bartholdi added a comment - This is now implemented: https://github.com/jenkinsci/jenkins/commit/a2d9bac03da99d739ecf7ce0be9ba793b93d2c88 I added a new ExtensionPoint: 'jenkins.model.ProjectNamingStrategy' and two implementations: Default (no restriction, same as today) Pattern (takes a regular expression to restrict the possible names) ...will be in 1.454
          Hide
          danielpetisme Daniel Petisme added a comment -

          Does this enhancement be backported to a LTS version or not?

          Show
          danielpetisme Daniel Petisme added a comment - Does this enhancement be backported to a LTS version or not?
          Hide
          sagayd Sagayaraj David added a comment -

          Appreciate the Naming pattern for Project. But once I set this up, it is enforcing the patten for project as well as Folder; why is this to be applied for Folder?
          Could you please add three additional lines similar to the project? 1. Node naming, 2. Folder Naming and 3. View Naming

          Show
          sagayd Sagayaraj David added a comment - Appreciate the Naming pattern for Project. But once I set this up, it is enforcing the patten for project as well as Folder; why is this to be applied for Folder? Could you please add three additional lines similar to the project? 1. Node naming, 2. Folder Naming and 3. View Naming
          Hide
          imod Dominik Bartholdi added a comment -

          Sagayaraj David this was introduced way longer then folders even exist - please open a new feature request if you wold like this to be changed

          Show
          imod Dominik Bartholdi added a comment - Sagayaraj David this was introduced way longer then folders even exist - please open a new feature request if you wold like this to be changed

            People

            Assignee:
            domi Dominik Bartholdi
            Reporter:
            danielpetisme Daniel Petisme
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: