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

Update report dependencies endpoint to group by name only #557

Closed
sjd78 opened this issue Nov 14, 2023 · 2 comments · Fixed by #558
Closed

Update report dependencies endpoint to group by name only #557

sjd78 opened this issue Nov 14, 2023 · 2 comments · Fixed by #558

Comments

@sjd78
Copy link
Member

sjd78 commented Nov 14, 2023

For UI changes konveyor/tackle2-ui#1338 and konveyor/tackle2-ui#1340, the dependency table needs to display dependencies grouped by name only. It currently displays rows based on name and sha.

Endpoint /analyses/report/dependencies is what is currently being used. It returns struct:

//
// DepReport REST resource.
type DepReport struct {
	Provider     string   `json:"provider"`
	Name         string   `json:"name"`
	Version      string   `json:"version"`
	SHA          string   `json:"sha"`
	Labels       []string `json:"labels"`
	Applications int      `json:"applications"`
}

Please adjust the response to group dependencies by name only. The SHA and Version fields are no longer needed. The Applications count and Labels summary fields should also be adjusted.

Endpoint /analyses/reports/dependencies/applications is used by the application table on a dependency's details view. This endpoint works as needed, but the response object has the dependency's sha named "rule":

//
// DepAppReport REST resource.
type DepAppReport struct {
	ID              uint   `json:"id"`
	Name            string `json:"name"`
	Description     string `json:"description"`
	BusinessService string `json:"businessService"`
	Dependency      struct {
		ID       uint     `json:"id"`
		Provider string   `json:"provider"`
		Name     string   `json:"name"`
		Version  string   `json:"version"`
		SHA      string   `json:"rule"`
		Indirect bool     `json:"indirect"`
		Labels   []string `json:"labels"`
	} `json:"dependency"`
}

Please rename the SHA field's json name to "sha".

@sjd78
Copy link
Member Author

sjd78 commented Nov 14, 2023

cc @ibolton336

@sjd78
Copy link
Member Author

sjd78 commented Nov 14, 2023

Is the filter on:

  • version
  • sha

still needed?

I don't think so... At the very least, they will not have a use on the dependencies table.

jortel added a commit that referenced this issue Nov 15, 2023
Update /analyses/report/dependencies to group by (provider, name)
instead of (name, version, sha). Currently, provider is always "".

Removes DepReport fields:
- version
- sha

Also fixes DepAppReport.SHA JSON field name.

fixes: #557

---------

Signed-off-by: Jeff Ortel <jortel@redhat.com>
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Planning Nov 15, 2023
sjd78 added a commit to konveyor/tackle2-ui that referenced this issue Nov 15, 2023
…etails (#1536)

Resolves: #1338
Resolves: https://issues.redhat.com/browse/MTA-1585

Depends on hub change konveyor/tackle2-hub#557
/ konveyor/tackle2-hub#558.

Summary of changes:
  - The dependency table will show a single row for every named
    dependency.
  - Multiple versions will be aggregated as a single row.
  - Details about multiple versions will be available in the details
    drawer.
  - The details view application table will show the application +
    version, allowing for all versions used to be listed.

---------

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
ibolton336 added a commit to konveyor/tackle2-ui that referenced this issue Nov 15, 2023
Resolves: #1340

On the Dependencies page, detail drawer, applications table: render the
version text as a link to the maven central repository. The link uses
the dependency's sha as the key in the maven central search.

Add component `ExternalLink` to standardize rendering links outside of
the app opening in a new tab.

Note: The resolution to #1338 will require a change to the application
table's query filter and response object. This will be done in PR #1536.
See konveyor/tackle2-hub#557 for the response
object change.

Screenshot:

![image](https://github.com/konveyor/tackle2-ui/assets/3985964/50f0c144-b4fe-4ba2-a625-3c8e6ae3be6c)

---------

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
Co-authored-by: Ian Bolton <ibolton@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant