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

Initialize default view earlier in the init process. #8413

Merged
merged 5 commits into from
Aug 29, 2023
Merged
Changes from 1 commit
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
19 changes: 9 additions & 10 deletions core/src/main/java/jenkins/model/Jenkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -3337,6 +3337,15 @@ private void loadConfig() throws IOException {

// load from disk
cfg.unmarshal(Jenkins.this);
// initialize views by inserting the default view if necessary
// this is both for clean Jenkins and for backward compatibility.
if (views.size() == 0 || primaryView == null) {
View v = new AllView(AllView.DEFAULT_VIEW_NAME);
setViewOwner(v);
views.add(0, v);
primaryView = v.getViewName();
}
primaryView = AllView.migrateLegacyPrimaryAllViewLocalizedName(views, primaryView);
}
configLoaded = true;
try {
Expand Down Expand Up @@ -3496,16 +3505,6 @@ public void run(Reactor session) throws Exception {
getAssignedLabels();
}

// initialize views by inserting the default view if necessary
// this is both for clean Jenkins and for backward compatibility.
if (views.size() == 0 || primaryView == null) {
View v = new AllView(AllView.DEFAULT_VIEW_NAME);
setViewOwner(v);
views.add(0, v);
primaryView = v.getViewName();
}
primaryView = AllView.migrateLegacyPrimaryAllViewLocalizedName(views, primaryView);

if (useSecurity != null && !useSecurity) {
// forced reset to the unsecure mode.
// this works as an escape hatch for people who locked themselves out.
Expand Down