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

1452694: Candlepin no longer deletes pools for custom subscriptions (2.0) #1632

Merged
merged 1 commit into from Jul 14, 2017

Conversation

Ceiu
Copy link
Contributor

@Ceiu Ceiu commented Jul 11, 2017

  • Pools for custom subscriptions will no longer be deleted on manifest
    delete/undo import
  • The Per-org products migration has been updated/fixed to also migrate
    subscription information from the subscription table to the pool table
  • Bonus pools now inherit upstream pool and customer data from their
    source pool

@Ceiu Ceiu changed the title 1452694: Candlepin no longer deletes pools for custom subscriptions 1452694: Candlepin no longer deletes pools for custom subscriptions (2.0) Jul 11, 2017
@Ceiu Ceiu force-pushed the crog/pool_migration_fix-20 branch 2 times, most recently from 906f621 to 1e6610c Compare July 12, 2017 19:03
@@ -120,7 +120,8 @@ def import_and_wait
it 'can be undone' do
# Make a custom pool so we can be sure it does not get wiped
# out during either the undo or a subsequent re-import:
prod = create_product(random_string(), random_string(), {:owner => @import_owner['key']})
prod_name = "custom_pool_prod-" + random_string()
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for future reference, random_string("custom_pool_prod-") would accomplish the same thing I believe. Don't worry about changing it but I think the more concise usage would be preferable in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha. I'll address this here since there are other changes to make anyway.


// TODO:
// Remove the standalone config check and replace it with a check for whether or not the
// pool is "managed" -- however we decide to implement that in the future.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we go ahead and implement isManaged() and just have it return !standalone || pool.getUpstreamPoolId() != null? That way there's one obvious place to go when we decide what being managed actually is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we have a convenient way to have a model object fetch the config without requiring it be passed in explicitly? As it is now, that check is part of the "is managed" bit.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could get it out of the resteasy context. I'm pretty sure we put it in there
but not sure if we really want to pollute the model with looking into the app's config.
Getting it from the context would be like public boolean isManaged(@Context Config config) if I recall correctly.

Copy link
Contributor

@mstead mstead Jul 13, 2017

Choose a reason for hiding this comment

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

I'm not really sure that I like the config leaking into the model object. Could we just set 'managed' appropriately on the pool when it is created via the API vs a refresh (not now, but later on)? Then it would be easy to determine at a database level.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While such a change would be optimal, I feel it would be a rather large change, and one I'm not sure we want to do with this PR. It's something that's better done with the pool hierarchy task.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Ceiu Agreed, I didn't intend it to be done now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if we can split the difference and add the isManaged method to CandlepinPoolManager (which UndoImportsJob uses) with a TODO to move it to Pool when the logic is no longer reliant upon the config for proper operation.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Ceiu something like poolManager.isManaged(pool)? I'd be fine with that.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 I like that as well.

@@ -112,7 +112,7 @@ public void compileRules(boolean forceRefresh) {
return;
}

log.info("Recompiling rules with timestamp: " + newUpdated);
log.info("Recompiling rules with timestamp: {}", newUpdated);
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

@awood awood self-assigned this Jul 13, 2017
- Pools for custom subscriptions will no longer be deleted on manifest
  delete/undo import
- The Per-org products migration has been updated/fixed to also migrate
  subscription information from the subscription table to the pool table
- Bonus pools now inherit upstream pool and customer data from their
  source pool
@Ceiu Ceiu force-pushed the crog/pool_migration_fix-20 branch from 1e6610c to 13b8660 Compare July 14, 2017 15:41
@awood awood merged commit 8d4fc42 into candlepin-2.0-HOTFIX Jul 14, 2017
@mstead mstead deleted the crog/pool_migration_fix-20 branch July 24, 2017 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants