Commit 4f324d84 authored by Stan Hu's avatar Stan Hu

Merge branch '8745-add-last-time-verified-on-geo-projects-page' into 'master'

Add 'Last time verified' for synced projects on Geo projects page

Closes #8745

See merge request gitlab-org/gitlab-ee!8845
parents a5ae2e88 6f5b71f5
......@@ -73,6 +73,7 @@ module Geo
registry.update!(
"#{type}_verification_checksum_sha" => checksum,
"#{type}_checksum_mismatch" => mismatch,
"last_#{type}_verification_ran_at" => Time.now,
"last_#{type}_verification_failure" => failure,
"#{type}_verification_retry_count" => verification_retry_count,
"resync_#{type}" => reverify,
......
......@@ -13,6 +13,14 @@
= time_ago_with_tooltip(project_registry.last_repository_successful_sync_at, placement: 'bottom')
- else
= s_('Geo|Never')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Last time verified')
.project-status-content
- if project_registry.last_repository_verification_ran_at
= time_ago_with_tooltip(project_registry.last_repository_verification_ran_at, placement: 'bottom')
- else
= s_('Geo|Never')
.col-sm.project-status-container
.project-status-title.text-muted
= s_('Geo|Last repository check run')
......
---
title: Geo - Show last verification time on Geo projects page
merge_request: 8845
author:
type: added
# frozen_string_literal: true
class AddLastVerificationColumnsToProjectRegistry < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
add_column :project_registry, :last_repository_verification_ran_at, :datetime_with_timezone
add_column :project_registry, :last_wiki_verification_ran_at, :datetime_with_timezone
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20180806020615) do
ActiveRecord::Schema.define(version: 20181213184140) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
......@@ -79,6 +79,8 @@ ActiveRecord::Schema.define(version: 20180806020615) do
t.boolean "wiki_missing_on_primary"
t.integer "repository_verification_retry_count"
t.integer "wiki_verification_retry_count"
t.datetime_with_timezone "last_repository_verification_ran_at"
t.datetime_with_timezone "last_wiki_verification_ran_at"
t.index ["last_repository_successful_sync_at"], name: "idx_project_registry_synced_repositories_partial", where: "((resync_repository = false) AND (repository_retry_count IS NULL) AND (repository_verification_checksum_sha IS NOT NULL))", using: :btree
t.index ["last_repository_successful_sync_at"], name: "index_project_registry_on_last_repository_successful_sync_at", using: :btree
t.index ["last_repository_synced_at"], name: "index_project_registry_on_last_repository_synced_at", using: :btree
......
......@@ -126,7 +126,7 @@ describe 'admin Geo Projects', :js, :geo do
let(:sync_status) { :synced }
let(:expected_registries) { [synced_registry] }
let(:unexpected_registries) { [sync_pending_registry, sync_failed_registry, never_synced_registry] }
let(:labels) { ['Status', 'Last successful sync', 'Last repository check run'] }
let(:labels) { ['Status', 'Last successful sync', 'Last time verified', 'Last repository check run'] }
it_behaves_like 'shows tab specific projects and correct labels'
end
......
......@@ -49,6 +49,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect(registry).to have_attributes(
"#{type}_verification_checksum_sha" => '62fc1ec4ce60',
"#{type}_checksum_mismatch" => false,
"last_#{type}_verification_ran_at" => be_within(1.minute).of(Time.now),
"last_#{type}_verification_failure" => nil,
"#{type}_verification_retry_count" => nil,
"resync_#{type}" => false,
......@@ -67,6 +68,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect(registry).to have_attributes(
"#{type}_verification_checksum_sha" => '0000000000000000000000000000000000000000',
"#{type}_checksum_mismatch" => false,
"last_#{type}_verification_ran_at" => be_within(1.minute).of(Time.now),
"last_#{type}_verification_failure" => nil,
"#{type}_verification_retry_count" => nil,
"resync_#{type}" => false,
......@@ -86,6 +88,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect(registry).to have_attributes(
"#{type}_verification_checksum_sha" => nil,
"#{type}_checksum_mismatch" => true,
"last_#{type}_verification_ran_at" => be_within(1.minute).of(Time.now),
"last_#{type}_verification_failure" => "#{type.to_s.capitalize} checksum mismatch",
"#{type}_verification_retry_count" => 1,
"resync_#{type}" => true,
......@@ -118,6 +121,7 @@ describe Geo::RepositoryVerificationSecondaryService, :geo do
expect(registry).to have_attributes(
"#{type}_verification_checksum_sha" => nil,
"#{type}_checksum_mismatch" => false,
"last_#{type}_verification_ran_at" => be_within(1.minute).of(Time.now),
"last_#{type}_verification_failure" => "Error calculating #{type} checksum",
"#{type}_verification_retry_count" => 1,
"resync_#{type}" => true,
......
......@@ -4071,6 +4071,9 @@ msgstr ""
msgid "Geo|Last sync attempt"
msgstr ""
msgid "Geo|Last time verified"
msgstr ""
msgid "Geo|Never"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment