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

[JENKINS-64356] fix legacyIds missing when creating jobs via REST API or CLI #9303

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/src/main/java/hudson/model/ItemGroupMixIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ public synchronized TopLevelItem createProjectFromXML(String name, InputStream x

add(result);

result.onCreatedFromScratch();
ItemListener.fireOnCreated(result);
Jenkins.get().rebuildDependencyGraphAsync();

Expand Down
3 changes: 0 additions & 3 deletions test/src/test/java/jenkins/model/RunIdMigratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.nio.charset.StandardCharsets;
import org.htmlunit.HttpMethod;
import org.htmlunit.WebRequest;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
Expand All @@ -58,7 +57,6 @@ public void legacyIdsPresent() throws Exception {
assertTrue(legacyIds.exists());
}

@Ignore("TODO Item#onCreatedFromScratch is not called")
@Issue("JENKINS-64356")
@Test
public void legacyIdsPresentViaRestApi() throws Exception {
Expand All @@ -82,7 +80,6 @@ public void legacyIdsPresentViaRestApi() throws Exception {
assertTrue(legacyIds.exists());
}

@Ignore("TODO Item#onCreatedFromScratch is not called")
@Issue("JENKINS-64356")
@Test
public void legacyIdsPresentViaCli() {
Expand Down
Loading