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

🚀 Get Issues By Labels Then Save Them To LocalDB #184

Closed
Strypper opened this issue Mar 16, 2024 · 0 comments · Fixed by #192
Closed

🚀 Get Issues By Labels Then Save Them To LocalDB #184

Strypper opened this issue Mar 16, 2024 · 0 comments · Fixed by #192
Assignees
Labels
effort/medium Medium amount of work, 4h to 16h action level/normal 🙂 In comfort zone, little research and may require using built-in features, but no RnD new feature 🚀 New feature addition

Comments

@Strypper
Copy link
Owner

Description

IControlsService

The IControlsService interface now includes a new method:

Task<ControlIssueModel> GetControlIssues(string controlGroup, IEnumerable<string> labels);

The supported control groups are:

    public const string BuiltInControls = nameof(BuiltInControls);public const string SyncfusionControls = nameof(SyncfusionControls);public const string DevExpressControls = nameof(DevExpressControls);public const string CommunityToolkit = nameof(CommunityToolkit);public const string GitHubCommunity = nameof(GitHubCommunity);public const string MaterialComponent = nameof(MaterialComponent);

Implement the logic of this method in ControlsService.cs with these below goals

  1. Retrieve Control Issues by Labels: Implement the logic in ControlsService.cs to fetch control issues by labels. Currently, only BuiltInControls is supported. Example usage:
string controlLabel = "control/activity-Indicator";
string platformLabel = "platform/windows";
List<string> labelsList = new(){ controlLabel, platformLabel };
IControlsService.GetControlIssues.GetControlIssues(nameof(BuiltInControls),  labelsList);

The implementation will attach

string owner = "dotnet";
string repository = "maui";
IGitHubService.GetGitHubIssuesByLabels(owner, repository, labelsList);

⚠️ Support for other control groups will be added in the future.

  1. Save Issues to Local Database:

Utilize the provided GitHubIssueLocalDbModel to save issues to the local database. The model needs a control name property to indicate the control to which the issue belongs.

Ensure to cache issues retrieved from IGitHubService for 1 hour. When GetControlIssues is invoked, check the local database first. If the cache expires, use IGitHubService to fetch issues and save them to the database.

[Table("IssueModel")]
public class GitHubIssueLocalDbModel : BaseLocalEntity
{
    #region [ CTor ]

    public GitHubIssueLocalDbModel()
    {

    }
    #endregion

    #region [ Properties ]

    // control name

    [Column("issue_id")]
    public long IssueId { get; set; }

    [Column("title")]
    public string Title { get; set; }

    [Column("issue_link_url")]
    public string IssueLinkUrl { get; set; }

    [Column("mile_stone")]
    public string MileStone { get; set; }

    [Column("owner_name")]
    public string OwnerName { get; set; }

    [Column("created_date")]
    public DateTime CreatedDate { get; set; }

    [Column("last_updated")]
    public DateTime LastUpdated { get; set; }
    #endregion
}

⚠️ The control name property is missing in the provided model.

By incorporating these updates, IControlsService will offer enhanced functionality to retrieve and manage control-related issues.

Public API Changes

IControlsService.GetControlIssues(nameof(BuiltInControls), labelsList);

Intended Use-Case

Get related issues related to control

@Strypper Strypper added new feature 🚀 New feature addition level/normal 🙂 In comfort zone, little research and may require using built-in features, but no RnD effort/medium Medium amount of work, 4h to 16h action labels Mar 16, 2024
@Strypper Strypper moved this to In Progress in @MAUIsland Mar 16, 2024
@Strypper Strypper added this to the Hello Internet milestone Mar 17, 2024
@Strypper Strypper pinned this issue Mar 17, 2024
@Strypper Strypper linked a pull request Mar 24, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In Progress to Done in @MAUIsland Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium amount of work, 4h to 16h action level/normal 🙂 In comfort zone, little research and may require using built-in features, but no RnD new feature 🚀 New feature addition
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants