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

Normalize apimetadata #2254

Merged
merged 23 commits into from
Mar 10, 2017
Merged

Normalize apimetadata #2254

merged 23 commits into from
Mar 10, 2017

Conversation

marla-singer
Copy link
Contributor

@marla-singer marla-singer commented Mar 7, 2017

Closes #2184

  • Add migration to use apiId instead of apiBackendId
  • Add migration to use organizationId instead of organization object
  • Archive the old data
  • Change schema of apiMetadata collection

@marla-singer marla-singer added this to the Sprint 38 milestone Mar 7, 2017
@marla-singer
Copy link
Contributor Author

@brylie
I've tested migration and feature on local. Described the different cases and results.

Case №1

  • ApiMetadata contained information about Contact and Service
  • API was connected

Result after migration

  • Organization block has information about connected organization
  • Contact & Service information are still here

Case №2

  • ApiMetadata contained information about Contact and Service
  • API was not connected

Result after migration

  • Contact & Service information are still here
  • Organization block is empty as before

Case №3

  • ApiMetadata contained information about Organization & Contact
  • API was connected

Result after migration

  • Contact information is still here
  • Organization block has information about connected organization
  • Old information from organization block is not displayed and is stored in database

Case №4

  • ApiMetadata contained information about Organization & Contact
  • API was not connected

Result after migration

  • Contact information is still here
  • Organization block isn't displayed and information is stored in database

Case №5

  • ApiMetadata didn't contain information
  • API was connected

Result after migration

  • Contact & service blocks are empty as before
  • Organization block has information about connected organization

Case №6

  • ApiMetadata contained information about Contact and Service
  • API was not connected

Result after migration

  • Nothing happened

@marla-singer
Copy link
Contributor Author

Cases after migration

Description of feature work when a user connects/disconnects API to organization

  • When API is connected to an organization:

    • API Metadata will be created, if it doesn't have information before, and will have information about connected organization
    • API Metadata will be updated, if it has information about Contact or Service before, and will have information about connected organization as well
  • When API is disconnected from an organization:

    • API Metadata will be removed totally, if it doesn't have information about Contact or Service
    • API Metadata will be updated, if it has information about Contact or Service.

@brylie
Copy link
Contributor

brylie commented Mar 9, 2017

@marla-singer I would hope we can decouple the Organization from API Metadata. In other words, we probably don't need to trigger actions in the API Metadata collection when editing an Organization/API relationship.

@marla-singer
Copy link
Contributor Author

@brylie What? Then I don't understand why we do it. Maybe I misunderstood task at all. Why do we need organizationId? How will it be appeared after migration? 😕

@marla-singer
Copy link
Contributor Author

@brylie Did you mean we don't need to trigger actions in this PR (it should be done in related #2185) or we don't need it at all?

@brylie
Copy link
Contributor

brylie commented Mar 9, 2017

@marla-singer I am hoping we don't need trigger actions at all. Hopefully, we can just use collection helpers to retrieve related media.

In effect, we don't want to duplicate data at all, and we want our features to be as independent as possible.

@marla-singer
Copy link
Contributor Author

@brylie OK, I see your point. You gave me another way to resolve. Let's save in this PR only migration

@marla-singer
Copy link
Contributor Author

marla-singer commented Mar 9, 2017

Remove trigger actions during connect/disconnect API to/from an organization

@marla-singer
Copy link
Contributor Author

@brylie Ready for review

@marla-singer
Copy link
Contributor Author

marla-singer commented Mar 10, 2017

In effect, we don't want to duplicate data at all, and we want our features to be as independent as possible.

It's impossible to make apiMetadata independently because it depends on Organization collection. Look at your schema.
image

If you want to save it independently, we don't need organizationId field. We have organizationApis collection and we can fetch data via collection helper and apiBackendId.

@brylie
Copy link
Contributor

brylie commented Mar 10, 2017

We have organizationApis collection and we can fetch data via collection helper and apiBackendId.

Feel free to try that out.

The key phrase in the quote above is "we want our features to be as independent as possible."

@brylie
Copy link
Contributor

brylie commented Mar 10, 2017

Also, the feedback was pertaining to the event triggers, which you removed.

@marla-singer
Copy link
Contributor Author

@brylie Triggers were removed from these PR. Can you please merge it? I'd like to go ahead and think about linking in 2185 related issue

@brylie brylie merged commit 69e863f into develop Mar 10, 2017
@brylie brylie deleted the feature/normalize-apimetadata branch March 10, 2017 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants