Skip to content

Sort months of the CI minutes chart app

What does this MR do and why?

This fixes the order of the months displayed in the CI minutes chart

#345687 (closed)

Screenshots or screen recordings

Before After
Screen_Shot_2021-11-19_at_11.59.23 Screen_Shot_2021-11-19_at_11.58.15

How to set up and validate locally

You can create minutes usage for multiple months using the following commands in the rails console

bundle exec rails c

> user = User.find(1) # This is the root user of the GDK
> project = Project.find(80) # Change this ID to whatever project you wish to use
> monthly_usage = Ci::Minutes::ProjectMonthlyUsage.new(project_id: project.id, date: Date.new(2021, 04, 01), amount_used: 70)
> monthly_usage.save
> namespace_usage = Ci::Minutes::NamespaceMonthlyUsage.new(namespace_id: user.namespace.id, date: Date.new(2021, 04, 01), amount_used: 70)
> namespace_usage.save

From there change the monthly_usage and namespace_usage months, Note keep in mind that you can only use any months, except the current running month for testing, if you use the aforementioned month you will run into a constraint error

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jose Ivan Vargas

Merge request reports