Page MenuHomePhabricator

GET /api/user/favorites/ body unexpectedly includes nested "tool" subobject
Closed, ResolvedPublicBUG REPORT

Description

This seems to be an artifact of our FavoritesItemSerializer implementation.
Actual:

{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
      "tool": {
        "name": "wikimedia-toolhub",
        "title": "Toolhub",
        "description": "Toolhub provides both an API and a user interface for documenting and browsing a community curated collection of information about tools used by the Wikimedia movement.",
        "url": "https://toolhub.wikimedia.org",
        "keywords": [],
        "author": "Wikimedia Foundation",
        "icon": "https://commons.wikimedia.org/wiki/File:Toolhub_community_logo.svg"
      }
    },
    {
      "tool": {
        "name": "toolforge-admin",
        "title": "Toolforge homepage",
        "description": "This tool serves the Toolforge landing page, and performs a number of scheduled processes to maintain the project metadata.\r\n\r\nMaintainers of this tool have administrative access to the tools project infrastructure, and are good people to contact if you are having issues.",
        "url": "https://admin.toolforge.org/",
        "keywords": [
          "toolforge"
        ],
        "author": "Bryan Davis, Marc-André Pelletier",
        "icon": null
      }
    },
    {
      "tool": {
        "name": "toolforge-stashbot",
        "title": "stashbot",
        "description": "An IRC bot that stores data for use by other tools, responds to `!log` messages, and gives information about Phabricator objects referenced in messages.",
        "url": "https://stashbot.toolforge.org/",
        "keywords": [
          "bot",
          "irc",
          "kubernetes",
          "phabricator",
          "python",
          "sal"
        ],
        "author": "Bryan Davis",
        "icon": null
      }
    },
    {
      "tool": {
        "name": "toolforge-phabulous",
        "title": "Phabricator task creation link builder",
        "description": "Generate URLs that will create new Phabricator tasks with some parts pre-filled in. See [[mw:Phabricator/Help/Task Creation URL]] for additional information.",
        "url": "https://phabulous.toolforge.org/",
        "keywords": [
          "phabricator"
        ],
        "author": "Bryan Davis",
        "icon": null
      }
    },
    {
      "tool": {
        "name": "mediawiki",
        "title": "MediaWiki",
        "description": "The MediaWiki software is used by tens of thousands of websites and thousands of companies and organizations. It powers Wikipedia and the Wikimedia projects. MediaWiki helps you collect and organize knowledge and make it available to people. It's powerful, multilingual, free and open, extensible, customizable, reliable, and free of charge.",
        "url": "https://www.mediawiki.org/wiki/MediaWiki",
        "keywords": [],
        "author": "Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, et al",
        "icon": "https://commons.wikimedia.org/wiki/File:Mediawiki_logo_proposal_(gradient_translucent,_capitalised).svg"
      }
    }
  ]
}

Expected:

{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
        "name": "wikimedia-toolhub",
        "title": "Toolhub",
        "description": "Toolhub provides both an API and a user interface for documenting and browsing a community curated collection of information about tools used by the Wikimedia movement.",
        "url": "https://toolhub.wikimedia.org",
        "keywords": [],
        "author": "Wikimedia Foundation",
        "icon": "https://commons.wikimedia.org/wiki/File:Toolhub_community_logo.svg"
    },
    {
        "name": "toolforge-admin",
        "title": "Toolforge homepage",
        "description": "This tool serves the Toolforge landing page, and performs a number of scheduled processes to maintain the project metadata.\r\n\r\nMaintainers of this tool have administrative access to the tools project infrastructure, and are good people to contact if you are having issues.",
        "url": "https://admin.toolforge.org/",
        "keywords": [
          "toolforge"
        ],
        "author": "Bryan Davis, Marc-André Pelletier",
        "icon": null
    },
    {
        "name": "toolforge-stashbot",
        "title": "stashbot",
        "description": "An IRC bot that stores data for use by other tools, responds to `!log` messages, and gives information about Phabricator objects referenced in messages.",
        "url": "https://stashbot.toolforge.org/",
        "keywords": [
          "bot",
          "irc",
          "kubernetes",
          "phabricator",
          "python",
          "sal"
        ],
        "author": "Bryan Davis",
        "icon": null
    },
    {
        "name": "toolforge-phabulous",
        "title": "Phabricator task creation link builder",
        "description": "Generate URLs that will create new Phabricator tasks with some parts pre-filled in. See [[mw:Phabricator/Help/Task Creation URL]] for additional information.",
        "url": "https://phabulous.toolforge.org/",
        "keywords": [
          "phabricator"
        ],
        "author": "Bryan Davis",
        "icon": null
    },
    {
        "name": "mediawiki",
        "title": "MediaWiki",
        "description": "The MediaWiki software is used by tens of thousands of websites and thousands of companies and organizations. It powers Wikipedia and the Wikimedia projects. MediaWiki helps you collect and organize knowledge and make it available to people. It's powerful, multilingual, free and open, extensible, customizable, reliable, and free of charge.",
        "url": "https://www.mediawiki.org/wiki/MediaWiki",
        "keywords": [],
        "author": "Magnus Manske, Brion Vibber, Lee Daniel Crocker, Tim Starling, et al",
        "icon": "https://commons.wikimedia.org/wiki/File:Mediawiki_logo_proposal_(gradient_translucent,_capitalised).svg"
    }
  ]
}

Event Timeline

bd808 changed the task status from Open to In Progress.Nov 4 2021, 10:20 PM
bd808 claimed this task.
bd808 triaged this task as High priority.
bd808 created this task.
bd808 moved this task from Backlog to In Progress on the Toolhub board.

Change 737052 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[wikimedia/toolhub@main] api: Remove \"tool\":{...} indirection in /api/user/favorites/ output

https://gerrit.wikimedia.org/r/737052

Change 737052 merged by jenkins-bot:

[wikimedia/toolhub@main] api: Remove \"tool\":{...} indirection in /api/user/favorites/ output

https://gerrit.wikimedia.org/r/737052

Change 749220 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[operations/deployment-charts@master] toolhub: Bump container version to 2021-12-20-122341-production

https://gerrit.wikimedia.org/r/749220

Change 749220 merged by jenkins-bot:

[operations/deployment-charts@master] toolhub: Bump container version to 2021-12-23-121200-production

https://gerrit.wikimedia.org/r/749220