-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: Replication page navigation fix #26325
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
07c85a5
Add replication mirage handler
hashishaw 1993a83
Add test with skipped failed assertion
hashishaw 5a7633b
Use component-calculated attrsForCurrentMode instead of cluster.repli…
hashishaw ca962be
assert previously-skipped assertion
hashishaw 6e2aa3f
Add changelog
hashishaw 83dd2a8
Merge branch 'main' into ui/VAULT-21924/replication-page-update-fix
hashishaw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
ui: fixed a bug where the replication pages did not update display when navigating between DR and performance | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
export default function (server) { | ||
server.get('sys/replication/status', function () { | ||
return { | ||
data: { | ||
dr: { | ||
cluster_id: 'dr-cluster-id', | ||
corrupted_merkle_tree: false, | ||
known_secondaries: ['foobar'], | ||
last_corruption_check_epoch: '-62135596800', | ||
last_dr_wal: 98, | ||
last_reindex_epoch: '0', | ||
last_wal: 98, | ||
merkle_root: 'ad721f32ed6789a1e5824841f358a517340a4585', | ||
mode: 'primary', | ||
primary_cluster_addr: 'dr-foobar', | ||
secondaries: [ | ||
{ | ||
api_address: 'http://127.0.0.1:8202', | ||
cluster_address: 'https://127.0.0.1:8203', | ||
connection_status: 'disconnected', | ||
last_heartbeat: '2024-04-09T09:04:22-05:00', | ||
node_id: 'foobar', | ||
}, | ||
], | ||
ssct_generation_counter: 0, | ||
state: 'running', | ||
}, | ||
performance: { | ||
cluster_id: 'perf-cluster-id', | ||
corrupted_merkle_tree: false, | ||
known_secondaries: [], | ||
last_corruption_check_epoch: '-62135596800', | ||
last_performance_wal: 98, | ||
last_reindex_epoch: '0', | ||
last_wal: 98, | ||
merkle_root: '618c9136bb443aa584f5d6b90755d42888c9c54a', | ||
mode: 'primary', | ||
primary_cluster_addr: 'perf-foobar', | ||
secondaries: [], | ||
ssct_generation_counter: 0, | ||
state: 'running', | ||
}, | ||
}, | ||
}; | ||
}); | ||
|
||
server.get('sys/replication/performance/status', function () { | ||
return { | ||
data: { | ||
cluster_id: 'perf-cluster-id', | ||
corrupted_merkle_tree: false, | ||
known_secondaries: ['foobar'], | ||
last_corruption_check_epoch: '-62135596800', | ||
last_dr_wal: 98, | ||
last_reindex_epoch: '0', | ||
last_wal: 98, | ||
merkle_root: 'ad721f32ed6789a1e5824841f358a517340a4585', | ||
mode: 'primary', | ||
primary_cluster_addr: 'perf-foobar', | ||
secondaries: [ | ||
{ | ||
api_address: 'http://127.0.0.1:8202', | ||
cluster_address: 'https://127.0.0.1:8203', | ||
connection_status: 'disconnected', | ||
last_heartbeat: '2024-04-09T09:04:22-05:00', | ||
node_id: 'foobar', | ||
}, | ||
], | ||
ssct_generation_counter: 0, | ||
state: 'running', | ||
}, | ||
}; | ||
}); | ||
|
||
server.get('sys/replication/dr/status', function () { | ||
return { | ||
data: { | ||
cluster_id: 'dr-cluster-id', | ||
corrupted_merkle_tree: false, | ||
known_secondaries: ['foobar'], | ||
last_corruption_check_epoch: '-62135596800', | ||
last_dr_wal: 98, | ||
last_reindex_epoch: '0', | ||
last_wal: 98, | ||
merkle_root: 'ad721f32ed6789a1e5824841f358a517340a4585', | ||
mode: 'primary', | ||
primary_cluster_addr: 'dr-foobar', | ||
secondaries: [ | ||
{ | ||
api_address: 'http://127.0.0.1:8202', | ||
cluster_address: 'https://127.0.0.1:8203', | ||
connection_status: 'disconnected', | ||
last_heartbeat: '2024-04-09T09:04:22-05:00', | ||
node_id: 'foobar', | ||
}, | ||
], | ||
ssct_generation_counter: 0, | ||
state: 'running', | ||
}, | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import { module, test } from 'qunit'; | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
import { setupMirage } from 'ember-cli-mirage/test-support'; | ||
import authPage from 'vault/tests/pages/auth'; | ||
import replicationHandlers from 'vault/mirage/handlers/replication'; | ||
import { click } from '@ember/test-helpers'; | ||
|
||
const SELECTORS = { | ||
navReplication: '[data-test-sidebar-nav-link="Replication"]', | ||
navPerformance: '[data-test-sidebar-nav-link="Performance"]', | ||
navDR: '[data-test-sidebar-nav-link="Disaster Recovery"]', | ||
title: '[data-test-replication-title]', | ||
primaryCluster: '[data-test-value-div="primary_cluster_addr"]', | ||
replicationSet: '[data-test-row-value="Replication set"]', | ||
knownSecondariesTitle: '.known-secondaries-card h3', | ||
}; | ||
module('Acceptance | Enterprise | replication navigation', function (hooks) { | ||
setupApplicationTest(hooks); | ||
setupMirage(hooks); | ||
|
||
hooks.beforeEach(function () { | ||
replicationHandlers(this.server); | ||
return authPage.login(); | ||
}); | ||
|
||
test('navigate between replication types updates page', async function (assert) { | ||
await click(SELECTORS.navReplication); | ||
assert.dom(SELECTORS.title).hasText('Disaster Recovery & Performance primary'); | ||
await click(SELECTORS.navPerformance); | ||
|
||
// Ensure data is expected for performance | ||
assert.dom(SELECTORS.title).hasText('Performance primary'); | ||
assert.dom(SELECTORS.primaryCluster).hasText('perf-foobar'); | ||
assert.dom(SELECTORS.replicationSet).hasText('perf-cluster-id'); | ||
assert.dom(SELECTORS.knownSecondariesTitle).hasText('0 Known secondaries'); | ||
|
||
// Nav to DR and see updated data | ||
await click(SELECTORS.navDR); | ||
assert.dom(SELECTORS.title).hasText('Disaster Recovery primary'); | ||
assert.dom(SELECTORS.primaryCluster).hasText('dr-foobar'); | ||
assert.dom(SELECTORS.replicationSet).hasText('dr-cluster-id'); | ||
assert.dom(SELECTORS.knownSecondariesTitle).hasText('1 Known secondaries'); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, i totally forgot about
alias
ever being a thing. it's like time traveling! 😛