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

Remove tenant custom icons and paperclip #13796

Merged
merged 1 commit into from Feb 8, 2017
Merged

Conversation

kbrock
Copy link
Member

@kbrock kbrock commented Feb 7, 2017

Blocked: ManageIQ/manageiq-ui-classic#319

Tenancy used to be about branding.
But we didn't come up with a good solution for multi appliance storage of tenant icons.
And priorities changed.

So this feature with Tenant#icon was never used.

And this code just became cruft

  • This removes a gem (paperclip)
  • This fixes 2 failing build tests
  • This deletes a bunch of cruft, including loading one model at initialization time.

Ref: related to #13792 - but fixes a different failure

it "nulls out blank subdomain" do
expect(described_class.create!(:subdomain => " ", :parent => root_tenant).domain).to be_nil
end
end
Copy link
Member

Choose a reason for hiding this comment

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

I think @kbrock got a little too zealous to delete... 🔥 😮 I believe this nil_blanks is still needed. It doesn't seem related to the logo.

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.

See comment about the extra nil_blanks tests that should stay, I think

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 when green 🙇 @kbrock

updated migration to create fields instead of using shortcut

These are not used.
@miq-bot
Copy link
Member

miq-bot commented Feb 7, 2017

Checked commit kbrock@1742cea with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 0 offenses detected
Everything looks good. 🏆

@kbrock kbrock changed the title Remove tenant custom icons and paperclip [WIP] Remove tenant custom icons and paperclip Feb 7, 2017
@kbrock kbrock added the wip label Feb 7, 2017
@kbrock kbrock changed the title [WIP] Remove tenant custom icons and paperclip Remove tenant custom icons and paperclip Feb 7, 2017
@kbrock kbrock removed the wip label Feb 7, 2017
t.string :login_logo_file_name
t.string :login_logo_content_type
t.integer :login_logo_file_size
t.datetime :login_logo_updated_at
Copy link
Member

Choose a reason for hiding this comment

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

@kbrock You cannot simply change an existing migration. What will happen to users running rake db:migrate? /cc @Fryguy

Copy link
Member

Choose a reason for hiding this comment

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

yeah, I'm confused, are we dropping the logo feature? I'd assume we'd have a new migration that drops the columns. Can you help me understand @kbrock ?

Copy link
Member

Choose a reason for hiding this comment

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

WAT. Yeah, no.

Copy link
Member

Choose a reason for hiding this comment

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

What will happen to users running rake db:migrate?

New users: Nothing, and things will work
Current users (migrated): Nothing, and that's the problem (database not updated, code breaks)

Copy link
Member Author

@kbrock kbrock Feb 7, 2017

Choose a reason for hiding this comment

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

problem: helper attachment is not available.
solution: manually create the fields that were created by the attachment helper.
result: schema.rb (and database) should be identical.
check: the schema.yaml should freak if these values are different.

In the future, I'd like to remove these values, but the purpose of this change is not to change the db but rather reduce dependencies.

Copy link
Member

@Fryguy Fryguy Feb 7, 2017

Choose a reason for hiding this comment

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

I'm not sure how what you stated applies to this PR where you are changing an old migration. You literally cannot change an old migration. If you are adding a new one to undo stuff, then sure...I don't think anyone is against that.

Copy link
Member

Choose a reason for hiding this comment

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

ohhhhhh waiiiiit....

Are you saying the attachment helper creates all of that stuff under the covers?

Copy link
Member Author

Choose a reason for hiding this comment

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

@Fryguy yea - that was my intent. maybe I messed it up

Copy link
Member Author

Choose a reason for hiding this comment

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

I used the existing schema.rb to give me the list of fields that were added by attachment (and the order)

Copy link
Member

Choose a reason for hiding this comment

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

No, you just didn't make it clear...

the attachment method comes from paperclip gem and creates all of the exact same columns in this PR, so the PR is not changing anything except to no longer use the magic method from paperclip. In that case, this is fine 👍

@chessbyte chessbyte assigned Fryguy and unassigned jrafanie Feb 7, 2017
@kbrock
Copy link
Member Author

kbrock commented Feb 8, 2017

removed tenant.logo? requirement in classic ui. So this should be good to go

@jrafanie
Copy link
Member

jrafanie commented Feb 8, 2017

All concerns around the migration change have been addressed since this isn't really changing behavior(schema.yml is unchanged), just removing the need for paperclip by doing what it did manually. Merging.

@jrafanie jrafanie merged commit eee805b into ManageIQ:master Feb 8, 2017
@jrafanie jrafanie added this to the Sprint 54 Ending Feb 13, 2017 milestone Feb 8, 2017
@jrafanie jrafanie assigned jrafanie and unassigned Fryguy Feb 8, 2017
@kbrock kbrock deleted the tenant_fix branch February 8, 2017 20:59
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.

None yet

6 participants