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

Implementing Repository Management actions + Database changes. #3836

Merged
merged 47 commits into from
Sep 19, 2024

Conversation

dhoehna
Copy link
Contributor

@dhoehna dhoehna commented Sep 11, 2024

Summary of the pull request

This PR allows users to

  1. Remove the repository from the list
  2. Delete the Repository
  3. Run the repositories WinGet configuration file
  4. Make a new WinGet configuration file with the selected repository
  5. Open FE to the repository root
  6. Open CCMD to the repository root
  7. Add an existing repository to the list
  8. Navigate to the clone repository flow.

All from the repository management page! Yay!

In addition to logic changes. I made some database changes

  1. Removed RepositoryMetadata. IsHidden is part of the Repository entity
  2. Moved RepositoryManagementDataAccessService to DevHome.Database to prevent a circular dependency. Now I can call MakeConfigurationFileFromRepoAndGit without moving the code base to a new project.
  3. Added another Repository test.
  4. Added the following to Repository
    1. RepositoryClonePath
    2. HasConfigurationFile
    3. ConfigurationFileLocation
    4. RepositoryUri

Another change is in Navigation. Changed navigation to use a Dictionary instead of multiple if/else.

References and relevant issues

Detailed description of the pull request / Additional comments

This PR has many TODO:'s and they will be removed in another PR this week as I address them.
This feature is still experimental.

Validation steps performed

PR checklist

  • Closes #xxx
  • [X ] Tests added/passed
  • Documentation updated

dhoehna and others added 30 commits August 13, 2024 12:23
* Adding the Repository tool

* WIP

* View is set up.  Test ata as well.

* Aligning columns.  Adding column spacing.

* Reverting this change

* Update tools/RepositoryManagement/DevHome.RepositoryManagement/Strings/en-us/Resources.resw

Co-authored-by: Kristen Schau <47155823+krschau@users.noreply.github.com>

* Adressing comments

* Revert "Reverting this change"

This reverts commit 711dd78.

* Moving to experimental

* Disabling by default

* Removing from experimental.  Addressing comments.

* Reverting to main

* Update tools/RepositoryManagement/DevHome.RepositoryManagement/DevHome.RepositoryManagement.csproj

Co-authored-by: Kristen Schau <47155823+krschau@users.noreply.github.com>

* Update tools/RepositoryManagement/DevHome.RepositoryManagement/Extensions/ServiceExtensions.cs

Co-authored-by: Kristen Schau <47155823+krschau@users.noreply.github.com>

* Removing duplicate xaml code

* Adding to the mermaid diagram

* Got lost in the shuffle

* Removing a refrence

---------

Co-authored-by: Kristen Schau <47155823+krschau@users.noreply.github.com>
* WIP

* EF works.  Can save data.

* Can read and write. :)

* Repos are added when cloned.

* Putting save/load into a different class

* Adding default values

* Cleaning up names and using statements

* More comments

* Removing refrence to the public nuget

* Restoring the nuget config

* Adding a test.  Better defining dates

* Adding some tests

* More comments.

* Better path comparison.

* Removing unused equals code

* Adding more comments.  Making new migrations
@dhoehna dhoehna requested review from bbonaby, ssparach and a team September 11, 2024 17:35
@krschau krschau added this to the Dev Home v0.19 milestone Sep 11, 2024
public class DevHomeDatabaseContext : DbContext
{
public DbSet<Repository> Repositories { get; set; }
private const string DatabaseFileName = "DevHome.db";
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably add a Const value for this file name/path and add it somewhere central (like config?).

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I'm also not a fan of the name "DevHome.db". Mabye something like "DevHomeMachineData.db" to reflect that this is data about what's on the machine (at least that's what I think this is for) :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The database is for all of devhome.

I'll look into making the path, and name const

DevHome.db is for all of DevHome local for every user.

Maybe UserDevHomeData.db?

Copy link
Contributor

@vineeththomasalex vineeththomasalex left a comment

Choose a reason for hiding this comment

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

LGTM, nothing blocking, and TODO's are being taken care of in https://github.com/microsoft/devhome/tree/user/dhoehna/DatabaseMigrationsAndTodos

@dhoehna dhoehna merged commit 6b805e3 into main Sep 19, 2024
4 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.

4 participants