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

API to supersede components if not required #601

Merged
merged 12 commits into from
Jan 2, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,13 @@

manifest.append("Requested components:\n\n");
ContentContainer contentsContainer = new ContentContainer(contentFilter, components);
Set<Class<? extends Component>> supersededComponents = new HashSet<>();
components.forEach(c -> supersededComponents.addAll(c.getSupersededComponents()));
for (Component component : components) {
try {
if (supersededComponents.contains(component.getClass())) {

Check warning on line 603 in src/main/java/com/cloudbees/jenkins/support/SupportPlugin.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 603 is only partially covered, one branch is missing
continue;

Check warning on line 604 in src/main/java/com/cloudbees/jenkins/support/SupportPlugin.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 604 is not covered by tests
}
manifest.append(" * ").append(component.getDisplayName()).append("\n\n");
LOGGER.log(Level.FINE, "Start processing " + component.getDisplayName());
long startTime = System.currentTimeMillis();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ public ComponentCategory getCategory() {
return ComponentCategory.UNCATEGORIZED;
}

public Set<Class<? extends Component>> getSupersededComponents() {
return Collections.emptySet();
}

/**
* Categories supported by this version of support-core
*
Expand Down
Loading