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

Add Repository, Project, and Organization Caching Infrastructure #229

Merged
merged 22 commits into from
Jul 2, 2024

Conversation

dkbennett
Copy link
Member

@dkbennett dkbennett commented Jun 25, 2024

Summary of the pull request

This change lays the groundwork for notifications and a more performant Repository Provider. It does not add much in the way of functionality on its own beyond updating the Settings UI for the Azure Extension. It is required for Notifications later.

References and relevant issues

Detailed description of the pull request / Additional comments

This change has 3 main categories of changes:

  1. Addition of a data caching for organization, projects, and repositories. This is the main feature of this PR and it lays the groundwork for notifications and more performant Repository Provider functionality.
  • Why cache this? Because for large organizations there are literally tens of thousands of repositories potentially available and this, and getting a list of all the active repositories of the user takes approximately twenty minutes for the Microsoft org. While this is probably a worst-case scenario, if it works for a large org like Microsoft it can probably work well for smaller orgs. Since repository activity and available data is unlikely to change frequently, this data can be cached and updated infrequently to minimize rest API calls needed and have a more responsive UI.
  • Caching has cancellation options and is singled instanced. There is only ever one cache manager and it is updated as needed.
  • Cache updates are very infrequent, starting at once every three days. This is an easily changeable value.
  • Caching is infrequent, and can possibly get stale but this is unlikely. Should that be a problem there is a user force-update in the settings. Ideally this will never be needed if we get the caching rate reasonably correct but for now it is there as an escape hatch for any caching related issues users may experience to force an update.
  1. Update/overhaul of Settings Controller for the extension
  • Two implementations of the Settings Controller were added during development, and I merged the two and overhauled it a bit to scale better with multiple settings.
  • The settings UI is not expected to be "final" and it probably has some tweaks people will want to make to it, but I think it is best those are smaller changes after this PR is completed.
  • Retains the existing AI key, adds new caching, notifications, and an "open logs" button.

The namespace changes with DevBox have been resolved thanks to @krschau fixing them in a separate PR which I merged in.

Validation steps performed

  • Did a lot of manual and debug testing of the caching start/stop and interrupting it for various times and inspecting the data for correctness.
  • Test updated the RepositoryProvider using the cached repository values, but did not include that in this change. It just added confidence that the repostitory caching changes were working as expected.
  • Build and basic usage testing for other changes.
  • All tests were rebuilt run and passed.

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

@dkbennett dkbennett added the Needs-Second Pull request that needs another approval label Jun 27, 2024
@dkbennett dkbennett merged commit 33f3cc6 into main Jul 2, 2024
3 checks passed
@krschau krschau removed the Needs-Second Pull request that needs another approval label Jul 11, 2024
@krschau krschau added this to the DHAE v0.11 milestone Jul 11, 2024
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.

4 participants