prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  `meltano lock` -> variant 'original' is not known to Meltano
  I'm getting the following error when I'm trying to run a `meltano lock --all` on [the squared project](https://github.com/meltano/squared/blob/4d0151cf714d9158617d6d76757d21a29c3a38f7/data/extract/extractors.meltano.yml#L63) (note, I did first manually updated to remove executable and namespace which were defined in my project). When I commented out the `inherit_from` children it works, the plugin is locked, then uncommenting the children again makes it fail again so I'm pretty sure its related to the inheriting.
  
  ```
  File "/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/project_plugins_service.py", line 521, in get_parent
      parent, source = self.find_parent(plugin)
    File "/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/project_plugins_service.py", line 510, in find_parent
      raise error
    File "/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/project_plugins_service.py", line 505, in find_parent
      return (self._get_parent_from_hub(plugin), DefinitionSource.HUB)
    File "/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/project_plugins_service.py", line 441, in _get_parent_from_hub
      return self.hub_service.get_base_plugin(plugin, variant_name=plugin.variant)
    File "/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/plugin_discovery_service.py", line 136, in get_base_plugin
      plugin = project_plugin.custom_definition or self.find_definition(
    File "/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/hub/client.py", line 189, in find_definition
      raise HubPluginVariantNotFound(
  meltano.core.hub.client.HubPluginVariantNotFound: Extractor 'tap-github' variant 'original' is not known to Meltano. Variants: ['singer-io (default)', 'meltanolabs']
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File "/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/cli/__init__.py", line 74, in _run_cli
      raise CliError(str(err)) from err
  meltano.cli.utils.CliError: Extractor 'tap-github' variant 'original' is not known to Meltano. Variants: ['singer-io (default)', 'meltanolabs']
  Extractor 'tap-github' variant 'original' is not known to Meltano. Variants: ['singer-io (default)', 'meltanolabs']
  ```
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/meltano/cli/lock.py`
  Content:
  ```
  1 """Lock command."""
  2 
  3 from __future__ import annotations
  4 
  5 from typing import TYPE_CHECKING
  6 
  7 import click
  8 import structlog
  9 
  10 from meltano.core.plugin import PluginType
  11 from meltano.core.plugin_lock_service import (
  12     LockfileAlreadyExistsError,
  13     PluginLockService,
  14 )
  15 from meltano.core.project_plugins_service import DefinitionSource, ProjectPluginsService
  16 from meltano.core.tracking import CliEvent, PluginsTrackingContext
  17 
  18 from . import CliError, cli
  19 from .params import pass_project
  20 from .utils import InstrumentedCmd
  21 
  22 if TYPE_CHECKING:
  23     from meltano.core.project import Project
  24 
  25 
  26 __all__ = ["lock"]
  27 logger = structlog.get_logger(__name__)
  28 
  29 
  30 @cli.command(cls=InstrumentedCmd, short_help="Lock plugin definitions.")
  31 @click.option(
  32     "--all",
  33     "all_plugins",
  34     is_flag=True,
  35     help="Lock all the plugins of the project.",
  36 )
  37 @click.option(
  38     "--plugin-type",
  39     type=click.Choice(PluginType.cli_arguments()),
  40     help="Lock only the plugins of the given type.",
  41 )
  42 @click.argument("plugin_name", nargs=-1, required=False)
  43 @click.option("--update", "-u", is_flag=True, help="Update the lock file.")
  44 @click.pass_context
  45 @pass_project()
  46 def lock(
  47     project: Project,
  48     ctx: click.Context,
  49     all_plugins: bool,
  50     plugin_type: str | None,
  51     plugin_name: tuple[str, ...],
  52     update: bool,
  53 ):
  54     """Lock plugin definitions.
  55 
  56     \b\nRead more at https://docs.meltano.com/reference/command-line-interface#lock
  57     """
  58     tracker = ctx.obj["tracker"]
  59 
  60     lock_service = PluginLockService(project)
  61     plugins_service = ProjectPluginsService(project)
  62 
  63     if (all_plugins and plugin_name) or not (all_plugins or plugin_name):
  64         tracker.track_command_event(CliEvent.aborted)
  65         raise CliError("Exactly one of --all or plugin name must be specified.")
  66 
  67     with plugins_service.use_preferred_source(DefinitionSource.HUB):
  68         try:
  69             # Make it a list so source preference is not lazily evaluated.
  70             plugins = list(plugins_service.plugins())
  71 
  72         except Exception:
  73             tracker.track_command_event(CliEvent.aborted)
  74             raise
  75 
  76     if plugin_name:
  77         plugins = [plugin for plugin in plugins if plugin.name in plugin_name]
  78 
  79     if plugin_type:
  80         plugin_type = PluginType.from_cli_argument(plugin_type)
  81         plugins = [plugin for plugin in plugins if plugin.type == plugin_type]
  82 
  83     tracked_plugins = []
  84 
  85     for plugin in plugins:
  86         descriptor = f"{plugin.type.descriptor} {plugin.name}"
  87         if plugin.is_custom():
  88             click.secho(f"{descriptor.capitalize()} is a custom plugin", fg="yellow")
  89         else:
  90             try:
  91                 lock_service.save(plugin, exists_ok=update)
  92             except LockfileAlreadyExistsError as err:
  93                 relative_path = err.path.relative_to(project.root)
  94                 click.secho(
  95                     f"Lockfile exists for {descriptor} at {relative_path}",
  96                     fg="red",
  97                 )
  98                 continue
  99 
  100             tracked_plugins.append((plugin, None))
  101             click.secho(f"Locked definition for {descriptor}", fg="green")
  102 
  103     tracker.add_contexts(PluginsTrackingContext(tracked_plugins))
  104     tracker.track_command_event(CliEvent.completed)
  105
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/meltano/cli/lock.py b/src/meltano/cli/lock.py
  --- a/src/meltano/cli/lock.py
  +++ b/src/meltano/cli/lock.py
  @@ -64,14 +64,12 @@
           tracker.track_command_event(CliEvent.aborted)
           raise CliError("Exactly one of --all or plugin name must be specified.")
   
  -    with plugins_service.use_preferred_source(DefinitionSource.HUB):
  -        try:
  -            # Make it a list so source preference is not lazily evaluated.
  -            plugins = list(plugins_service.plugins())
  -
  -        except Exception:
  -            tracker.track_command_event(CliEvent.aborted)
  -            raise
  +    try:
  +        # Make it a list so source preference is not lazily evaluated.
  +        plugins = list(plugins_service.plugins())
  +    except Exception:
  +        tracker.track_command_event(CliEvent.aborted)
  +        raise
   
       if plugin_name:
           plugins = [plugin for plugin in plugins if plugin.name in plugin_name]
  @@ -86,7 +84,14 @@
           descriptor = f"{plugin.type.descriptor} {plugin.name}"
           if plugin.is_custom():
               click.secho(f"{descriptor.capitalize()} is a custom plugin", fg="yellow")
  +        elif plugin.inherit_from is not None:
  +            click.secho(
  +                f"{descriptor.capitalize()} is an inherited plugin", fg="yellow"
  +            )
           else:
  +            plugin.parent = None
  +            with plugins_service.use_preferred_source(DefinitionSource.HUB):
  +                plugin = plugins_service.ensure_parent(plugin)
               try:
                   lock_service.save(plugin, exists_ok=update)
               except LockfileAlreadyExistsError as err:
  
verification_info: {"golden_diff": "diff --git a/src/meltano/cli/lock.py b/src/meltano/cli/lock.py\n--- a/src/meltano/cli/lock.py\n+++ b/src/meltano/cli/lock.py\n@@ -64,14 +64,12 @@\n         tracker.track_command_event(CliEvent.aborted)\n         raise CliError(\"Exactly one of --all or plugin name must be specified.\")\n \n-    with plugins_service.use_preferred_source(DefinitionSource.HUB):\n-        try:\n-            # Make it a list so source preference is not lazily evaluated.\n-            plugins = list(plugins_service.plugins())\n-\n-        except Exception:\n-            tracker.track_command_event(CliEvent.aborted)\n-            raise\n+    try:\n+        # Make it a list so source preference is not lazily evaluated.\n+        plugins = list(plugins_service.plugins())\n+    except Exception:\n+        tracker.track_command_event(CliEvent.aborted)\n+        raise\n \n     if plugin_name:\n         plugins = [plugin for plugin in plugins if plugin.name in plugin_name]\n@@ -86,7 +84,14 @@\n         descriptor = f\"{plugin.type.descriptor} {plugin.name}\"\n         if plugin.is_custom():\n             click.secho(f\"{descriptor.capitalize()} is a custom plugin\", fg=\"yellow\")\n+        elif plugin.inherit_from is not None:\n+            click.secho(\n+                f\"{descriptor.capitalize()} is an inherited plugin\", fg=\"yellow\"\n+            )\n         else:\n+            plugin.parent = None\n+            with plugins_service.use_preferred_source(DefinitionSource.HUB):\n+                plugin = plugins_service.ensure_parent(plugin)\n             try:\n                 lock_service.save(plugin, exists_ok=update)\n             except LockfileAlreadyExistsError as err:\n", "issue": "`meltano lock` -> variant 'original' is not known to Meltano\nI'm getting the following error when I'm trying to run a `meltano lock --all` on [the squared project](https://github.com/meltano/squared/blob/4d0151cf714d9158617d6d76757d21a29c3a38f7/data/extract/extractors.meltano.yml#L63) (note, I did first manually updated to remove executable and namespace which were defined in my project). When I commented out the `inherit_from` children it works, the plugin is locked, then uncommenting the children again makes it fail again so I'm pretty sure its related to the inheriting.\r\n\r\n```\r\nFile \"/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/project_plugins_service.py\", line 521, in get_parent\r\n    parent, source = self.find_parent(plugin)\r\n  File \"/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/project_plugins_service.py\", line 510, in find_parent\r\n    raise error\r\n  File \"/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/project_plugins_service.py\", line 505, in find_parent\r\n    return (self._get_parent_from_hub(plugin), DefinitionSource.HUB)\r\n  File \"/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/project_plugins_service.py\", line 441, in _get_parent_from_hub\r\n    return self.hub_service.get_base_plugin(plugin, variant_name=plugin.variant)\r\n  File \"/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/plugin_discovery_service.py\", line 136, in get_base_plugin\r\n    plugin = project_plugin.custom_definition or self.find_definition(\r\n  File \"/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/core/hub/client.py\", line 189, in find_definition\r\n    raise HubPluginVariantNotFound(\r\nmeltano.core.hub.client.HubPluginVariantNotFound: Extractor 'tap-github' variant 'original' is not known to Meltano. Variants: ['singer-io (default)', 'meltanolabs']\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/pnadolny/.virtualenvs/meltano/lib/python3.8/site-packages/meltano/cli/__init__.py\", line 74, in _run_cli\r\n    raise CliError(str(err)) from err\r\nmeltano.cli.utils.CliError: Extractor 'tap-github' variant 'original' is not known to Meltano. Variants: ['singer-io (default)', 'meltanolabs']\r\nExtractor 'tap-github' variant 'original' is not known to Meltano. Variants: ['singer-io (default)', 'meltanolabs']\r\n```\n", "before_files": [{"content": "\"\"\"Lock command.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nimport click\nimport structlog\n\nfrom meltano.core.plugin import PluginType\nfrom meltano.core.plugin_lock_service import (\n    LockfileAlreadyExistsError,\n    PluginLockService,\n)\nfrom meltano.core.project_plugins_service import DefinitionSource, ProjectPluginsService\nfrom meltano.core.tracking import CliEvent, PluginsTrackingContext\n\nfrom . import CliError, cli\nfrom .params import pass_project\nfrom .utils import InstrumentedCmd\n\nif TYPE_CHECKING:\n    from meltano.core.project import Project\n\n\n__all__ = [\"lock\"]\nlogger = structlog.get_logger(__name__)\n\n\n@cli.command(cls=InstrumentedCmd, short_help=\"Lock plugin definitions.\")\n@click.option(\n    \"--all\",\n    \"all_plugins\",\n    is_flag=True,\n    help=\"Lock all the plugins of the project.\",\n)\n@click.option(\n    \"--plugin-type\",\n    type=click.Choice(PluginType.cli_arguments()),\n    help=\"Lock only the plugins of the given type.\",\n)\n@click.argument(\"plugin_name\", nargs=-1, required=False)\n@click.option(\"--update\", \"-u\", is_flag=True, help=\"Update the lock file.\")\n@click.pass_context\n@pass_project()\ndef lock(\n    project: Project,\n    ctx: click.Context,\n    all_plugins: bool,\n    plugin_type: str | None,\n    plugin_name: tuple[str, ...],\n    update: bool,\n):\n    \"\"\"Lock plugin definitions.\n\n    \\b\\nRead more at https://docs.meltano.com/reference/command-line-interface#lock\n    \"\"\"\n    tracker = ctx.obj[\"tracker\"]\n\n    lock_service = PluginLockService(project)\n    plugins_service = ProjectPluginsService(project)\n\n    if (all_plugins and plugin_name) or not (all_plugins or plugin_name):\n        tracker.track_command_event(CliEvent.aborted)\n        raise CliError(\"Exactly one of --all or plugin name must be specified.\")\n\n    with plugins_service.use_preferred_source(DefinitionSource.HUB):\n        try:\n            # Make it a list so source preference is not lazily evaluated.\n            plugins = list(plugins_service.plugins())\n\n        except Exception:\n            tracker.track_command_event(CliEvent.aborted)\n            raise\n\n    if plugin_name:\n        plugins = [plugin for plugin in plugins if plugin.name in plugin_name]\n\n    if plugin_type:\n        plugin_type = PluginType.from_cli_argument(plugin_type)\n        plugins = [plugin for plugin in plugins if plugin.type == plugin_type]\n\n    tracked_plugins = []\n\n    for plugin in plugins:\n        descriptor = f\"{plugin.type.descriptor} {plugin.name}\"\n        if plugin.is_custom():\n            click.secho(f\"{descriptor.capitalize()} is a custom plugin\", fg=\"yellow\")\n        else:\n            try:\n                lock_service.save(plugin, exists_ok=update)\n            except LockfileAlreadyExistsError as err:\n                relative_path = err.path.relative_to(project.root)\n                click.secho(\n                    f\"Lockfile exists for {descriptor} at {relative_path}\",\n                    fg=\"red\",\n                )\n                continue\n\n            tracked_plugins.append((plugin, None))\n            click.secho(f\"Locked definition for {descriptor}\", fg=\"green\")\n\n    tracker.add_contexts(PluginsTrackingContext(tracked_plugins))\n    tracker.track_command_event(CliEvent.completed)\n", "path": "src/meltano/cli/lock.py"}], "after_files": [{"content": "\"\"\"Lock command.\"\"\"\n\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nimport click\nimport structlog\n\nfrom meltano.core.plugin import PluginType\nfrom meltano.core.plugin_lock_service import (\n    LockfileAlreadyExistsError,\n    PluginLockService,\n)\nfrom meltano.core.project_plugins_service import DefinitionSource, ProjectPluginsService\nfrom meltano.core.tracking import CliEvent, PluginsTrackingContext\n\nfrom . import CliError, cli\nfrom .params import pass_project\nfrom .utils import InstrumentedCmd\n\nif TYPE_CHECKING:\n    from meltano.core.project import Project\n\n\n__all__ = [\"lock\"]\nlogger = structlog.get_logger(__name__)\n\n\n@cli.command(cls=InstrumentedCmd, short_help=\"Lock plugin definitions.\")\n@click.option(\n    \"--all\",\n    \"all_plugins\",\n    is_flag=True,\n    help=\"Lock all the plugins of the project.\",\n)\n@click.option(\n    \"--plugin-type\",\n    type=click.Choice(PluginType.cli_arguments()),\n    help=\"Lock only the plugins of the given type.\",\n)\n@click.argument(\"plugin_name\", nargs=-1, required=False)\n@click.option(\"--update\", \"-u\", is_flag=True, help=\"Update the lock file.\")\n@click.pass_context\n@pass_project()\ndef lock(\n    project: Project,\n    ctx: click.Context,\n    all_plugins: bool,\n    plugin_type: str | None,\n    plugin_name: tuple[str, ...],\n    update: bool,\n):\n    \"\"\"Lock plugin definitions.\n\n    \\b\\nRead more at https://docs.meltano.com/reference/command-line-interface#lock\n    \"\"\"\n    tracker = ctx.obj[\"tracker\"]\n\n    lock_service = PluginLockService(project)\n    plugins_service = ProjectPluginsService(project)\n\n    if (all_plugins and plugin_name) or not (all_plugins or plugin_name):\n        tracker.track_command_event(CliEvent.aborted)\n        raise CliError(\"Exactly one of --all or plugin name must be specified.\")\n\n    try:\n        # Make it a list so source preference is not lazily evaluated.\n        plugins = list(plugins_service.plugins())\n    except Exception:\n        tracker.track_command_event(CliEvent.aborted)\n        raise\n\n    if plugin_name:\n        plugins = [plugin for plugin in plugins if plugin.name in plugin_name]\n\n    if plugin_type:\n        plugin_type = PluginType.from_cli_argument(plugin_type)\n        plugins = [plugin for plugin in plugins if plugin.type == plugin_type]\n\n    tracked_plugins = []\n\n    for plugin in plugins:\n        descriptor = f\"{plugin.type.descriptor} {plugin.name}\"\n        if plugin.is_custom():\n            click.secho(f\"{descriptor.capitalize()} is a custom plugin\", fg=\"yellow\")\n        elif plugin.inherit_from is not None:\n            click.secho(\n                f\"{descriptor.capitalize()} is an inherited plugin\", fg=\"yellow\"\n            )\n        else:\n            plugin.parent = None\n            with plugins_service.use_preferred_source(DefinitionSource.HUB):\n                plugin = plugins_service.ensure_parent(plugin)\n            try:\n                lock_service.save(plugin, exists_ok=update)\n            except LockfileAlreadyExistsError as err:\n                relative_path = err.path.relative_to(project.root)\n                click.secho(\n                    f\"Lockfile exists for {descriptor} at {relative_path}\",\n                    fg=\"red\",\n                )\n                continue\n\n            tracked_plugins.append((plugin, None))\n            click.secho(f\"Locked definition for {descriptor}\", fg=\"green\")\n\n    tracker.add_contexts(PluginsTrackingContext(tracked_plugins))\n    tracker.track_command_event(CliEvent.completed)\n", "path": "src/meltano/cli/lock.py"}]}