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

Service for migrating tickets #84

Open
stevebrownlee opened this issue Oct 2, 2024 · 3 comments
Open

Service for migrating tickets #84

stevebrownlee opened this issue Oct 2, 2024 · 3 comments
Assignees

Comments

@stevebrownlee
Copy link
Owner

stevebrownlee commented Oct 2, 2024

Purpose

The team currently uses a command-line tool, written in Python, to migrate tickets on the group project template to each of the students' repositories. While this take low effort to configure and run, it is still a separate process that should, instead, be automated on the Learning Platform.

Independent Service

The description of work below should be written as an indepdendant Python service that will be listening for a message (TBD) on a Redis queue that will be dispatched by the Learning Platform Django app.

See https://github.com/stevebrownlee/learn-ops-services for existing services.

Description

When a coach makes teams for a group project, the following steps should be taken.

  1. Determine if the source client-side repository has issues.
  2. If it doesn't, and this is a full stack project, check if the source API repository has issues.
  3. If any issues are detected, iterate the list returned from Github and create the issues on the client-side repository assigned to each team.
  4. The Projects feature of the Github API is in shambles currently (10/02/2024) as they migrate to a GraphQL API instead of a REST API. Currently, all we can do is create a project on the client-side repo, so that is the last automatable step.

Once that process is complete, the cohort's coach will need to manually add a Backlog column to each client-side repository and then add the issue tickets in the Github UI.

@stevebrownlee
Copy link
Owner Author

  • Create new service named monarch
  • New service will listen on the channel_migrate_issue_tickets channel
  • Payload must include source repo and target repo(s)

@stevebrownlee
Copy link
Owner Author

Trace:

  1. backlog_issues.migrate_issues() -> get_from_source() -> get_open_issues() -> request issues from Github
  2. Iterate the issues received
  3. Create dictionary with keys needed for new issue on target repo
  4. Invoke format_issue()

@stevebrownlee
Copy link
Owner Author

flowchart LR
    subgraph API["Django REST API"]
        endpoint["API Endpoint"]
        publisher["Redis Publisher"]
    end

    subgraph Redis["Redis PubSub"]
        channel["channel_migrate_issue_tickets"]
    end

    subgraph Service["Migration Service"]
        subscriber["Redis Subscriber"]
        processor["Ticket Migration Processor"]
    end

    subgraph GitHub["GitHub"]
        source["Source Template Repository"]
        target1["Student Repository 1"]
        target2["Student Repository 2"]
        targetN["Student Repository N"]
    end

    endpoint -->|"Create repos\nfor students"| GitHub
    endpoint -->|"Trigger migration"| publisher
    publisher -->|"Publish message\n{source_repo, target_repos}"| channel
    channel -->|"Consume message"| subscriber
    subscriber -->|"Process message"| processor
    source -->|"Read issues"| processor
    processor -->|"Clone issues"| target1
    processor -->|"Clone issues"| target2
    processor -->|"Clone issues"| targetN

    classDef api fill:#f9f,stroke:#333,stroke-width:2px
    classDef redis fill:#f96,stroke:#333,stroke-width:2px
    classDef service fill:#9f9,stroke:#333,stroke-width:2px
    classDef github fill:#69f,stroke:#333,stroke-width:2px
    
    class endpoint,publisher api
    class channel redis
    class subscriber,processor service
    class source,target1,target2,targetN github
Loading

@stevebrownlee stevebrownlee self-assigned this Dec 31, 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

No branches or pull requests

1 participant