Skip to content
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: Remodel task-group-deployment-summary to properly use PlacedCanaries #4325

Merged
merged 1 commit into from
May 25, 2018

Conversation

DingoEatingFuzz
Copy link
Contributor

PlacedCanaries is a []string of allocation IDs, not an int.

The result of the UI getting this wrong was whenever the count of placed canaries was shown, it was 0. Now it uses the length of PlacedCanaries.

Copy link
Contributor

@johncowen johncowen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool some of this is a bit project specific over my head-ness, but just out of interest, where these tests passing previously?


export default ApplicationSerializer.extend({
normalize(typeHash, hash) {
hash.PlacedCanaryAllocations = hash.PlacedCanaries || [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need this if you are setting the defaultValue above? (or vice versa)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultValue isn't invoked when the value is null (as opposed to undefined), so this is needed. I suppose the defaultValue in the model isn't strictly necessary, but I like that it kinda doubles as a type annotation.

Copy link

@alisdair alisdair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -5,7 +5,8 @@ import { test } from 'qunit';
import moment from 'moment';
import moduleForAcceptance from 'nomad-ui/tests/helpers/module-for-acceptance';

const sum = (list, key) => list.reduce((sum, item) => sum + get(item, key), 0);
const sum = (list, key, getter = a => a) =>
list.reduce((sum, item) => sum + getter(get(item, key)), 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice helper!

@DingoEatingFuzz
Copy link
Contributor Author

@johncowen The tests were passing previously, but that's because the fixture data was also modeled incorrectly. So the process went:

  1. Update the fixture data
  2. Tests now fail
  3. Fix the implementation

@DingoEatingFuzz DingoEatingFuzz merged commit 826416c into master May 25, 2018
@DingoEatingFuzz DingoEatingFuzz deleted the b-ui-placed-canaries branch May 25, 2018 17:16
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants