Skip to content

[JENKINS-891] More elegant way of doing job renames #13839

Closed

Description

@jenkins-infra-bot

Currently the BuildTrigger is the only Publisher that gets called when a job is
renamed.

The snippet of code that seems to do that is (Job.java line 340):
// update BuildTrigger of other projects that point to this object.
// can't we generalize this?
for( Project p : parent.getProjects() ) {
BuildTrigger t = (BuildTrigger)
p.getPublishers().get(BuildTrigger.DESCRIPTOR);
if(t!=null)

{ if(t.onJobRenamed(oldName,newName)) p.save(); }

}

How about creating a notification interface and alerting all plugins
implementing this interface when a job is renamed? This will allow people
writing plugins to also make use of this nice functionality.


Originally reported by malanj, imported from: More elegant way of doing job renames
  • status: Closed
  • priority: Major
  • component(s): core
  • resolution: Fixed
  • resolved: 2007-10-09T18:05:53+00:00
  • votes: 0
  • watchers: 0
  • imported: 2025-11-24
Raw content of original issue

Currently the BuildTrigger is the only Publisher that gets called when a job is renamed.

The snippet of code that seems to do that is (Job.java line 340): // update BuildTrigger of other projects that point to this object. // can't we generalize this? for( Project p : parent.getProjects() ) { BuildTrigger t = (BuildTrigger) p.getPublishers().get(BuildTrigger.DESCRIPTOR); if(t!=null)

{ if(t.onJobRenamed(oldName,newName)) p.save(); }

}

How about creating a notification interface and alerting all plugins implementing this interface when a job is renamed? This will allow people writing plugins to also make use of this nice functionality.

  • environment: Platform: All, OS: All

Activity

  1. jenkins-infra-bot commented on Oct 4, 2007

    @jenkins-infra-bot
    Author
    drulli:
    • Original comment link
    • Raw content of original comment:

      Wrong component: this issue has no relevance for the tasks plugin.

    Wrong component: this issue has no relevance for the tasks plugin.

  2. jenkins-infra-bot commented on Oct 9, 2007

    @jenkins-infra-bot
    Author
    kohsuke:
    • Original comment link
    • Raw content of original comment:

      Implemented in 1.146. I added ItemListener.onRenamed(...)

    Implemented in 1.146. I added ItemListener.onRenamed(...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions