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

adds db calls for subscriptions #145

Merged
merged 2 commits into from
May 29, 2024

Conversation

tonytheleg
Copy link
Collaborator

What this PR does

Before this PR:

  • Subscription data was only stored in cache and not cosmos

After this PR:

  • Subscription data is put into Cosmos DB
  • Subscription data can be fetched and updated
  • Document types are combined into single documents.go

Jira: ARO-7410
Link to demo recording:

Special notes for your reviewer

Validation of all changes available in Jira comments (LINK

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

  • PR: The PR description is expressive enough and will help future contributors
  • Code: Write code that humans can understand and Keep it simple
  • Refactor: You have left the code cleaner than you found it (Boy Scout Rule)
  • Upgrade: Impact of this change on upgrade flows was considered and addressed if required
  • Deployment: The deployment process was considered and addressed if required
  • Testing: New code requires new unit tests.
  • Documentation: Is the documentation updated? Either in the doc located in focus area, in the README or in the code itself.
  • Customers: Is this change affecting customers? Is the release plan considered?

mjlshen
mjlshen previously approved these changes May 23, 2024
Copy link
Contributor

@mjlshen mjlshen left a comment

Choose a reason for hiding this comment

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

/lgtm, non-blocking question

frontend/database.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@mbarnes mbarnes left a comment

Choose a reason for hiding this comment

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

Noted an error handling bug that needs fixed, but I like this overall.

frontend/frontend.go Outdated Show resolved Hide resolved
frontend/database.go Outdated Show resolved Hide resolved
@tonytheleg tonytheleg force-pushed the ARO-7410-add-sub-data-to-cosmos branch 2 times, most recently from a004d99 to 89dd8d3 Compare May 28, 2024 13:28
@tonytheleg tonytheleg marked this pull request as draft May 28, 2024 13:46
@tonytheleg
Copy link
Collaborator Author

Throwing this in draft as there is one other bit of logic i think needs updating and want to make sure its all tested.

@tonytheleg tonytheleg force-pushed the ARO-7410-add-sub-data-to-cosmos branch from 89dd8d3 to cf635aa Compare May 28, 2024 14:06
@tonytheleg tonytheleg marked this pull request as ready for review May 28, 2024 14:51
@tonytheleg
Copy link
Collaborator Author

Updates validated as working in cluster.

Latest changes re-organize the error checking to at least check for errors right after a call, but explicitly checks for the ErrNotFound first and then checking for any other errors in the same check. This way we're not going through motions of creating docs only to find the next check fails. Felt like a more common and cleaner way to handle this. Let me know what you think @mbarnes @mjlshen

@tonytheleg tonytheleg force-pushed the ARO-7410-add-sub-data-to-cosmos branch from cf635aa to 2e4f738 Compare May 28, 2024 19:16
mjlshen
mjlshen previously approved these changes May 28, 2024
Copy link
Collaborator

@mbarnes mbarnes left a comment

Choose a reason for hiding this comment

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

Couple more nits. Requested change is for the status code, the other comment is optional.

frontend/frontend.go Outdated Show resolved Hide resolved
frontend/frontend.go Outdated Show resolved Hide resolved
@tonytheleg tonytheleg force-pushed the ARO-7410-add-sub-data-to-cosmos branch from 2e4f738 to a8cfe26 Compare May 29, 2024 12:46
@tonytheleg
Copy link
Collaborator Author

Requested changes added

Copy link

Please rebase pull request.

mbarnes
mbarnes previously approved these changes May 29, 2024
Copy link
Collaborator

@mbarnes mbarnes left a comment

Choose a reason for hiding this comment

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

Approved once the merge conflict is resolved.

@tonytheleg tonytheleg force-pushed the ARO-7410-add-sub-data-to-cosmos branch from a8cfe26 to a6fc6c4 Compare May 29, 2024 13:26
@mbarnes mbarnes merged commit 436907c into Azure:main May 29, 2024
5 checks passed
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.

3 participants