Running a pipeline should update last_activity_at for a project
Problem to solve
To gain an understanding of active versus inactive projects in an instance, or under a SaaS namespace, it would be ideal to have a single-source-of-truth identifying when a project was last active. The
last_activity_at field in the
/projects API is a great place for this data.
Currently, [at most once per hour] this field is updated upon Push Events, MR activity and Issue activity (all
Events collected by the Contribution Analytics controller). https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/event.rb#L341
However, it's possible for a project to be in-use but not often updated. For example, a project with an unchanging codebase that has a regularly-scheduled or triggered pipeline.
Project activity should be considered broader than project contributions, and for teams/admins seeking to actively remove and retire dormant or abandoned projects, it's an important data point.
- Cameron (Compliance Manager)
- Devon (DevOps Engineer)
- Sidney (Systems Administrator)
- Alex (Security Operations Engineer)
User experience goal
As a system administrator, I should be able to query projects by their last activity date and be confident that this reflects the most common scenarios constituting project activity. CI/CD activity should be included.
We have the concept of
last_activity_date, which is currently https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/project.rb#L1206 the most recent of
ast_activity_at, last_repository_updated_at, updated_at - what if this was what the Projects API returned, and it included the most recent
created_at date for a given project's CI pipelines, i.e.
select GREATEST(COALESCE(created_at)) from ci_pipelines where project_id=123