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

Feature Request: Show Git repository report #35

Open
olblak opened this issue Aug 2, 2023 · 0 comments
Open

Feature Request: Show Git repository report #35

olblak opened this issue Aug 2, 2023 · 0 comments

Comments

@olblak
Copy link
Member

olblak commented Aug 2, 2023

Is your feature request related to a problem?

Udash is now capable of showing pipeline information, but I am interested to show all informations available for a specific git repository. The database already contained a lot of information based on report, so we would need two additionnal endpoints

  • /api/scm/reports/ : List all scm repository
  • /api/scm/reports/id: List all latest targets for a specific scm repository

Solution you'd like

No response

Alternatives you've considered

No response

Anything else?

I experimentated a bit with with various sql queries such as

Retrieve all targets

SELECT created_at, updated_at, targets -> 'ID', targets FROM
    (SELECT DISTINCT ON ( targets -> 'ID') created_at, updated_at, targets FROM 
       (SELECT created_at, updated_at, jsonb_path_query(data::jsonb, '$.Targets[*].*') as targets FROM pipelineReports) t ORDER BY targets -> 'ID', updated_at DESC) id;

Retrieve target for a specific repository/branch

SELECT j.targets ->> 'ID', j.targets FROM (SELECT jsonb_path_query(data::jsonb, '$.Targets[*].* ? (@.Scm.URL  == "https://github.com/updatecli/updatecli.git" && @.Scm.Branch.Target == "main")')  as targets from pipelineReports group by 1 ) j;

While experimenting with various SQL queries, I realized that once again I am blocked by updatecli/updatecli#1395

I don't have an way to identify a uniq target without pollution like temporary working branch that change over time

Before making progress on this issue in Udash I may have to improve the situation in Updatecli first.
This discussion may provide some interesting hint https://stackoverflow.com/questions/34638717/golang-marshal-unmarshal-json-with-a-custom-tag

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

No branches or pull requests

1 participant