Details
Description
Implement new endpoint: api/projects/license_usage
Available only for Admins in DE+
Only works for Projects, Apps and Portfolios are not taken into account for license usage.
The supported type of output file is only CSV.
It returns a list of projects and, for each, the following fields:
- Project Key
- Project Name
- Biggest Branch or PR name
- Lines of code on the branch/PR:
We can leverage LiveMeasureDao.sumNclocOfBiggestBranch() for this - Lines of Code LOC / Max LOC in the license (license.getMaxLoc()) in %
- Last Activity Date on the Branch/PR
Last Analysis can be queried from snapshots table
Example output file:
Project Key,Project Name,Branch Name,Lines of code,License usage,Last Active Date project-1,Project 1,develop,10000,0.100,2022-03-03T10:48:06.898019 project-2,Project 2,main,20000,0.100,2022-03-03T10:48:06.898019 project-3,Project 3,develop,30000,0.100,2022-03-03T10:48:06.898019 project-4,Project 4,main,40000,0.100,2022-03-03T10:48:06.898019 project-5,Project 5,develop,50000,0.100,2022-03-03T10:48:06.898019