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

Fixes #25894 - rename the host statuses report #6426

Merged
merged 1 commit into from Jan 30, 2019

Conversation

ares
Copy link
Member

@ares ares commented Jan 22, 2019

Reproducing steps:

  1. go to monitor -> report templates
  2. host statuses contains format in name, see "CSV"

this is no longer needed, we use rendering DSL which can modify the type, this is a leftover

to review:

  1. apply the patch, run rake db:migrate
  2. run rake db:seed
  3. go to page from 2) see the name has changed, metadata also changed (thanks to seed) so the name is correct there
  4. the template id hasn't changed, no audit was created for this internal change

Best with theforeman/community-templates#548 which should be merged at the same time so next sync won't restore original template name.

@theforeman-bot
Copy link
Member

Issues: #25894

@lzap
Copy link
Member

lzap commented Jan 29, 2019

Tests failed, can you rebase?

Also, isn't this template locked therefore seed would overwrite it correctly. What is the reason for adding explicit migration?

@ares
Copy link
Member Author

ares commented Jan 29, 2019

If we sync new version from community-templates, seed will create a new one. It's not that smart it would rename the template to a new name. Therefore, migration needs to happen before seed. Seeding would only update the content. Name in this case is the template identifier... I fixed the migration that caused test failures.

lzap
lzap previously approved these changes Jan 29, 2019
Copy link
Member

@lzap lzap left a comment

Choose a reason for hiding this comment

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

Testing hold on.

@lzap
Copy link
Member

lzap commented Jan 29, 2019

I've executed migrate then seed and I ended up with two copies: Host statuses and Host statuses CSV.

@ares
Copy link
Member Author

ares commented Jan 29, 2019

the last fix caused that, taxonomies didn't allow to find templates, it's now fixed by using unscoped

@lzap
Copy link
Member

lzap commented Jan 30, 2019

Hold my beer...

@lzap
Copy link
Member

lzap commented Jan 30, 2019

Allright!

[lzap@box foreman]$ echo "ReportTemplate.pluck(:name)" | bec
=> ["Applicable errata", "Host statuses CSV", "Registered hosts", "Subscriptions"]

[lzap@box foreman]$ be rake db:migrate
== 20190122115421 RenameHostStatusesReport: migrating =========================
== 20190122115421 RenameHostStatusesReport: migrated (0.0075s) ================

[lzap@box foreman]$ echo "ReportTemplate.pluck(:name)" | bec
=> ["Applicable errata", "Host statuses", "Registered hosts", "Subscriptions"]

[lzap@box foreman]$ be rake db:seed

[lzap@box foreman]$ echo "ReportTemplate.pluck(:name)" | bec
=> ["Applicable errata", "Host statuses", "Registered hosts", "Subscriptions"]

Copy link
Member

@lzap lzap left a comment

Choose a reason for hiding this comment

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

All set. Sorry for the delay.

@lzap lzap merged commit 21b0a2c into theforeman:develop Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants