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

Rename Tables and some changes for Showback Models #96

Merged
merged 1 commit into from
Oct 27, 2017

Conversation

aljesusg
Copy link
Member

@aljesusg aljesusg commented Oct 18, 2017

Change name to tables and rename some columns .

@chargio Please review this . Maybe I am missing something.
In Usagetypes dimension is plural because this will be array so will be dimensions not dimension like rate, ok?

Now working in the PR for https://github.com/ManageIQ/manageiq-consumption changes wait until this please.

@aljesusg
Copy link
Member Author

@miq-bot add_label wip

@miq-bot miq-bot added the wip label Oct 18, 2017
@chargio
Copy link
Contributor

chargio commented Oct 18, 2017

Hi @gtanzillo @lpichler

We said to keep the models simple, but this would be too simple. Do you think we should use showback_[model]?, because chargeback_[model] is currently in use, and consumption_[model] seems to be confusing

@aljesusg
Copy link
Member Author

Chargeback_rates exists...so showback_

@chargio
Copy link
Contributor

chargio commented Oct 18, 2017

This will break tests until the PR for consumption updating the models is merged.

@lpichler @gtanzillo


rename_column :input_measures, :category, :entity
rename_column :input_measures, :dimensions, :fields
rename_column :input_measures, :measure, :group
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add column :start_time and end_time to data_views, so we can store the corresponding information from the event.
A column with context too jsonb

@aljesusg aljesusg force-pushed the showback_chargeback_changes branch from 9a32e5a to e4bda01 Compare October 18, 2017 13:58

rename_column :showback_data_views, :stored_data, :snapshot_data

add_column :showback_data_views, :snapshot_context, :string
Copy link
Contributor

Choose a reason for hiding this comment

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

context_snapshot

Copy link
Member Author

Choose a reason for hiding this comment

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

And data_snapshot so

db/schema.yml Outdated
- showback_data_rollup_id
- created_at
- updated_at
- snapshot_data
Copy link
Contributor

Choose a reason for hiding this comment

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

data_snapshot?

@aljesusg aljesusg force-pushed the showback_chargeback_changes branch from e4bda01 to 782ba3d Compare October 18, 2017 17:54
@aljesusg
Copy link
Member Author

Changed @chargio

@chargio
Copy link
Contributor

chargio commented Oct 19, 2017

@miq-bot review @gtanzillo
@miq-bot review @lpichler
@miq-bot review @jrafanie

Please have a review on the names so we can merge this

@miq-bot
Copy link
Member

miq-bot commented Oct 19, 2017

@chargio unrecognized command 'review', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

2 similar comments
@miq-bot
Copy link
Member

miq-bot commented Oct 19, 2017

@chargio unrecognized command 'review', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@miq-bot
Copy link
Member

miq-bot commented Oct 19, 2017

@chargio unrecognized command 'review', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@aljesusg aljesusg force-pushed the showback_chargeback_changes branch from 782ba3d to ed68ae6 Compare October 20, 2017 15:24
@aljesusg
Copy link
Member Author

I pushed again @chargio context_snapshot was with string instead jsonb

@miq-bot
Copy link
Member

miq-bot commented Oct 20, 2017

Checked commit aljesusg@ed68ae6 with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 15 offenses detected

db/migrate/20171018081206_showback_fix_and_rename.rb

@chargio
Copy link
Contributor

chargio commented Oct 21, 2017

@gtanzillo Could you comment?

@Fryguy
Copy link
Member

Fryguy commented Oct 23, 2017

Will this require data migrations?

@aljesusg
Copy link
Member Author

No @Fryguy chargeback is only using engine of consumption, there is not data migrated yet from old chargeback to the new one.

@chargio
Copy link
Contributor

chargio commented Oct 23, 2017

@Fryguy precisely we want to make the name change before we have the first data here... Easier to maintain

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

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

Looks good. Just had a question about the added columns.


rename_column :showback_data_views, :stored_data, :data_snapshot

add_column :showback_data_views, :context_snapshot, :jsonb
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why these cols are being added. @aljesusg can you comment?

Copy link
Contributor

Choose a reason for hiding this comment

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

We need to store the context in the dataview, because formerly we were using it in the event, but our aim is to avoid having to have an event at all. Thus, we need to store the context in the data view too

@chargio
Copy link
Contributor

chargio commented Oct 24, 2017

@Fryguy I believe we can merge it, we need to make a couple of PR before next week as this will break consumption

@lpichler
Copy link
Contributor

@chargio this will break consumption repo ? If so, I guess it will also break main repo.

@chargio
Copy link
Contributor

chargio commented Oct 24, 2017

@lpichler If you change all names in repos it will break whatever is using them. We should have a PR prepared for that

@aljesusg aljesusg changed the title [WIP] Rename Tables and some changes for Showback Models Rename Tables and some changes for Showback Models Oct 26, 2017
@aljesusg
Copy link
Member Author

@miq-bot remove_label wip

@miq-bot miq-bot removed the wip label Oct 26, 2017
@chargio
Copy link
Contributor

chargio commented Oct 26, 2017

@lpichler @gtanzillo Please review this PR and the PR that comes together with this.
This will make master red, and the other two PR will make it green again.

@Fryguy That should cover everything, we should have from now on the proper names in tables and models.

Copy link
Member

@Fryguy Fryguy left a comment

Choose a reason for hiding this comment

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

LGTM. Since you asked for @lpichler and @gtanzillo I'll wait for their approval as well before merge.

Copy link
Contributor

@lpichler lpichler left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@jrafanie jrafanie left a comment

Choose a reason for hiding this comment

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

LGTM. I'm still trying to understand what these names meant previously so hopefully the new names make this easier.

@Fryguy Fryguy merged commit 42aa87a into ManageIQ:master Oct 27, 2017
@Fryguy Fryguy added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants