Last updated time incorrect for projects in group view
Summary
When viewing projects and subgroups tab in the group home view, the last updated time is incorrect. For example, I have a project testing-dev-project
in a group. It displays that it was last updated 1 week ago. Using the inspector, the time is Dec 28, 2018. However, if I query the project with the API, I get the "last_activity_at":"2018-10-26T12:46:34.372-07:00"
. You can also check by going to the Project -> Activity or Project -> Settings -> Audit Events.
Using the rails console, the project's updated_at time corresponds to the last instance update. The project's last_activity_at time has the last date a user updated the project.
This was raised by a customer in https://gitlab.zendesk.com/agent/tickets/110985 (internal use only), when they updated their version to 11.6.1-ee. I recreated this issue on my test instance at 11.6.3-ee. The last updated time for the projects seems to not reflect the last project activity, but the last instance update.
Steps to reproduce
Look at when your projects have been updated in the UI versus the last_activity_at in the GET /projects/ API endpoint, or what you see in the Project -> Activity or Project -> Settings -> Audit Events.
What is the current bug behavior?
The UI listing of projects in a group does not display the correct last updated time
What is the expected correct behavior?
The UI listing of projects in a group should display the correct last updated time, from the last_activity_at date for the project.
Relevant logs and/or screenshots
List of projects on a group homepage:
Inspecting the code for that view:
When I query the project in the rails console, I get:
irb(main):001:0> project = Project.find 128
=> #<Project id:128 bandlecity/testing-dev-project>
irb(main):002:0> project.updated_at
=> Fri, 28 Dec 2018 13:01:01 PST -08:00
irb(main):003:0> project.last_activity_at
=> Fri, 26 Oct 2018 12:46:34 PDT -07:00
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 16.04 Proxy: no Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.16.6 Rake Version: 12.3.1 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.3 Go Version: unknown
GitLab information Version: 11.6.3-ee Revision: 76c33c6 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql DB Version: 9.6.11 URL: http://198.199.92.126 HTTP Clone URL: http://198.199.92.126/some-group/some-project.git SSH Clone URL: git@198.199.92.126:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: yes Using Omniauth: yes Omniauth Providers: saml
GitLab Shell Version: 8.4.3 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.3 ? ... OK (8.4.3) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... Server: ldapmain LDAP authentication... Failed. Check
bind_dn
andpassword
configuration values LDAP users with access to your GitLab server (only showing the first 100 results) Server: ldapsecondary LDAP authentication... Failed. Checkbind_dn
andpassword
configuration values LDAP users with access to your GitLab server (only showing the first 100 results)Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 46/1 ... yes 46/2 ... yes 46/3 ... yes 46/4 ... yes 47/5 ... yes 47/6 ... yes 47/8 ... yes 47/9 ... yes 47/10 ... yes 47/11 ... yes 48/12 ... yes 48/13 ... yes 48/14 ... yes 48/15 ... yes 48/16 ... yes 48/17 ... yes 49/18 ... yes 49/19 ... yes 49/20 ... yes 49/21 ... yes 49/22 ... yes 49/23 ... yes 49/24 ... yes 49/25 ... yes 49/26 ... yes 49/27 ... yes 50/28 ... yes 50/29 ... yes 50/30 ... yes 50/31 ... yes 50/32 ... yes 50/33 ... yes 50/34 ... yes 51/35 ... yes 51/36 ... yes 51/37 ... yes 51/38 ... yes 51/39 ... yes 51/40 ... yes 51/41 ... yes 51/42 ... yes 51/43 ... yes 52/44 ... yes 52/45 ... yes 52/46 ... yes 52/47 ... yes 52/48 ... yes 52/49 ... yes 52/50 ... yes 52/51 ... yes 53/52 ... yes 53/53 ... yes 53/54 ... yes 53/55 ... yes 53/56 ... yes 53/57 ... yes 53/58 ... yes 53/59 ... yes 54/60 ... yes 54/61 ... yes 54/62 ... yes 55/63 ... yes 55/64 ... yes 56/65 ... yes 56/66 ... yes 56/67 ... yes 57/68 ... yes 57/69 ... yes 57/70 ... yes 57/71 ... yes 57/72 ... yes 57/73 ... yes 58/74 ... yes 58/75 ... yes 58/76 ... yes 58/77 ... yes 58/78 ... yes 59/79 ... yes 59/80 ... yes 59/81 ... yes 59/82 ... yes 59/83 ... yes 59/84 ... yes 59/85 ... yes 60/86 ... yes 60/87 ... yes 60/88 ... yes 60/89 ... yes 60/90 ... yes 1/91 ... yes 60/92 ... yes 1/93 ... yes 83/94 ... yes 83/95 ... yes 83/96 ... yes 84/97 ... yes 84/98 ... yes 84/99 ... yes 84/100 ... yes 85/101 ... yes 85/102 ... yes 85/103 ... yes 86/104 ... yes 86/105 ... yes 86/106 ... yes 86/107 ... yes 86/108 ... yes 87/109 ... yes 87/110 ... yes 88/111 ... yes 88/112 ... yes 88/113 ... yes 89/114 ... yes 89/115 ... yes 90/116 ... yes 90/117 ... yes 90/118 ... yes 90/119 ... yes 91/120 ... yes 91/121 ... yes 91/122 ... yes 91/123 ... yes 91/124 ... yes 98/125 ... yes 91/126 ... yes 110/127 ... yes 60/128 ... yes 60/129 ... yes 60/130 ... yes 1/131 ... yes 1/132 ... yes 1/133 ... yes 1/134 ... yes 1/135 ... yes 1/136 ... yes 1/137 ... yes 60/138 ... yes 111/139 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 75 Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
In the item_stats.vue
group component file, the time is set to item.updatedAt
- maybe change to the last_activity_at
time.
cc/ @jeremy