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

Create a code flow repro tool #4221

Open
premun opened this issue Dec 6, 2024 · 0 comments
Open

Create a code flow repro tool #4221

premun opened this issue Dec 6, 2024 · 0 comments
Assignees

Comments

@premun
Copy link
Member

premun commented Dec 6, 2024

Context

When we are developing/fixing/investigating the new code flow logic, we do have some tests that we can run locally but sometimes we want to run a code flow update over the real repos.

There are 2 problems why we can't quickly open a PR from local in a real dotnet repo:

  1. The GitHub application that the service uses when run in local only has access to the maestro-auth-test organization and it should stay that way.
  2. The local SQL database does not have the data set up and it's very difficult to create the whole structure (repos, installations, channel, subscription, assets, ...). This basically means local test flows are almost impossible to run.

Goal

The E2E workflow should be something like this:

  • The dev sees a particular subscription failing to trigger, or maybe a PR in VMR that has wrong content. Or maybe the dev wants to customize descriptions of the PR and develop something new.
  • The dev forks the VMR/repo under maestro-auth-test/ (sets up the branches so they point to the right places..).
  • The dev runs a tool from arcade-services and passes in the subscription/build IDs from the real PR.
  • The tool uses devs locally running SQL and PCS service to populate it with data matching (different ID but otherwise same) the real but targeting the forks instead.
  • The dev triggers the subscription and debugs the service locally while it flows data that mimic the real flow.

The goal should be a script/tool/test that will be easy to run:

  • The arguments will be the subscription ID, channel, build ID (whatever is necessary to mimic a scenario).
  • The tool will then:
    1. Look up the real data in production BAR (or INT if we tell it to? not needed in v1)
    2. Call the local PCS and create the same subscription (different ID but otherwise same), channel, build and assets in the local SQL but target repos under the maestro/auth-test/ org (so maestro-auth-test/dotnet or maestro-auth-test-runtime). The dev would fork the repo themselves and update its branches to whatever test setup they need.
    3. The tool can return a subscription ID, or BAR ID or even trigger the subscription if asked
    4. The dev can then trigger the subscription on their own and debug the locally running service

The tool should also be able to create fake builds for arbitrary SHAs - so if I want to flow a given commit of a repo (even a commit I create in the fork with custom changes), I don't need to have a real BAR ID for it. I can ask the tool to create a build for me and then I can flow it manually.

@premun premun changed the title Create a test/tool for testing code flow using the maestro-auth-test org Create a code flow repro tool Dec 6, 2024
@premun premun moved this to Ready in .NET Unified Build Dec 6, 2024
@premun premun moved this from Ready to In Progress in .NET Unified Build Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants