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

Add missing resource to get all components #3720

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

starfishfive
Copy link

@starfishfive starfishfive commented May 16, 2024

Description

Added a new get request to components resource for getting all components.

Addressed Issue

Fix #3719

Checklist

Copy link
Contributor

@valentijnscholten valentijnscholten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on your use-case for retrieving all components of all projects? Are you exporting/importing them into a BI solution?

@PermissionRequired(Permissions.Constants.VIEW_PORTFOLIO)
public Response getComponents(
try (QueryManager qm = new QueryManager(getAlpineRequest())) {
final PaginatedResult result = qm.getComponents();
Copy link
Contributor

@valentijnscholten valentijnscholten May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add ACL checks / filtering, similar to

public PaginatedResult getProjects(final String name, final boolean excludeInactive, final boolean onlyRoot, final Team notAssignedToTeam) {
final Query<Project> query = pm.newQuery(Project.class);
if (orderBy == null) {
query.setOrdering("version desc");
}
final var filterBuilder = new ProjectQueryFilterBuilder()
.excludeInactive(excludeInactive)
.withName(name);
if (onlyRoot) {
filterBuilder.excludeChildProjects();
query.getFetchPlan().addGroup(Project.FetchGroup.ALL.name());
}
if(notAssignedToTeam != null) {
filterBuilder.notWithTeam(notAssignedToTeam);
}
final String queryFilter = filterBuilder.buildFilter();
final Map<String, Object> params = filterBuilder.getParams();
preprocessACLs(query, queryFilter, params, false);
return execute(query, params);
}

@redbaty
Copy link

redbaty commented Nov 6, 2024

Hey guys, just to chime in my use case here, this would be useful since we have a lot of microservices (which are their own project), that we group with a parentProject

It would be great if either the parentProject automatically includes components from its children, or that we could list all components so that we can keep track of all packages we are currently using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make components page default show all components
3 participants