Refactor Treeherder's branch model#9496
Conversation
4f9489f to
fa96c6e
Compare
|
Alright, a couple notes for the reviewer:
|
fa96c6e to
43aaae6
Compare
|
The changes will be applied to the prototype instance in the next 30 minutes. |
|
Deployment to prototype failed with: |
|
@Archaeopteryx so the problem is that Then I need to understand how the deploys work to figure out the proper fix. Does If so, then I think the migration just needs to not convert existing branches to If not, Claude suggests we add a line to Wdyt? |
|
Possibly answered my own question. Assuming this is what runs during migrations: It looks like we always call
I'll update this PR and we can try again. |
43aaae6 to
21a1056
Compare
Each transformer can have its own bespoke logic for resolving a repository. So instead of having an if/else at the call site, move this logic onto a helper method of the transformer itself for cleaner code.
…yBranch model The Repository model has a "branch" field, which means repositories are inherently tied to single branch. It was likely designed this way because we colloquially called Mercurial repos "branches", so there was a 1:1 mapping of branches to repositories. But as Github repos started getting added, this was obviously no longer the case. To support Github, we started adding hacks that overrode the "branch" field. We turned it into a comma separate list that gets parsed by a regex to support multiple branches. We added the string "pull request" to support pull requests. This worked, but it's inherently limiting. For example, pushes that match the comma separated regex lose the information of which branch they actually matched. This is valuable information that Treeherder could be using in its UI and API. Instead, we can store branches in a separate table in the DB. This decouple branches from repository in the model and allows for more sophisticated configurations. It will also make it easier to implement "wildcard" support for branches, which will be needed for "try-like" repositories.
As part of the Gecko2Github migration, we need a way for Treeherder to display _all_ pushes to certain repositories in order to support an equivalent to "try".
21a1056 to
9003b67
Compare
|
I updated this PR such that instead of This will allow us to fix a request from the firefox-ios team. |
This makes backend changes to better support complex mappings between projects and repositories / branches: