Page MenuHomePhabricator

Wikibugs reports color of milestones wrong
Closed, ResolvedPublicBUG REPORT

Description

Upstream: https://we.phorge.it/T16088

image.png (81×1 px, 24 KB)

but cloud-services-team (FY2024/2025-Q3-Q4) should be purple like the main cloud-services-team tag. using screenshots since colors don't come across pasted IRC log lines unfortunately.

compare:

image.png (69×1 px, 21 KB)

Event Timeline

A_smart_kitten subscribed.

I wonder if this might be an upstream Phabricator issue - the Conduit API's project.search endpoint also says that the color of that tag (PHID-PROJ-fx3a7xtrqi6qkrvoddik) is blue.

Hmm. That seems likely. I note that rPHAB src/applications/project/storage/PhabricatorProject.php (on wmf%2Fstable) has separate getColor() and getDisplayColor() methods.

The current wikibugs logic maps phabricator color names to IRC colors and gets the tag color from the projects data attached to the event which is collected from the 'project.search' Conduit endpoint.

As @A_smart_kitten notes in T395250#10856681, the Conduit response for {"phids": ["PHID-PROJ-fx3a7xtrqi6qkrvoddik"]} says the color of that project is "blue".

{
	"data": [
		{
			"id": 7599,
			"type": "PROJ",
			"phid": "PHID-PROJ-fx3a7xtrqi6qkrvoddik",
			"fields": {
				"name": "FY2024/2025-Q3-Q4",
				"slug": null,
				"subtype": "default",
				"milestone": 14,
				"depth": 1,
				"parent": {
					"id": 2773,
					"phid": "PHID-PROJ-d3h5oaspnvdwfjklmivl",
					"name": "cloud-services-team"
				},
				"icon": {
					"key": "milestone",
					"name": "Milestone",
					"icon": "fa-map-marker"
				},
				"color": {
					"key": "blue",
					"name": "Blue"
				},
				"spacePHID": null,
				"dateCreated": 1736246279,
				"dateModified": 1736246603,
				"policy": {
					"view": "public",
					"edit": "PHID-PLCY-gsth6m2as2637wjel4ti",
					"join": "users"
				},
				"description": "See also:\n* https://www.mediawiki.org/wiki/Wikimedia_Cloud_Services_team/goals/2024-25\n* https://meta.wikimedia.org/wiki/Wikimedia_Foundation_Annual_Plan/2024-2025/Product_%26_Technology_OKRs (WE6.3)",
				"custom.custom:repository": null,
				"custom.sprint:start": null,
				"custom.sprint:end": null
			},
			"attachments": {}
		}
	],
	"maps": {
		"slugMap": {}
	},
	"query": {
		"queryKey": null
	},
	"cursor": {
		"limit": 100,
		"after": null,
		"before": null,
		"order": null
	}
}

When you edit a top level project there are fields for setting the icon and color directly in the edit form. Milestones are different for whatever reason and do not have these edit fields. I have a hunch that the default color is blue, but also that the milestone tag actually renders in the parent project's color in the Phorge UI. Some poking about in the upstream code might be able to prove or refute those hunches.

diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php
index 74083ae646..bea0ae862f 100644
--- a/src/applications/project/storage/PhabricatorProject.php
+++ b/src/applications/project/storage/PhabricatorProject.php
@@ -815,7 +815,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO
   }
 
   public function getFieldValuesForConduit() {
-    $color_key = $this->getColor();
+    $color_key = $this->getDisplayColor();
     $color_name = PhabricatorProjectIconSet::getColorName($color_key);
 
     if ($this->isMilestone()) {

would make milestones use/return the color of their parent project in Conduit.

It seems that the UI already behaves correctly ("Looks like" on /project/manage/1/, "Tags" on /T1) and there is nothing to fix there.

Aklapper changed the task status from Open to Stalled.Jun 1 2025, 9:45 AM
Aklapper claimed this task.
Aklapper triaged this task as Low priority.
Aklapper updated the task description. (Show Details)
Aklapper moved this task from Backlog to Patch proposed upstream on the Upstream board.
Aklapper moved this task from Backlog to Upstreamed on the Phabricator (Upstream) board.

This issue should now be fixed on phabricator.wikimedia.org after today's software deployment in T404134.