Skip to content

Conversation

@shtrom
Copy link
Member

@shtrom shtrom commented Dec 18, 2025

This commit introduces a new Repo.treeherder_name field. If this field is not empty, Treeherder links are shown.

In addition, the repo QueryString parameter is added to those links, to match the treeherder_name. This allows lando to point to results for commits which are not on autoland (the Treeherder default).

Two data migration steps are included in this change for pre-existing repos:

  • use HgMO url to find the treeherder name;
  • use the git default_branch for firefox- Git repos.

  • Repo: add treeherder_name field (bug 2004162)
  • jinja2: update type hints (Bug 1986844)
  • jinja2: use Repo.treeherder_name in treeherder_link (bug 2004162)
  • ui: Only show TreeHerder link if enabled (bug 2004162)

@github-actions
Copy link

View this pull request in Lando to land it once approved.

@shtrom shtrom force-pushed the bug2004162/treeherder-link-repo branch from ba9d9f0 to 38ab7a9 Compare December 18, 2025 06:40
@shtrom shtrom requested a review from zzzeid December 18, 2025 06:46
@shtrom shtrom marked this pull request as ready for review December 18, 2025 09:06
@shtrom shtrom requested a review from a team as a code owner December 18, 2025 09:06
Copy link
Contributor

@zzzeid zzzeid left a comment

Choose a reason for hiding this comment

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

I think the treeherder name can be gleaned from the hg repo's push path, so not sure we need an explicit field for this? I don't think there are any exceptions to this rule at this time.

zzzeid
zzzeid previously approved these changes Dec 18, 2025
Copy link
Contributor

@zzzeid zzzeid left a comment

Choose a reason for hiding this comment

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

Note that the migration needs to be regenerated as it is now outdated.

Approved with a nit, I think we could get the treeherder repo name from the repo name itself in most if not all cases.

@shtrom
Copy link
Member Author

shtrom commented Dec 18, 2025

I think the treeherder name can be gleaned from the hg repo's push path, so not sure we need an explicit field for this? I don't think there are any exceptions to this rule at this time.

Yes, that's how we have historically been doing it, but as we are getting more repos in Git, with new names, this becomes less straightforward (particularly for those repos that don't actually have Treeherder support).

Making the name explicit here allows us to avoid the uncertainty.

@shtrom
Copy link
Member Author

shtrom commented Dec 19, 2025

I think the treeherder name can be gleaned from the hg repo's push path, so not sure we need an explicit field for this? I don't think there are any exceptions to this rule at this time.

Yes, that's how we have historically been doing it, but as we are getting more repos in Git, with new names, this becomes less straightforward (particularly for those repos that don't actually have Treeherder support).

Ah! But we can use that information for data migration, at least!

@shtrom
Copy link
Member Author

shtrom commented Dec 19, 2025

Ah! But we can use that information for data migration, at least!

Ok, I did just that (and renumbered the migration)!

@shtrom shtrom dismissed zzzeid’s stale review December 19, 2025 01:23

Probably worth another look for the data migration.

@shtrom shtrom requested a review from zzzeid December 19, 2025 01:23
@shtrom shtrom changed the title ui: Only show TreeHerder link if enabled (bug 2005812) ui: Only show TreeHerder link if enabled (bug 2004162 ) Jan 5, 2026
@shtrom shtrom changed the title ui: Only show TreeHerder link if enabled (bug 2004162 ) ui: Only show TreeHerder link if enabled (bug 2004162) Jan 5, 2026
@zzzeid
Copy link
Contributor

zzzeid commented Jan 6, 2026

Note: there is a small typo in the PR description ("changeoc").

@shtrom
Copy link
Member Author

shtrom commented Jan 7, 2026

This conflicts with main. Rebasing.

@shtrom shtrom force-pushed the bug2004162/treeherder-link-repo branch from b54ec02 to d5f6332 Compare January 7, 2026 04:45
@shtrom
Copy link
Member Author

shtrom commented Jan 7, 2026

Needs squashing... https://lando.moz.tools/landings/24316/

@shtrom shtrom force-pushed the bug2004162/treeherder-link-repo branch from d5f6332 to 982dc1b Compare January 7, 2026 05:05
lando-prod-mozilla bot pushed a commit that referenced this pull request Jan 7, 2026
This commit introduces a new `Repo.treeherder_name` field. If this field is not empty, Treeherder links are shown.

In addition, the `repo` QueryString parameter is added to those links, to match the `treeherder_name`. This allows lando to point to results for commits which are not on `autoland` (the Treeherder default).

Two data migration steps are included in this change for pre-existing repos:
* use HgMO url to find the treeherder name;
* use the git default_branch for `firefox-` Git repos.

---

 * Repo: add treeherder_name field (bug 2004162)
 * jinja2: update type hints (Bug 1986844)
 * jinja2: use Repo.treeherder_name in treeherder_link (bug 2004162)
 * ui: Only show TreeHerder link if enabled (bug 2004162)

Pull request: #788
@lando-prod-mozilla
Copy link

Pull request closed by commit 1c56034

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.

3 participants