-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
refact: update models for relationship #17315
Conversation
Ember Test Audit comparison
|
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.
Looking good! Just left some minor comments and suggestions
module('Unit | Model | NodePool', function (hooks) { | ||
setupTest(hooks); | ||
|
||
test('a node pool can be associated with multiples nodes', function (assert) { |
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.
test('a node pool can be associated with multiples nodes', function (assert) { | |
test('a node pool can have multiples nodes', function (assert) { |
Minor nit-picking, but I think this describes the expected relationship better.
|
||
assert.equal(nodes.length, 2); | ||
assert.ok(nodes.includes(node1)); | ||
assert.ok(nodes.includes(node2)); |
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.
It may be worth checking that the inverse relationship is also set, so check that node1
and node2
belong to nodePool
.
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.
That's a good call!
c40f31d
to
df7598c
Compare
* chore: setup mirage models + factory hooks * Acceptance test hardening to avoid faker/mirage randomness --------- Co-authored-by: Phil Renaud <phil@riotindustries.com>
Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
* refact: update models for relationship * chore: setup mirage models + factory hooks (#17321) * chore: setup mirage models + factory hooks * Acceptance test hardening to avoid faker/mirage randomness --------- Co-authored-by: Phil Renaud <phil@riotindustries.com> * chore: update comment Co-authored-by: Luiz Aoqui <luiz@hashicorp.com> --------- Co-authored-by: Phil Renaud <phil@riotindustries.com> Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
* refact: update models for relationship * chore: setup mirage models + factory hooks (#17321) * chore: setup mirage models + factory hooks * Acceptance test hardening to avoid faker/mirage randomness --------- Co-authored-by: Phil Renaud <phil@riotindustries.com> * chore: update comment Co-authored-by: Luiz Aoqui <luiz@hashicorp.com> --------- Co-authored-by: Phil Renaud <phil@riotindustries.com> Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
* refact: update models for relationship * chore: setup mirage models + factory hooks (#17321) * chore: setup mirage models + factory hooks * Acceptance test hardening to avoid faker/mirage randomness --------- Co-authored-by: Phil Renaud <phil@riotindustries.com> * chore: update comment Co-authored-by: Luiz Aoqui <luiz@hashicorp.com> --------- Co-authored-by: Phil Renaud <phil@riotindustries.com> Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
Resolves #17293
This PR adds a relationship between the Node and NodePool models. In addition, The Job model now has an @attr('string') property called nodePool.
The nodePool property on the Node model is used to store the name of the NodePool that the job is associated with. The nodes property on the NodePool model is used to store a list of the Job models that are associated with the NodePool.
This change was made to allow users to easily associate jobs with node pools. For example, a user could create a job and specify the name of the node pool that the job should be run on.
Testing
The changes in this PR have been tested using the following tests:
ui/tests/unit/models/node-pool-test.js
The tests have been written to ensure that the Node and NodePool models can be associated with each other correctly.
Impact
This change will have a minor impact on the codebase. The Node and NodePool models will now have a relationship with each other.
Next Steps
The next steps for this change are to seed the Mirage environments such that
node pools
are reflected. Once that is ready, we'll be ready to visualize the changes in the UI against both a Mirage scenario so that design can sign off and against the real API changes to smoke test the changes.