-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Hedge for when consul sends nodes with an empty ID #4331
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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,33 @@ | ||
@setupApplicationTest | ||
Feature: Hedge for if nodes come in over the API with no ID | ||
Scenario: A node list with some missing IDs | ||
Given 1 datacenter model with the value "dc-1" | ||
And 5 node models from yaml | ||
--- | ||
- ID: id-1 | ||
Node: name-1 | ||
- ID: "" | ||
Node: name-2 | ||
- ID: "" | ||
Node: name-3 | ||
- ID: "" | ||
Node: name-4 | ||
- ID: "" | ||
Node: name-5 | ||
--- | ||
When I visit the nodes page for yaml | ||
--- | ||
dc: dc-1 | ||
--- | ||
Then the url should be /dc-1/nodes | ||
Then I see name on the nodes like yaml | ||
--- | ||
- name-1 | ||
- name-2 | ||
- name-3 | ||
- name-4 | ||
- name-5 | ||
|
||
@ignore | ||
Scenario: Visually comparing | ||
Then the ".unhealthy" element should look like the "/node_modules/@hashicorp/consul-testing-extras/fixtures/dc/nodes/empty-ids.png" image |
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,10 @@ | ||
import steps from '../../steps'; | ||
|
||
// step definitions that are shared between features should be moved to the | ||
// tests/acceptance/steps/steps.js file | ||
|
||
export default function(assert) { | ||
return steps(assert).then('I should find a file', function() { | ||
assert.ok(true, this.step); | ||
}); | ||
} |
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.
What do you mean that ID isn't used at all here? It looks like you're generating IDs on the client and using that as the primary key (
uid
) so ember data is never using the ID from the server for its identity map. Probably not an issue as long as you're not caching the list or editing things, but something to be aware of if you ever want to add that sort of thing. I'm guessing you already work around that though for individual node pages (or you fetch the group first).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.
Hey, yeah its more or less a note to go back and consider just ignoring
ID
completely, and just pretendNode
is the 'unique key' to use for the slug. It sounds like that is always unique andID
can sometimes be empty, although, even while I'm writing this, the more i think about it the more I'd just continue to useID
- it just reads better plus the big has been fixed in the backend now - this is just for old data I think.